
    wgK                        d Z ddlZddlmZ ddlmZmZmZ ddlm	Z	m
ZmZ ddlmZ dd	lmZ dd
l ddlmZ ddlmZmZmZmZmZm Z! g dZ" ejF                  ejH                  d      Z$d Z% e$e%      d        Z& e$e%      d        Z' e$e%      d        Z( e$e%      d        Z) e$e%      d        Z* e$e%      d        Z+d Z ed       G d de	             Z, ed      dd       Z
 ed      dd       Zy)an  
This module contains a set of functions for vectorized string
operations and methods.

.. note::
   The `chararray` class exists for backwards compatibility with
   Numarray, it is not recommended for new development. Starting from numpy
   1.4, if one needs arrays of strings, it is recommended to use arrays of
   `dtype` `object_`, `bytes_` or `str_`, and use the free functions
   in the `numpy.char` module for fast vectorized string operations.

Some methods will only be available if the corresponding string method is
available in your version of Python.

The preferred alias for `defchararray` is `numpy.char`.

    N   )
set_module   )bytes_str_	character)ndarrayarrayasarraycompare_chararrays)	overrides)*)multiply)
_partition_rpartition_split_rsplit_splitlines_join)5equal	not_equalgreater_equal
less_equalgreaterlessstr_lenaddr   mod
capitalizecentercountdecodeencodeendswith
expandtabsfindindexisalnumisalphaisdigitislowerisspaceistitleisupperjoinljustlowerlstrip	partitionreplacerfindrindexrjust
rpartitionrsplitrstripsplit
splitlines
startswithstripswapcasetitle	translateupperzfill	isnumeric	isdecimalr
   r   r   	chararrayz
numpy.char)modulec                 
    | |fS N x1x2s     ]/home/mcse/projects/flask/flask-venv/lib/python3.12/site-packages/numpy/_core/defchararray.py_binary_op_dispatcherrP   5   s    8O    c                     t        | |dd      S )ao  
    Return (x1 == x2) element-wise.

    Unlike `numpy.equal`, this comparison is performed by first
    stripping whitespace characters from the end of the string.  This
    behavior is provided for backward-compatibility with numarray.

    Parameters
    ----------
    x1, x2 : array_like of str or unicode
        Input arrays of the same shape.

    Returns
    -------
    out : ndarray
        Output array of bools.

    Examples
    --------
    >>> y = "aa "
    >>> x = "aa"
    >>> np.char.equal(x, y)
    array(True)    

    See Also
    --------
    not_equal, greater_equal, less_equal, greater, less
    z==Tr   rL   s     rO   r   r   9       < b"dD11rQ   c                     t        | |dd      S )a  
    Return (x1 != x2) element-wise.

    Unlike `numpy.not_equal`, this comparison is performed by first
    stripping whitespace characters from the end of the string.  This
    behavior is provided for backward-compatibility with numarray.

    Parameters
    ----------
    x1, x2 : array_like of str or unicode
        Input arrays of the same shape.

    Returns
    -------
    out : ndarray
        Output array of bools.

    See Also
    --------
    equal, greater_equal, less_equal, greater, less

    Examples
    --------
    >>> x1 = np.array(['a', 'b', 'c'])
    >>> np.char.not_equal(x1, 'b')
    array([ True, False,  True])
    
    z!=Tr   rL   s     rO   r   r   Z   rS   rQ   c                     t        | |dd      S )a  
    Return (x1 >= x2) element-wise.

    Unlike `numpy.greater_equal`, this comparison is performed by
    first stripping whitespace characters from the end of the string.
    This behavior is provided for backward-compatibility with
    numarray.

    Parameters
    ----------
    x1, x2 : array_like of str or unicode
        Input arrays of the same shape.

    Returns
    -------
    out : ndarray
        Output array of bools.

    See Also
    --------
    equal, not_equal, less_equal, greater, less

    Examples
    --------
    >>> x1 = np.array(['a', 'b', 'c'])
    >>> np.char.greater_equal(x1, 'b')
    array([False,  True,  True])
    
    z>=Tr   rL   s     rO   r   r   {   s    > b"dD11rQ   c                     t        | |dd      S )a  
    Return (x1 <= x2) element-wise.

    Unlike `numpy.less_equal`, this comparison is performed by first
    stripping whitespace characters from the end of the string.  This
    behavior is provided for backward-compatibility with numarray.

    Parameters
    ----------
    x1, x2 : array_like of str or unicode
        Input arrays of the same shape.

    Returns
    -------
    out : ndarray
        Output array of bools.

    See Also
    --------
    equal, not_equal, greater_equal, greater, less

    Examples
    --------
    >>> x1 = np.array(['a', 'b', 'c'])
    >>> np.char.less_equal(x1, 'b')
    array([ True,  True, False])
    
    z<=Tr   rL   s     rO   r   r      rS   rQ   c                     t        | |dd      S )a  
    Return (x1 > x2) element-wise.

    Unlike `numpy.greater`, this comparison is performed by first
    stripping whitespace characters from the end of the string.  This
    behavior is provided for backward-compatibility with numarray.

    Parameters
    ----------
    x1, x2 : array_like of str or unicode
        Input arrays of the same shape.

    Returns
    -------
    out : ndarray
        Output array of bools.

    See Also
    --------
    equal, not_equal, greater_equal, less_equal, less
    
    Examples
    --------
    >>> x1 = np.array(['a', 'b', 'c'])
    >>> np.char.greater(x1, 'b')
    array([False, False,  True])
    
    >Tr   rL   s     rO   r   r          < b"c400rQ   c                     t        | |dd      S )a  
    Return (x1 < x2) element-wise.

    Unlike `numpy.greater`, this comparison is performed by first
    stripping whitespace characters from the end of the string.  This
    behavior is provided for backward-compatibility with numarray.

    Parameters
    ----------
    x1, x2 : array_like of str or unicode
        Input arrays of the same shape.

    Returns
    -------
    out : ndarray
        Output array of bools.

    See Also
    --------
    equal, not_equal, greater_equal, less_equal, greater

    Examples
    --------
    >>> x1 = np.array(['a', 'b', 'c'])
    >>> np.char.less(x1, 'b')
    array([True, False, False])
    
    <Tr   rL   s     rO   r   r      rY   rQ   c                 L    	 t        | |      S # t        $ r t        d      w xY w)a  
    Return (a * i), that is string multiple concatenation,
    element-wise.

    Values in ``i`` of less than 0 are treated as 0 (which yields an
    empty string).

    Parameters
    ----------
    a : array_like, with `np.bytes_` or `np.str_` dtype

    i : array_like, with any integer dtype

    Returns
    -------
    out : ndarray
        Output array of str or unicode, depending on input types

    Notes
    -----
    This is a thin wrapper around np.strings.multiply that raises
    `ValueError` when ``i`` is not an integer. It only
    exists for backwards-compatibility.

    Examples
    --------
    >>> a = np.array(["a", "b", "c"])
    >>> np.strings.multiply(a, 3)
    array(['aaa', 'bbb', 'ccc'], dtype='<U3')
    >>> i = np.array([1, 2, 3])
    >>> np.strings.multiply(a, i)
    array(['a', 'bb', 'ccc'], dtype='<U3')
    >>> np.strings.multiply(np.array(['a']), i)
    array(['a', 'aa', 'aaa'], dtype='<U3')
    >>> a = np.array(['a', 'b', 'c', 'd', 'e', 'f']).reshape((2, 3))
    >>> np.strings.multiply(a, 3)
    array([['aaa', 'bbb', 'ccc'],
           ['ddd', 'eee', 'fff']], dtype='<U3')
    >>> np.strings.multiply(a, i)
    array([['a', 'bb', 'ccc'],
           ['d', 'ee', 'fff']], dtype='<U3')

    zCan only multiply by integers)strings_multiply	TypeError
ValueError)ais     rO   r   r      s0    X:1%% :899:s    #c                      e Zd ZdZ	 	 d;dZd<dZd Zd Zd Zd Z	d	 Z
d
 Zd Zd Zd Zd Zd Zd Zd Zd Zd=dZej(                  j                  e_        d Zd>dZd?dZd@dZd@dZd?dZdAdZd?dZd?dZd Zd Z d Z!d  Z"d! Z#d" Z$d# Z%d$ Z&d>d%Z'd& Z(dBd'Z)d( Z*dBd)Z+d?d*Z,d?d+Z-d>d,Z.d- Z/d@d.Z0dBd/Z1d@d0Z2dBd1Z3d?d2Z4dBd3Z5d4 Z6d5 Z7dBd6Z8d7 Z9d8 Z:d9 Z;d: Z<y)CrG   a=  
    chararray(shape, itemsize=1, unicode=False, buffer=None, offset=0,
              strides=None, order=None)

    Provides a convenient view on arrays of string and unicode values.

    .. note::
       The `chararray` class exists for backwards compatibility with
       Numarray, it is not recommended for new development. Starting from numpy
       1.4, if one needs arrays of strings, it is recommended to use arrays of
       `dtype` `~numpy.object_`, `~numpy.bytes_` or `~numpy.str_`, and use
       the free functions in the `numpy.char` module for fast vectorized
       string operations.

    Versus a NumPy array of dtype `~numpy.bytes_` or `~numpy.str_`, this
    class adds the following functionality:

    1) values automatically have whitespace removed from the end
       when indexed

    2) comparison operators automatically remove whitespace from the
       end when comparing values

    3) vectorized string operations are provided as methods
       (e.g. `.endswith`) and infix operators (e.g. ``"+", "*", "%"``)

    chararrays should be created using `numpy.char.array` or
    `numpy.char.asarray`, rather than this constructor directly.

    This constructor creates the array, using `buffer` (with `offset`
    and `strides`) if it is not ``None``. If `buffer` is ``None``, then
    constructs a new array with `strides` in "C order", unless both
    ``len(shape) >= 2`` and ``order='F'``, in which case `strides`
    is in "Fortran order".

    Methods
    -------
    astype
    argsort
    copy
    count
    decode
    dump
    dumps
    encode
    endswith
    expandtabs
    fill
    find
    flatten
    getfield
    index
    isalnum
    isalpha
    isdecimal
    isdigit
    islower
    isnumeric
    isspace
    istitle
    isupper
    item
    join
    ljust
    lower
    lstrip
    nonzero
    put
    ravel
    repeat
    replace
    reshape
    resize
    rfind
    rindex
    rjust
    rsplit
    rstrip
    searchsorted
    setfield
    setflags
    sort
    split
    splitlines
    squeeze
    startswith
    strip
    swapaxes
    swapcase
    take
    title
    tofile
    tolist
    tostring
    translate
    transpose
    upper
    view
    zfill

    Parameters
    ----------
    shape : tuple
        Shape of the array.
    itemsize : int, optional
        Length of each array element, in number of characters. Default is 1.
    unicode : bool, optional
        Are the array elements of type unicode (True) or string (False).
        Default is False.
    buffer : object exposing the buffer interface or str, optional
        Memory address of the start of the array data.  Default is None,
        in which case a new array is created.
    offset : int, optional
        Fixed stride displacement from the beginning of an axis?
        Default is 0. Needs to be >=0.
    strides : array_like of ints, optional
        Strides for the array (see `~numpy.ndarray.strides` for
        full description). Default is None.
    order : {'C', 'F'}, optional
        The order in which the array data is stored in memory: 'C' ->
        "row major" order (the default), 'F' -> "column major"
        (Fortran) order.

    Examples
    --------
    >>> charar = np.char.chararray((3, 3))
    >>> charar[:] = 'a'
    >>> charar
    chararray([[b'a', b'a', b'a'],
               [b'a', b'a', b'a'],
               [b'a', b'a', b'a']], dtype='|S1')

    >>> charar = np.char.chararray(charar.shape, itemsize=5)
    >>> charar[:] = 'abc'
    >>> charar
    chararray([[b'abc', b'abc', b'abc'],
               [b'abc', b'abc', b'abc'],
               [b'abc', b'abc', b'abc']], dtype='|S5')

    Nc           	          |rt         }nt        }t        |      }t        |t              r|}	d }nd }	|t        j                  | |||f|      }
nt        j                  | |||f||||      }
|	|	|
d<   |
S )Norder)bufferoffsetstridesre   .)r   r   int
isinstancestrr	   __new__)subtypeshapeitemsizeunicoderf   rg   rh   re   dtypefillerselfs              rO   rl   zchararray.__new__  s    EE
 x=fc"FFF>??7EE83D).0D ??7EE83D*0*0').0D DIrQ   c                 j    |j                   j                  dv r|j                  t        |             S |S )NSUbc)rq   charviewtype)rs   arrcontextreturn_scalars       rO   __array_wrap__zchararray.__array_wrap__  s,     99>>V#88DJ''
rQ   c                 J    | j                   j                  dvrt        d      y )Nru   z-Can only create a chararray from string data.)rq   rv   r_   )rs   objs     rO   __array_finalize__zchararray.__array_finalize__  s#    ::??&(LMM )rQ   c                     t        j                  | |      }t        |t              r$|j	                         }t        |      dk(  rd}|S |}|S )Nr    )r	   __getitem__rj   r   r;   len)rs   r~   valtemps       rO   r   zchararray.__getitem__  sL    !!$,c9%::<D4yA~ 
 
rQ   c                     t        | |      S )zg
        Return (self == other) element-wise.

        See Also
        --------
        equal
        )r   rs   others     rO   __eq__zchararray.__eq__  s     T5!!rQ   c                     t        | |      S )zk
        Return (self != other) element-wise.

        See Also
        --------
        not_equal
        )r   r   s     rO   __ne__zchararray.__ne__  s     u%%rQ   c                     t        | |      S )zo
        Return (self >= other) element-wise.

        See Also
        --------
        greater_equal
        )r   r   s     rO   __ge__zchararray.__ge__  s     T5))rQ   c                     t        | |      S )zl
        Return (self <= other) element-wise.

        See Also
        --------
        less_equal
        )r   r   s     rO   __le__zchararray.__le__  s     $&&rQ   c                     t        | |      S )zh
        Return (self > other) element-wise.

        See Also
        --------
        greater
        )r   r   s     rO   __gt__zchararray.__gt__&  s     tU##rQ   c                     t        | |      S )ze
        Return (self < other) element-wise.

        See Also
        --------
        less
        )r   r   s     rO   __lt__zchararray.__lt__0  s     D%  rQ   c                     t        | |      S )z
        Return (self + other), that is string concatenation,
        element-wise for a pair of array_likes of str or unicode.

        See Also
        --------
        add
        r   r   s     rO   __add__zchararray.__add__:  s     4rQ   c                     t        ||       S )z
        Return (other + self), that is string concatenation,
        element-wise for a pair of array_likes of `bytes_` or `str_`.

        See Also
        --------
        add
        r   r   s     rO   __radd__zchararray.__radd__E  s     5$rQ   c                 ,    t        t        | |            S z
        Return (self * i), that is string multiple concatenation,
        element-wise.

        See Also
        --------
        multiply
        r   r   rs   ra   s     rO   __mul__zchararray.__mul__P       xa())rQ   c                 ,    t        t        | |            S r   r   r   s     rO   __rmul__zchararray.__rmul__[  r   rQ   c                 ,    t        t        | |            S )z
        Return (self % i), that is pre-Python 2.6 string formatting
        (interpolation), element-wise for a pair of array_likes of `bytes_`
        or `str_`.

        See Also
        --------
        mod
        )r   r   r   s     rO   __mod__zchararray.__mod__f  s     s4|$$rQ   c                     t         S rJ   )NotImplementedr   s     rO   __rmod__zchararray.__rmod__r  s    rQ   c                 D    | j                         j                  |||      S )a  
        Return the indices that sort the array lexicographically.

        For full documentation see `numpy.argsort`, for which this method is
        in fact merely a "thin wrapper."

        Examples
        --------
        >>> c = np.array(['a1b c', '1b ca', 'b ca1', 'Ca1b'], 'S5')
        >>> c = c.view(np.char.chararray); c
        chararray(['a1b c', '1b ca', 'b ca1', 'Ca1b'],
              dtype='|S5')
        >>> c[c.argsort()]
        chararray(['1b ca', 'Ca1b', 'a1b c', 'b ca1'],
              dtype='|S5')

        )	__array__argsort)rs   axiskindre   s       rO   r   zchararray.argsortu  s     $ ~~''dE::rQ   c                 *    t        t        |             S )z
        Return a copy of `self` with only the first character of each element
        capitalized.

        See Also
        --------
        char.capitalize

        )r   r    rs   s    rO   r    zchararray.capitalize  s     z$'((rQ   c                 .    t        t        | ||            S )z
        Return a copy of `self` with its elements centered in a
        string of length `width`.

        See Also
        --------
        center
        )r   r!   rs   widthfillchars      rO   r!   zchararray.center  s     vdE8455rQ   c                     t        | |||      S )z
        Returns an array with the number of non-overlapping occurrences of
        substring `sub` in the range [`start`, `end`].

        See Also
        --------
        char.count

        )r"   rs   substartends       rO   r"   zchararray.count       T3s++rQ   c                     t        | ||      S )zn
        Calls ``bytes.decode`` element-wise.

        See Also
        --------
        char.decode

        )r#   rs   encodingerrorss      rO   r#   zchararray.decode       dHf--rQ   c                     t        | ||      S )zp
        Calls :meth:`str.encode` element-wise.

        See Also
        --------
        char.encode

        )r$   r   s      rO   r$   zchararray.encode  r   rQ   c                     t        | |||      S )z
        Returns a boolean array which is `True` where the string element
        in `self` ends with `suffix`, otherwise `False`.

        See Also
        --------
        char.endswith

        )r%   )rs   suffixr   r   s       rO   r%   zchararray.endswith  s     feS11rQ   c                 ,    t        t        | |            S )z
        Return a copy of each string element where all tab characters are
        replaced by one or more spaces.

        See Also
        --------
        char.expandtabs

        )r   r&   )rs   tabsizes     rO   r&   zchararray.expandtabs  s     z$011rQ   c                     t        | |||      S )z
        For each element, return the lowest index in the string where
        substring `sub` is found.

        See Also
        --------
        char.find

        )r'   r   s       rO   r'   zchararray.find  s     D#uc**rQ   c                     t        | |||      S )z
        Like `find`, but raises :exc:`ValueError` when the substring is not
        found.

        See Also
        --------
        char.index

        )r(   r   s       rO   r(   zchararray.index  r   rQ   c                     t        |       S )z
        Returns true for each element if all characters in the string
        are alphanumeric and there is at least one character, false
        otherwise.

        See Also
        --------
        char.isalnum

        )r)   r   s    rO   r)   zchararray.isalnum       t}rQ   c                     t        |       S )z
        Returns true for each element if all characters in the string
        are alphabetic and there is at least one character, false
        otherwise.

        See Also
        --------
        char.isalpha

        )r*   r   s    rO   r*   zchararray.isalpha   r   rQ   c                     t        |       S )z
        Returns true for each element if all characters in the string are
        digits and there is at least one character, false otherwise.

        See Also
        --------
        char.isdigit

        )r+   r   s    rO   r+   zchararray.isdigit       t}rQ   c                     t        |       S )z
        Returns true for each element if all cased characters in the
        string are lowercase and there is at least one cased character,
        false otherwise.

        See Also
        --------
        char.islower

        )r,   r   s    rO   r,   zchararray.islower  r   rQ   c                     t        |       S )z
        Returns true for each element if there are only whitespace
        characters in the string and there is at least one character,
        false otherwise.

        See Also
        --------
        char.isspace

        )r-   r   s    rO   r-   zchararray.isspace&  r   rQ   c                     t        |       S )z
        Returns true for each element if the element is a titlecased
        string and there is at least one character, false otherwise.

        See Also
        --------
        char.istitle

        )r.   r   s    rO   r.   zchararray.istitle3  r   rQ   c                     t        |       S )z
        Returns true for each element if all cased characters in the
        string are uppercase and there is at least one character, false
        otherwise.

        See Also
        --------
        char.isupper

        )r/   r   s    rO   r/   zchararray.isupper?  r   rQ   c                     t        | |      S )z
        Return a string which is the concatenation of the strings in the
        sequence `seq`.

        See Also
        --------
        char.join

        )r0   )rs   seqs     rO   r0   zchararray.joinL  s     D#rQ   c                 .    t        t        | ||            S )z
        Return an array with the elements of `self` left-justified in a
        string of length `width`.

        See Also
        --------
        char.ljust

        )r   r1   r   s      rO   r1   zchararray.ljustX       uT5(344rQ   c                 *    t        t        |             S )z
        Return an array with the elements of `self` converted to
        lowercase.

        See Also
        --------
        char.lower

        )r   r2   r   s    rO   r2   zchararray.lowerd       uT{##rQ   c                     t        | |      S )z
        For each element in `self`, return a copy with the leading characters
        removed.

        See Also
        --------
        char.lstrip

        )r3   rs   charss     rO   r3   zchararray.lstripp       dE""rQ   c                 ,    t        t        | |            S )zu
        Partition each element in `self` around `sep`.

        See Also
        --------
        partition
        )r   r4   rs   seps     rO   r4   zchararray.partition|  s     ys+,,rQ   c                 .    t        | ||||      S d      S )z
        For each element in `self`, return a copy of the string with all
        occurrences of substring `old` replaced by `new`.

        See Also
        --------
        char.replace

        )r5   )rs   oldnewr"   s       rO   r5   zchararray.replace  s"     tS#0AuJJrJJrQ   c                     t        | |||      S )z
        For each element in `self`, return the highest index in the string
        where substring `sub` is found, such that `sub` is contained
        within [`start`, `end`].

        See Also
        --------
        char.rfind

        )r6   r   s       rO   r6   zchararray.rfind  s     T3s++rQ   c                     t        | |||      S )z
        Like `rfind`, but raises :exc:`ValueError` when the substring `sub` is
        not found.

        See Also
        --------
        char.rindex

        )r7   r   s       rO   r7   zchararray.rindex  s     dC,,rQ   c                 .    t        t        | ||            S )z
        Return an array with the elements of `self`
        right-justified in a string of length `width`.

        See Also
        --------
        char.rjust

        )r   r8   r   s      rO   r8   zchararray.rjust  r   rQ   c                 ,    t        t        | |            S )zv
        Partition each element in `self` around `sep`.

        See Also
        --------
        rpartition
        )r   r9   r   s     rO   r9   zchararray.rpartition  s     z$,--rQ   c                     t        | ||      S )z
        For each element in `self`, return a list of the words in
        the string, using `sep` as the delimiter string.

        See Also
        --------
        char.rsplit

        )r:   rs   r   maxsplits      rO   r:   zchararray.rsplit  s     dC**rQ   c                     t        | |      S )z
        For each element in `self`, return a copy with the trailing
        characters removed.

        See Also
        --------
        char.rstrip

        )r;   r   s     rO   r;   zchararray.rstrip  r   rQ   c                     t        | ||      S )z
        For each element in `self`, return a list of the words in the
        string, using `sep` as the delimiter string.

        See Also
        --------
        char.split

        )r<   r   s      rO   r<   zchararray.split  s     T3))rQ   c                     t        | |      S )z
        For each element in `self`, return a list of the lines in the
        element, breaking at line boundaries.

        See Also
        --------
        char.splitlines

        )r=   )rs   keependss     rO   r=   zchararray.splitlines  s     $))rQ   c                     t        | |||      S )z
        Returns a boolean array which is `True` where the string element
        in `self` starts with `prefix`, otherwise `False`.

        See Also
        --------
        char.startswith

        )r>   )rs   prefixr   r   s       rO   r>   zchararray.startswith  s     $s33rQ   c                     t        | |      S )z
        For each element in `self`, return a copy with the leading and
        trailing characters removed.

        See Also
        --------
        char.strip

        )r?   r   s     rO   r?   zchararray.strip  s     T5!!rQ   c                 *    t        t        |             S )z
        For each element in `self`, return a copy of the string with
        uppercase characters converted to lowercase and vice versa.

        See Also
        --------
        char.swapcase

        )r   r@   r   s    rO   r@   zchararray.swapcase	  s     x~&&rQ   c                 *    t        t        |             S )z
        For each element in `self`, return a titlecased version of the
        string: words start with uppercase characters, all remaining cased
        characters are lowercase.

        See Also
        --------
        char.title

        )r   rA   r   s    rO   rA   zchararray.title  s     uT{##rQ   c                 .    t        t        | ||            S )aB  
        For each element in `self`, return a copy of the string where
        all characters occurring in the optional argument
        `deletechars` are removed, and the remaining characters have
        been mapped through the given translation table.

        See Also
        --------
        char.translate

        )r   rB   )rs   tabledeletecharss      rO   rB   zchararray.translate"  s     yuk:;;rQ   c                 *    t        t        |             S )z
        Return an array with the elements of `self` converted to
        uppercase.

        See Also
        --------
        char.upper

        )r   rC   r   s    rO   rC   zchararray.upper0  r   rQ   c                 ,    t        t        | |            S )z
        Return the numeric string left-filled with zeros in a string of
        length `width`.

        See Also
        --------
        char.zfill

        )r   rD   )rs   r   s     rO   rD   zchararray.zfill<  s     uT5)**rQ   c                     t        |       S )z
        For each element in `self`, return True if there are only
        numeric characters in the element.

        See Also
        --------
        char.isnumeric

        )rE   r   s    rO   rE   zchararray.isnumericH       rQ   c                     t        |       S )z
        For each element in `self`, return True if there are only
        decimal characters in the element.

        See Also
        --------
        char.isdecimal

        )rF   r   s    rO   rF   zchararray.isdecimalT  r   rQ   )r   FNr   NC)NF)r   NN) )r   N)NN)   rJ   )=__name__
__module____qualname____doc__rl   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r	   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rK   rQ   rO   rG   rG   2  sA   KX CG.1@N

""&*'$!	 	 	*	*
%;& oo--GO
)	6
,	.	.
2
2
+
,



5
$
#-
K,
-
5.
+
#
*
*
4
"
'$<
$
+

rQ   rG   c                 h   t        | t        t        f      rB|t        | t              rd}nd}|t        |       }t        |       |z  }t	        |||| |      S t        | t
        t        f      rt        |       } t        | t              rt        | j                  j                  t              rt        | t              s| j                  t              } |5| j                  }t        | j                  j                  t              r|dz  }|)t        | j                  j                  t              rd}nd}|rt        }nt         }|t        | |      } |s3|| j                  k7  s$|st        | t              s|r,t        | t               r| j#                  |t%        |      f      } | S t        | t              r6t        | j                  j                  t&              r|| j)                         } |rt        }nt         }|t+        | ||d      }nt+        | ||f|d      }|j                  t              S )a	  
    Create a `~numpy.char.chararray`.

    .. note::
       This class is provided for numarray backward-compatibility.
       New code (not concerned with numarray compatibility) should use
       arrays of type `bytes_` or `str_` and use the free functions
       in :mod:`numpy.char` for fast vectorized string operations instead.

    Versus a NumPy array of dtype `bytes_` or `str_`, this
    class adds the following functionality:

    1) values automatically have whitespace removed from the end
       when indexed

    2) comparison operators automatically remove whitespace from the
       end when comparing values

    3) vectorized string operations are provided as methods
       (e.g. `chararray.endswith <numpy.char.chararray.endswith>`)
       and infix operators (e.g. ``+, *, %``)

    Parameters
    ----------
    obj : array of str or unicode-like

    itemsize : int, optional
        `itemsize` is the number of characters per scalar in the
        resulting array.  If `itemsize` is None, and `obj` is an
        object array or a Python list, the `itemsize` will be
        automatically determined.  If `itemsize` is provided and `obj`
        is of type str or unicode, then the `obj` string will be
        chunked into `itemsize` pieces.

    copy : bool, optional
        If true (default), then the object is copied.  Otherwise, a copy
        will only be made if ``__array__`` returns a copy, if obj is a
        nested sequence, or if a copy is needed to satisfy any of the other
        requirements (`itemsize`, unicode, `order`, etc.).

    unicode : bool, optional
        When true, the resulting `~numpy.char.chararray` can contain Unicode
        characters, when false only 8-bit characters.  If unicode is
        None and `obj` is one of the following:

        - a `~numpy.char.chararray`,
        - an ndarray of type :class:`str_` or :class:`bytes_`
        - a Python :class:`str` or :class:`bytes` object,

        then the unicode setting of the output array will be
        automatically determined.

    order : {'C', 'F', 'A'}, optional
        Specify the order of the array.  If order is 'C' (default), then the
        array will be in C-contiguous order (last-index varies the
        fastest).  If order is 'F', then the returned array
        will be in Fortran-contiguous order (first-index varies the
        fastest).  If order is 'A', then the returned array may
        be in any order (either C-, Fortran-contiguous, or even
        discontiguous).
    TF)ro   rp   rf   re      rd   )rq   re   subok)rj   bytesrk   r   rG   listtupleasnarrayr	   
issubclassrq   rx   r   rw   ro   r   r   astyperi   objecttolistnarray)r~   ro   copyrp   re   rn   rq   r   s           rO   r
   r
   a  s   ~ #s|$?#s#3xHCH$7 #52 	2 #e}%sm#wJsyy~~y$I #y)((9%C||H #))..$/Q?#))..$/EE3e,CS\\)C!6ZV4**eS]34C
#wJsyy~~v$F **,C SU$?S 1dK88IrQ   c                 "    t        | |d||      S )a  
    Convert the input to a `~numpy.char.chararray`, copying the data only if
    necessary.

    Versus a NumPy array of dtype `bytes_` or `str_`, this
    class adds the following functionality:

    1) values automatically have whitespace removed from the end
       when indexed

    2) comparison operators automatically remove whitespace from the
       end when comparing values

    3) vectorized string operations are provided as methods
       (e.g. `chararray.endswith <numpy.char.chararray.endswith>`)
       and infix operators (e.g. ``+``, ``*``, ``%``)

    Parameters
    ----------
    obj : array of str or unicode-like

    itemsize : int, optional
        `itemsize` is the number of characters per scalar in the
        resulting array.  If `itemsize` is None, and `obj` is an
        object array or a Python list, the `itemsize` will be
        automatically determined.  If `itemsize` is provided and `obj`
        is of type str or unicode, then the `obj` string will be
        chunked into `itemsize` pieces.

    unicode : bool, optional
        When true, the resulting `~numpy.char.chararray` can contain Unicode
        characters, when false only 8-bit characters.  If unicode is
        None and `obj` is one of the following:

        - a `~numpy.char.chararray`,
        - an ndarray of type `str_` or `unicode_`
        - a Python str or unicode object,

        then the unicode setting of the output array will be
        automatically determined.

    order : {'C', 'F'}, optional
        Specify the order of the array.  If order is 'C' (default), then the
        array will be in C-contiguous order (last-index varies the
        fastest).  If order is 'F', then the returned array
        will be in Fortran-contiguous order (first-index varies the
        fastest).

    Examples
    --------
    >>> np.char.asarray(['hello', 'world'])
    chararray(['hello', 'world'], dtype='<U5')
    
    F)r  rp   re   )r
   )r~   ro   rp   re   s       rO   r   r     s    p hU / /rQ   )NTNN)NNN)-r   	functools_utilsr   numerictypesr   r   r   numericr	   r
   r  r   r  numpy._core.multiarrayr   numpy._corer   numpy.stringsr   r]   numpy._core.stringsr   r4   r   r9   r   r<   r   r:   r   r=   r   r0   __all__partialarray_function_dispatchrP   r   r   r   r   r   r   rG   rK   rQ   rO   <module>r     sa  "   1 1 B B 5 !  6 
 ,)++%%l<  ./2 02@ ./2 02@ ./2 02B ./2 02@ ./1 01@ ./1 01@/:d Lk k k\ LB BJ L8/ 8/rQ   