shell bypass 403
�
wf;| � � � d Z ddlZddlmZ ddlmZ dgZd� Zd� Z d� Z
dd �Zd
� Zd� Z
d� Zd
� Zdd�Zd� Zdd�Zdd�Z eed�� dd�� Zy)zl
The arraypad module contains a group of functions to pad values onto the edges
of an n-dimensional array.
� N)�array_function_dispatch)�ndindex�padc �r � t j |t j � r| j | �� yy)z�
Rounds arr inplace if destination dtype is integer.
Parameters
----------
arr : ndarray
Input array.
dtype : dtype
The dtype of the destination array.
)�outN)�np�
issubdtype�integer�round)�arr�dtypes �I/usr/local/python-3.12/lib/python3.12/site-packages/numpy/lib/arraypad.py�_round_if_neededr s) � �
�}�}�U�B�J�J�'�� � �c� �� (� c �. � t d� f|z | fz dz S )a�
Construct tuple of slices to slice an array in the given dimension.
Parameters
----------
sl : slice
The slice for the given dimension.
axis : int
The axis to which `sl` is applied. All other dimensions are left
"unsliced".
Returns
-------
sl : tuple of slices
A tuple with slices matching `shape` in length.
Examples
--------
>>> _slice_at_axis(slice(None, 3, -1), 1)
(slice(None, None, None), slice(None, 3, -1), (...,))
N).��slice)�sl�axiss r �_slice_at_axisr ! s! � �,
�$�K�>�D� �B�5�(�6�1�1r c �@ � |dz
}t d� f|z ||d z }| | S )a�
Get a view of the current region of interest during iterative padding.
When padding multiple dimensions iteratively corner values are
unnecessarily overwritten multiple times. This function reduces the
working area for the first dimensions so that corners are excluded.
Parameters
----------
array : ndarray
The array with the region of interest.
original_area_slice : tuple of slices
Denotes the area with original values of the unpadded array.
axis : int
The currently padded dimension assuming that `axis` is padded before
`axis` + 1.
Returns
-------
roi : ndarray
The region of interest of the original `array`.
� Nr )�array�original_area_slicer r s r � _view_roir : s4 � �. �A�I�D�
��+��$� �!4�T�U�!;� ;�B���9�r c �J � t d� t | j |� D � � }| j j rdnd}t j || j |�� }|�|j |� t d� t | j |� D � � }| ||<