
    h,                         S r SSKJrJrJr  SSKJrJr  S/rSSSSSSSSSSS	S	S
S
S.r	\\" S5      SSS.S jj5       5       r
\" 5       " \
5      rg)z
Functions in the ``as*array`` family that promote array-likes into arrays.

`require` fits this category despite its name not matching this pattern.
   )array_function_dispatchset_array_function_like_doc
set_module)array
asanyarrayrequireCFAWOE)r	   C_CONTIGUOUS
CONTIGUOUSr
   F_CONTIGUOUSFORTRANr   ALIGNEDr   	WRITEABLEr   OWNDATAr   ENSUREARRAYnumpyN)likec                   Ub  [        UU UUS9$ U(       d	  [        XS9$ U Vs1 s H  n[        UR                  5          iM     nnSU;   a  UR	                  S5        SnOSnSnUSS1:  a  [        S	5      eSU;   a  SnUR	                  S5        OSU;   a  SnUR	                  S5        [        XUSUS
9nU H*  nUR                  U   (       a  M  UR                  U5      s  $    U$ s  snf )a  
Return an ndarray of the provided type that satisfies requirements.

This function is useful to be sure that an array with the correct flags
is returned for passing to compiled code (perhaps through ctypes).

Parameters
----------
a : array_like
   The object to be converted to a type-and-requirement-satisfying array.
dtype : data-type
   The required data-type. If None preserve the current dtype. If your
   application requires the data to be in native byteorder, include
   a byteorder specification as a part of the dtype specification.
requirements : str or sequence of str
   The requirements list can be any of the following

   * 'F_CONTIGUOUS' ('F') - ensure a Fortran-contiguous array
   * 'C_CONTIGUOUS' ('C') - ensure a C-contiguous array
   * 'ALIGNED' ('A')      - ensure a data-type aligned array
   * 'WRITEABLE' ('W')    - ensure a writable array
   * 'OWNDATA' ('O')      - ensure an array that owns its own data
   * 'ENSUREARRAY', ('E') - ensure a base array, instead of a subclass
${ARRAY_FUNCTION_LIKE}

    .. versionadded:: 1.20.0

Returns
-------
out : ndarray
    Array with specified requirements and type if given.

See Also
--------
asarray : Convert input to an ndarray.
asanyarray : Convert to an ndarray, but pass through ndarray subclasses.
ascontiguousarray : Convert input to a contiguous array.
asfortranarray : Convert input to an ndarray with column-major
                 memory order.
ndarray.flags : Information about the memory layout of the array.

Notes
-----
The returned array will be guaranteed to have the listed requirements
by making a copy if needed.

Examples
--------
>>> x = np.arange(6).reshape(2,3)
>>> x.flags
  C_CONTIGUOUS : True
  F_CONTIGUOUS : False
  OWNDATA : False
  WRITEABLE : True
  ALIGNED : True
  WRITEBACKIFCOPY : False

>>> y = np.require(x, dtype=np.float32, requirements=['A', 'O', 'W', 'F'])
>>> y.flags
  C_CONTIGUOUS : False
  F_CONTIGUOUS : True
  OWNDATA : True
  WRITEABLE : True
  ALIGNED : True
  WRITEBACKIFCOPY : False

)dtyperequirements)r   r   FTr   r	   r
   z%Cannot specify both "C" and "F" order)r   ordercopysubok)	_require_with_liker   POSSIBLE_FLAGSupperremove
ValueErrorr   flagsr   )	ar   r   r   xr   r   arrprops	            M/var/www/fran/franai/venv/lib/python3.13/site-packages/numpy/core/_asarray.pyr   r      s   L !%	
 	
 !))7CD|!N1779-|LD
lC ESz!@AA		C 		C 
e%u
ECyy88E?"  J/ Es   !C))NN)__doc__	overridesr   r   r   
multiarrayr   r   __all__r    r   r        r)   <module>r0      s   
 
 * + 
c	cc		3		S Gfd f  fR -.w7 r/   