§ <ˆj,ãó¼—dZddlmZmZmZddlmZmZdgZddddddddddd d d d d œZ eed ¦«dd dœd„¦«¦«Z e¦«e ¦«Z d S)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óÄ—|�t||||¬¦«S|st||¬¦«Sd„|D¦«}d|vr| d¦«d}nd}d}|d d hkrtd ¦«‚d |vrd }| d ¦«nd |vrd }| d ¦«t |||d|¬ ¦«}|D]&}|j|s| |¦«cSŒ'|S) 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 N)ÚdtypeÚ requirements)rcóL—h|]!}t| ¦«’Œ"S©)ÚPOSSIBLE_FLAGSÚupper)Ú.0Úxs úJ/opt/cloudlinux/venv/lib64/python3.11/site-packages/numpy/core/_asarray.pyú zrequire..ls%€ÐDÐDÐD°!•N 1§7¢7¡9¤9Ô-ÐDÐDÐDórFTr r r z%Cannot specify both "C" and "F" order)rÚorderÚcopyÚsubok)Ú_require_with_likerÚremoveÚ ValueErrorrÚflagsr&)Úarrrr'r%ÚarrÚprops r"rrsL€ðL ÐÝ!Ø Ø ØØ%ð  ñ ô ð ð ð*ݘ! 5Ð)Ñ)Ô)Ð)àDÐD°|ÐDÑDÔD€Là ˆlÐÐØ×Ò˜CÑ Ô Ð Øˆˆàˆà €Eؘ˜S�zÒ!Ð!ÝÐ@ÑAÔAÐAØ � РР؈Ø×Ò˜CÑ Ô Ð Ð Ø � РР؈Ø×Ò˜CÑ Ô Ð å �˜ e°%¸uÐ EÑ EÔ E€Càð#ð#ˆØŒy˜Œð #Ø—8’8˜E‘?”?Ð "Ð "Ð "ð #à €Jr$)NN) Ú__doc__Ú overridesrrrÚ multiarrayrrÚ__all__rrr(rr$r"úr3sÿðððð ðððððððððð *Ð)Ð)Ð)Ð)Ð)Ð)Ð)ð ˆ+€ð ˜c°Ø ˜c¨cØ ˜Ø ˜3Ø ˜Ø ˜Sð ð€ðØ €ˆGÑÔðf°dðfðfðfðfñÔñÔðfðR/Ð,Ð,Ñ.Ô.¨wÑ7Ô7ÐÐÐr$