
    Цi                     b   S r SSKrSSKrSSKrSSKJr  SSKrSSKrSSK	J
r
  SSKJrJrJrJrJrJrJr  SSKJr  \R*                  \R,                  \R.                  \R0                  \R2                  \R4                  \R6                  \R8                  \R:                  \R<                  \R>                  \R@                  \!/r"/ r#\" H  r$S H  r%\RL                  " \$5      RO                  \%5      r&\RP                  " S5      RS                  \&5      r*\#RW                  \RX                  " / \&S	9\RX                  " S
\&S	9\*\*R[                  S5      \*R[                  S5      R\                  \*R[                  S5      SSS2SSS24   /5        M     M     / SQr/SS/SS/SS//S4SS/SS/SS//S4/r0SSSSS/ SQ4SS/4SS S!S"/4S#S$/r1SS/S%SS&S%S'/SS/S(S/4S)S*4S+S,SS/SS//S4SS/S-SS.S-S//SS/SS(/4S0S14S2S3SS/SS//S4/r2\RX                  " \0\RL                  " \/5      RO                  S45      S	9\RX                  " \2\RL                  " \15      RO                  S45      S	9\RX                  " \0\RL                  " \/5      RO                  S55      S	9\RX                  " \2\RL                  " \15      RO                  S55      S	9\Rf                  " S(S6/S	9/r4 " S7 S8\5      r5S9 r6S: r7S; r8S< r9S= r:S> r;S? r<S@ r=SA r>\R~                  R                  \SBSC9\R~                  R                  SD 5       5       rBSE rC\RL                  " SFS*SG9rD\RL                  " SHSI/SJSJ/S(SK/SL.5      rE\RL                  " SMSN/SJ\E/SO.5      rF\RL                  " / SPQSJ/S-  SO.5      rG\RL                  " SHSI/SJSJ/S(SK/SQSR/SS.5      rH\RL                  " / / SST.5      rI\R~                  R                  SU\D\E\F\G\H\I/5      SV 5       rK\R~                  R                  \R                  SW:  SXSC9\R~                  R                  \SYSC9SZ 5       5       rN\R~                  R                  S[5      S\ 5       rPS] rQ\R~                  R                  SU\RL                  " SH\R,                  4SI\R0                  4SM\R4                  4/S*SG9\RL                  " S^\RL                  " SHSI/S_S_/SS/SS`.Sa45      Sb4/5      \RL                  " Sc/5      \RL                  " S^\RL                  " \RL                  " \RL                  " SHSI/S_S_/SS/SS`.5      Sa45      Sb45      4/5      \RL                  " SH\RL                  " \RL                  " \RL                  " \RL                  " SH\R4SI\RL                  " SHSI/S_S_/SS/SS`.5      4/5      Sa45      Sb45      Sd45      4/5      /5      Se 5       rSSf rT\R~                  R                  \SBSC9Sg 5       rU\R~                  R                  ShSiS/5      Sj 5       rVSk rWSl rX/ SmQrY/ SnQrZSo r[Sp r\Sq r]Sr r^Ss r_St r`Su raSv rbSw rc\R~                  R                  \SxSC9\R~                  R                  \(       + SySC9\R~                  R                  \" SzS{9\R~                  R                  S|SC9S} 5       5       5       5       5       reS~ rfS rgS rh\R~                  R                  SU\RL                  " SHSI/\i\RL                  " SSS0S9/SO.5      \RL                  " \RSS0S9\RL                  " S\RS44/SS0S9\RL                  " SHSI/\i\RL                  " SM/\RL                  " \R0 S9/SO.5      /SO.5      /5      \R~                  R                  \=(       a    \R                  R                  S:*  SSC9S 5       5       rlg)aD  Test the .npy file format.

Set up:

    >>> import sys
    >>> from io import BytesIO
    >>> from numpy.lib import format
    >>>
    >>> scalars = [
    ...     np.uint8,
    ...     np.int8,
    ...     np.uint16,
    ...     np.int16,
    ...     np.uint32,
    ...     np.int32,
    ...     np.uint64,
    ...     np.int64,
    ...     np.float32,
    ...     np.float64,
    ...     np.complex64,
    ...     np.complex128,
    ...     object,
    ... ]
    >>>
    >>> basic_arrays = []
    >>>
    >>> for scalar in scalars:
    ...     for endian in '<>':
    ...         dtype = np.dtype(scalar).newbyteorder(endian)
    ...         basic = np.arange(15).astype(dtype)
    ...         basic_arrays.extend([
    ...             np.array([], dtype=dtype),
    ...             np.array(10, dtype=dtype),
    ...             basic,
    ...             basic.reshape((3,5)),
    ...             basic.reshape((3,5)).T,
    ...             basic.reshape((3,5))[::-1,::2],
    ...         ])
    ...
    >>>
    >>> Pdescr = [
    ...     ('x', 'i4', (2,)),
    ...     ('y', 'f8', (2, 2)),
    ...     ('z', 'u1')]
    >>>
    >>>
    >>> PbufferT = [
    ...     ([3,2], [[6.,4.],[6.,4.]], 8),
    ...     ([4,3], [[7.,5.],[7.,5.]], 9),
    ...     ]
    >>>
    >>>
    >>> Ndescr = [
    ...     ('x', 'i4', (2,)),
    ...     ('Info', [
    ...         ('value', 'c16'),
    ...         ('y2', 'f8'),
    ...         ('Info2', [
    ...             ('name', 'S2'),
    ...             ('value', 'c16', (2,)),
    ...             ('y3', 'f8', (2,)),
    ...             ('z3', 'u4', (2,))]),
    ...         ('name', 'S2'),
    ...         ('z2', 'b1')]),
    ...     ('color', 'S2'),
    ...     ('info', [
    ...         ('Name', 'U8'),
    ...         ('Value', 'c16')]),
    ...     ('y', 'f8', (2, 2)),
    ...     ('z', 'u1')]
    >>>
    >>>
    >>> NbufferT = [
    ...     ([3,2], (6j, 6., ('nn', [6j,4j], [6.,4.], [1,2]), 'NN', True), 'cc', ('NN', 6j), [[6.,4.],[6.,4.]], 8),
    ...     ([4,3], (7j, 7., ('oo', [7j,5j], [7.,5.], [2,1]), 'OO', False), 'dd', ('OO', 7j), [[7.,5.],[7.,5.]], 9),
    ...     ]
    >>>
    >>>
    >>> record_arrays = [
    ...     np.array(PbufferT, dtype=np.dtype(Pdescr).newbyteorder('<')),
    ...     np.array(NbufferT, dtype=np.dtype(Ndescr).newbyteorder('<')),
    ...     np.array(PbufferT, dtype=np.dtype(Pdescr).newbyteorder('>')),
    ...     np.array(NbufferT, dtype=np.dtype(Ndescr).newbyteorder('>')),
    ... ]

Test the magic string writing.

    >>> format.magic(1, 0)
    '\x93NUMPY\x01\x00'
    >>> format.magic(0, 0)
    '\x93NUMPY\x00\x00'
    >>> format.magic(255, 255)
    '\x93NUMPY\xff\xff'
    >>> format.magic(2, 5)
    '\x93NUMPY\x02\x05'

Test the magic string reading.

    >>> format.read_magic(BytesIO(format.magic(1, 0)))
    (1, 0)
    >>> format.read_magic(BytesIO(format.magic(0, 0)))
    (0, 0)
    >>> format.read_magic(BytesIO(format.magic(255, 255)))
    (255, 255)
    >>> format.read_magic(BytesIO(format.magic(2, 5)))
    (2, 5)

Test the header writing.

    >>> for arr in basic_arrays + record_arrays:
    ...     f = BytesIO()
    ...     format.write_array_header_1_0(f, arr)   # XXX: arr is not a dict, items gets called on it
    ...     print(repr(f.getvalue()))
    ...
    "F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '|u1', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '|u1', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '|u1', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '|u1', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '|i1', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '|i1', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '|i1', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '|i1', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '|i1', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '|i1', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '|i1', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '|i1', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '|i1', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '|i1', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '|i1', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '|i1', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '<u2', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '<u2', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '<u2', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '<u2', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '<u2', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '<u2', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '>u2', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '>u2', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '>u2', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '>u2', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '>u2', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '>u2', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '<i2', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '<i2', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '<i2', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '<i2', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '<i2', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '<i2', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '>i2', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '>i2', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '>i2', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '>i2', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '>i2', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '>i2', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '<u4', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '<u4', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '<u4', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '<u4', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '<u4', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '<u4', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '>u4', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '>u4', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '>u4', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '>u4', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '>u4', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '>u4', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '<i4', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '<i4', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '<i4', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '<i4', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '<i4', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '<i4', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '>i4', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '>i4', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '>i4', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '>i4', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '>i4', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '>i4', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '<u8', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '<u8', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '<u8', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '<u8', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '<u8', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '<u8', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '>u8', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '>u8', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '>u8', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '>u8', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '>u8', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '>u8', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '<i8', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '<i8', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '<i8', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '<i8', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '<i8', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '<i8', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '>i8', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '>i8', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '>i8', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '>i8', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '>i8', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '>i8', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '<f4', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '<f4', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '<f4', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '<f4', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '<f4', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '<f4', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '>f4', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '>f4', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '>f4', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '>f4', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '>f4', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '>f4', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '<f8', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '<f8', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '<f8', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '<f8', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '<f8', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '<f8', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '>f8', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '>f8', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '>f8', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '>f8', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '>f8', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '>f8', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '<c8', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '<c8', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '<c8', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '<c8', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '<c8', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '<c8', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '>c8', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': '>c8', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': '>c8', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': '>c8', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': '>c8', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': '>c8', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': '<c16', 'fortran_order': False, 'shape': (0,)}             \n"
    "F\x00{'descr': '<c16', 'fortran_order': False, 'shape': ()}               \n"
    "F\x00{'descr': '<c16', 'fortran_order': False, 'shape': (15,)}            \n"
    "F\x00{'descr': '<c16', 'fortran_order': False, 'shape': (3, 5)}           \n"
    "F\x00{'descr': '<c16', 'fortran_order': True, 'shape': (5, 3)}            \n"
    "F\x00{'descr': '<c16', 'fortran_order': False, 'shape': (3, 3)}           \n"
    "F\x00{'descr': '>c16', 'fortran_order': False, 'shape': (0,)}             \n"
    "F\x00{'descr': '>c16', 'fortran_order': False, 'shape': ()}               \n"
    "F\x00{'descr': '>c16', 'fortran_order': False, 'shape': (15,)}            \n"
    "F\x00{'descr': '>c16', 'fortran_order': False, 'shape': (3, 5)}           \n"
    "F\x00{'descr': '>c16', 'fortran_order': True, 'shape': (5, 3)}            \n"
    "F\x00{'descr': '>c16', 'fortran_order': False, 'shape': (3, 3)}           \n"
    "F\x00{'descr': 'O', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': 'O', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': 'O', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': 'O', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': 'O', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': 'O', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "F\x00{'descr': 'O', 'fortran_order': False, 'shape': (0,)}              \n"
    "F\x00{'descr': 'O', 'fortran_order': False, 'shape': ()}                \n"
    "F\x00{'descr': 'O', 'fortran_order': False, 'shape': (15,)}             \n"
    "F\x00{'descr': 'O', 'fortran_order': False, 'shape': (3, 5)}            \n"
    "F\x00{'descr': 'O', 'fortran_order': True, 'shape': (5, 3)}             \n"
    "F\x00{'descr': 'O', 'fortran_order': False, 'shape': (3, 3)}            \n"
    "v\x00{'descr': [('x', '<i4', (2,)), ('y', '<f8', (2, 2)), ('z', '|u1')],\n 'fortran_order': False,\n 'shape': (2,)}         \n"
    "\x16\x02{'descr': [('x', '<i4', (2,)),\n           ('Info',\n            [('value', '<c16'),\n             ('y2', '<f8'),\n             ('Info2',\n              [('name', '|S2'),\n               ('value', '<c16', (2,)),\n               ('y3', '<f8', (2,)),\n               ('z3', '<u4', (2,))]),\n             ('name', '|S2'),\n             ('z2', '|b1')]),\n           ('color', '|S2'),\n           ('info', [('Name', '<U8'), ('Value', '<c16')]),\n           ('y', '<f8', (2, 2)),\n           ('z', '|u1')],\n 'fortran_order': False,\n 'shape': (2,)}      \n"
    "v\x00{'descr': [('x', '>i4', (2,)), ('y', '>f8', (2, 2)), ('z', '|u1')],\n 'fortran_order': False,\n 'shape': (2,)}         \n"
    "\x16\x02{'descr': [('x', '>i4', (2,)),\n           ('Info',\n            [('value', '>c16'),\n             ('y2', '>f8'),\n             ('Info2',\n              [('name', '|S2'),\n               ('value', '>c16', (2,)),\n               ('y3', '>f8', (2,)),\n               ('z3', '>u4', (2,))]),\n             ('name', '|S2'),\n             ('z2', '|b1')]),\n           ('color', '|S2'),\n           ('info', [('Name', '>U8'), ('Value', '>c16')]),\n           ('y', '>f8', (2, 2)),\n           ('z', '|u1')],\n 'fortran_order': False,\n 'shape': (2,)}      \n"
    N)BytesIO)format)IS_64BITIS_PYPYIS_WASMassert_assert_array_equalassert_raisesassert_raises_regex)requires_memoryz<>i  dtype
   )   2      )xi4r   yf8r   r   zu1   g      @g      @      g      @g      @	   r   Info)valuec16)y2r   Info2)nameS2)r$   r%   r   )y3r   r   )z3u4r   r(   )z2b1)colorr*   info)NameU8)Valuer%   r   r                 @nny              @   NNTcc)r8   r5                 @ooy              @OOFdd)r<   r:   <>)cz<f8   r   c                   ,   ^  \ rS rSrSU 4S jjrSrU =r$ )BytesIOSRandomSizei  c                 N   > SS K nUR                  SU5      n[        TU ]  U5      $ )Nr   r7   )randomrandintsuperread)selfsizerG   	__class__s      Z/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/numpy/lib/tests/test_format.pyrJ   BytesIOSRandomSize.read  s%    ~~a&w|D!!     N)__name__
__module____qualname____firstlineno__rJ   __static_attributes____classcell__)rM   s   @rN   rE   rE     s    " "rP   rE   c                     [        5       n[        R                  " X5        [        UR                  5       5      n[        R                  " USS9nU$ )NTallow_pickler   r   write_arraygetvalue
read_arrayarrff2arr2s       rN   	roundtripre     s>    	A
q		BRd3DKrP   c                     [        5       n[        R                  " X5        [        UR	                  5       5      n[        R
                  " U5      nU$ rR   )r   r   r]   rE   r^   r_   r`   s       rN   roundtrip_randsizerg     s<    	A
q	AJJL	)BR DKrP   c                     [        5       n[        R                  " X5        [        UR                  5       SS 5      n[        R                  " U5      nU$ )Nr   r   r\   r`   s       rN   roundtrip_truncatedri     sC    	A
q	a#	$BR DKrP   c                     [        X:H  5        g rR   )r   )o1o2s     rN   assert_equal_rm     s    BHrP   c                  X    [         [        -    H  n [        U 5      n[        X5        M     g rR   )basic_arraysrecord_arraysre   r	   ra   rd   s     rN   test_roundtriprr     s"    m+~3% ,rP   c                      [         [        -    H/  n U R                  [        :w  d  M  [	        U 5      n[        X5        M1     g rR   )ro   rp   r   objectrg   r	   rq   s     rN   test_roundtrip_randsizeru     s/    m+99%c*Ds) ,rP   c                  t    [          H.  n U R                  [        :w  d  M  [        [        [
        U 5        M0     g rR   )ro   r   rt   r
   
ValueErrorri   ra   s    rN   test_roundtrip_truncatedry     s%    99*&93? rP   c                 ~   U S-  n[          H  nUR                  [        :w  d  M  [        US5       n[        R
                  " X25        S S S 5        [        US5       nUR                  S[        R                  5        UR                  5         S S S 5        [        US5       n[        R                  " [        UR                  S:X  a  SOSS	9   [        R                  " U5      nS S S 5        S S S 5        M     g ! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       N== f! , (       d  f       GM0  = f)
Nza.npywbzrb+r   rbr   z9EOF: reading array header, expected (\d+) bytes got (\d+)zFailed to read all data for array\. Expected \(.*?\) = (\d+) elements, could only read (\d+) elements\. \(file seems not fully written\?\)match)ro   r   rt   openr   r]   seekosSEEK_ENDtruncatepytestraisesrw   rL   r_   )tmp_pathpathra   rb   _s        rN   test_file_truncatedr     s    gD99dD!Q""1* " dE"ar2;;'

 # dD!Q]] Q:> ))!,A "! !! #"  "!s;   C91D
!,D,D$D,9
D	

D	
D)%D,,
D<	c                      [         R                  " S[         R                  " [        [        R
                  S-   45      S9n [        U 5      n[        X5        g )Nr7   r   )nponesr   strr   BUFFER_SIZEre   r	   )long_str_arrlong_str_arr2s     rN   test_long_strr     s=    771BHHc63E3E3I-J$KLLl+M|3rP   zmemmap doesn't work correctly)reasonc           	         [        [        [        -   5       GH  u  pUR                  R                  (       a  M#  [
        R                  R                  U SU S35      n[
        R                  R                  U SU S35      n[        US5       n[        R                  " XR5        S S S 5        UR                  R                  =(       a    UR                  R                  (       + n[        R                  " USUR                  UR                  US9nX'S'   UR!                  5         [        US5       nUR#                  5       nS S S 5        [        US5       nUR#                  5       n	S S S 5        [%        WW	5        [        R                  " US	S
9nUR!                  5         GM     g ! , (       d  f       GN= f! , (       d  f       N|= f! , (       d  f       Nh= f)Nnormalz.npymemmapr{   w+)moder   shapefortran_order.r|   r)r   )	enumeratero   rp   r   	hasobjectr   r   joinr   r   r]   flagsf_contiguousc_contiguousopen_memmapr   flushrJ   rm   )
tmpdirira   nfnmfnfpr   manormal_bytesmemmap_bytess
             rN   test_memmap_roundtripr     sQ    L=8999ggll6VA3d#34ggll6VA3d#34#t_r'  II""A399+A+A'A 	$cii&)ii}N3

 #t_779L #t_779L lL1 #.

5 : _ __s$   F&1F8G	&
F5	8
G		
G	c                 .   [         R                  R                  SS5      n[        R                  R                  U S5      n[         R                  " X!S9  [         R                  " U5       nUS   nS S S 5        [        UW5        g ! , (       d  f       N= f)N   zcompressed.npzrx   ra   )	r   rG   randr   r   r   savez_compressedloadr	   )r   ra   npz_filenpzarr1s        rN   test_compressed_roundtripr     sh    
))..c
"Cww||F$45H*		c5z 
sD! 
	s   +B
Bz
i1, i4, i1)alignabr      )namesformatsoffsetsr@   d)r   r   )r    r   aabb)r   r   r   titles)r   r   itemsizedtc                 N   [         R                  " SU5      n[        S5       H
  nUS-   X#'   M     [        R                  R                  U S5      n[         R                  " XBS9  [         R                  " U5       nUS   nS S S 5        [        UW5        g ! , (       d  f       N= f)Nr   rC   zaligned.npzrx   ra   )	r   zerosranger   r   r   savezr   r	   )r   r   ra   r   r   r   r   s          rN   test_load_padded_dtyper     sy    
((1b/C1XQ ww||FM2HHHX		c5z 
sD! 
	s   ;B
B$)r      zsee gh-23988z!Emscripten NODEFS has a buggy dupc                  ^   Sn [         R                  R                  [         R                  R                  [        5      SU 5      n[
        R                  " [        SS9   [        R                  " U5      nS S S 5        [        W[        R                  " S5      5        g ! , (       d  f       N/= f)Nzwin64python2.npydatazReading.*this warning\.r}   r   )r   r   r   dirname__file__r   warnsUserWarningr   r   r	   r   )fnamer   r   s      rN   %test_python2_python3_interoperabilityr   +  sj     E77<<165AD	k)C	Dwwt} 
EtRWWQZ( 
E	Ds   B
B,zJignore:.*align should be passed:numpy.exceptions.VisibleDeprecationWarningc            
         [         R                  R                  [         R                  R                  [        5      S5      n [
        R                  " S [        SS/[        S9nS GH  n[         R                  R                  X5      nS H  n[
        R                  " USUS9nUR                  S	5      (       a  US
   nUR                  5         OUnUS:X  ag  UR                  S5      (       aQ  [        [        US   [        5      5        [!        US S US S 5        [!        US   R#                  U5      US   5        M  [        [        US   [$        5      5        [!        Xa5        M     UR                  S5      (       d  GM  UR                  S	5      (       a  [
        R                  " USS9n['        [(        UR*                  S
5        UR                  5         [
        R                  " USSSS9n['        [,        UR*                  S
5        UR                  5         GM  ['        [(        [
        R                  USS9  ['        [,        [
        R                  USSSS9  GM     g )Nr   u   優良s   不良r   )zpy2-np0-objarr.npypy2-objarr.npypy2-objarr.npzzpy3-objarr.npyzpy3-objarr.npz)byteslatin1Tr[   encodingz.npzr   r   py2r   r   rZ   F)r[   fix_importsr   )r   r   r   r   r   r   arrayr   rt   r   endswithclose
startswithr   
isinstancer   r	   encoder   r
   UnicodeError__getitem__ImportError)data_direxpectedr   r   r   data_fr   s          rN   test_pickle_python2_python3r   5  s   
 ww||BGGOOH5v>Hxxun46$&H6ww||H,+HWWTxHF~~f%%c{8#(8(8(?(?
47C01"49hsm<"48??8#<hrlK
47E23"42 ," E""~~f%%wwt$7lD,<,<cB

wwt$E(02k4+;+;SA

lBGGT+/1k277D+/U'/1C6rP   c           
         [         R                  R                  [         R                  R                  [        5      S5      n[         R                  R                  US5      n[        [        [        R                  USSS9  [         R                  R                  US5      n[        R                  " USSS9 n[        [        UR                  S5        S S S 5        [         R                  R                  U S5      n[        [        [        R                  U[        R                  " S /[        S	9SS
9  g ! , (       d  f       Nf= f)Nr   r   Fr   r   r   r   zpickle-disabled.npyr   rZ   )r   r   r   r   r   r
   rw   r   r   r   saver   rt   )r   r   r   rb   s       rN   test_pickle_disallowr   f  s    ww||BGGOOH5v>H77<<"23D*bggt$x9 77<<"23D	EH	=j!--5 
> 77<< 56D*bggtRXXtfF-K$&	 
>	=s   7D33
Er   i1)r   r   r   r   )r   )r!   )r   rA   r   rB   c                     [         R                  " U R                  5      n[        X5        [        R
                  " SU 5      n[        U5      n[        X#5        g )Nr   )r   descr_to_dtypedescrrm   r   r   re   r	   )r   dt1r   rd   s       rN   test_descr_to_dtyper   u  sA    d 


)C#88Ar?DT?Dt"rP   c                     [        5       n [        S5       Vs/ s H  nSU-  S-  [        4PM     nn[        R                  " SUS9n[
        R                  " XSS9  [        R                  " SS	9 n[        R                  " S
S[        5        [
        R                  " X5        [        US   R                  [        L 5        S S S 5        U R                  S5        U R                  5       n[        [        U5      [
        R                   -  S:H  5        U R                  S5        [
        R"                  " U SS9n[%        X65        ['        [(        [
        R                  XS5        g s  snf ! , (       d  f       N= f)N  %dd     r   r   r   versionTrecordalwaysr   r   @ max_header_sizer7   r   )r   r   floatr   r   r   r]   warningscatch_warningsfilterwarningsr   r   categoryr   readlinelenARRAY_ALIGNr_   r	   r
   rw   )rb   r   r   r   wheaderns          rN   test_version_2_0r
    s   	A-23Z	8ZD1HU
#ZB	8
BA
qV,		 	 	-"k:1 !,- 
. FF1IZZ\FCK&,,,12FF1I!V4Aq *f00!?' 
9 
.	-s   E$0AE))
E7c           
         [        S5       Vs/ s H  nSU-  S-  [        4PM     nn[        R                  " SUS9n[        R
                  R                  U S5      n[        R
                  R                  U S5      n[        [        [        R                  USUR                  UR                  S	S
9  [        R                  " USUR                  UR                  SS
9nX6S'   UR                  5         [        R                  " USSS9n[        Xc5        [        R                   " SS9 n[        R"                  " SS[$        5        [        R                  " USUR                  UR                  S S
9n['        US   R(                  [$        L 5        X6S'   UR                  5         S S S 5        [        R                  " USSS9n[        Xc5        g s  snf ! , (       d  f       N5= f)Nr   r   r   r   r   zversion2_01.npyzversion2_02.npyr   r   )r   r   r   r   r   .r   r   )r   r   Tr   r   r   r   )r   r   r   r   r   r   r   r
   rw   r   r   r   r   r   r	   r   r  r  r   r   r  )r   r   r   r   tf1tf2r   r  s           rN   test_version_2_0_memmapr    sw    .33Z	8ZD1HU
#ZB	8
BA
'',,v0
1C
'',,v0
1C *f00#D"#''6; 
		Cd!''"#''6
;BsGHHJ			Cc6	BBr		 	 	-"k:$agg&'ggt=!,-3

 
. 
		Cc6	BBr5 
9  
.	-s   G'A;G
G	mmap_moder   c                    [         R                  R                  U S5      n[        R                  " SSS-  S-   S9n[
        R                  " [        SS9   [        R                  " X#5        S S S 5        [
        R                  " [        S	S9   [        R                  " X!S
9  S S S 5        [
        R                  " [        S	S9   [        R                  " X!SS9  S S S 5        [        R                  " X!SS9n[        XC5        [        R                  " X!SS9n[        XC5        g ! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       Nq= f)Nzlarge_header.npyr7   i,'  r   r   .*format 2.0r}   Header.*large)r   N  )r  r   T)r  r[     )r   r   r   r   r   r   r   r   r   r   rw   r   r	   )r   r  rb   ra   ress        rN   test_huge_headerr    s    
V/0A
((1D5L3.
/C	k	8
 
9 
z	9
' 
: 
z	9
> 
: ''!t
<Cs 
''!&
ACs  
9	8 
:	9 
:	9s$   D"D3E"
D03
E
Ec                    [         R                  R                  U S5      n[        R                  " SSS-  S-   S9n[
        R                  " [        SS9   [        R                  " XS	9  S S S 5        [
        R                  " [        S
S9   [        R                  " U5      S     S S S 5        [
        R                  " [        S
S9   [        R                  " USS9S     S S S 5        [        R                  " USS9S   n[        X25        [        R                  " USS9S   n[        X25        g ! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       Nw= f)Nzlarge_header.npzr7   r  r  r   r   r  r}   rx   r  ra   r  r   TrZ   r  )r   r   r   r   r   r   r   r   r   r   rw   r   r	   )r   rb   ra   r  s       rN   test_huge_header_npzr    s    
V/0A
((1D5L3.
/C	k	8
 
9 
z	9

5 
: 
z	9
5)%0 
: ''!$
'
.Cs 
''!V
,U
3Cs  
9	8 
:	9 
:	9s$   D.D?E.
D<?
E
Ec                     [        5       n [        R                  " S5      n[        R                  " XSS9  [        R                  " X5        [        R                  " XS S9  [        R                  " X5        [        R                  " XSS9  [        R                  " X5        / SQnU H1  n[        [        S5         [        R                  " XUS9  S S S 5        M3     g ! , (       d  f       ME  = f)Nr7   r   r   r   ))r7   r7   )r   r   )r   r7   r   )   r  z we only support format version.*)r   r   aranger   r]   r   rw   )rb   ra   bad_versionsr   s       rN   test_write_versionr    s    	A
))A,C
qv.
q
qt,
q
qv.
qL   !CEqw7E E  E Es   ;C
C-	)s   NUMPYs   NUMPY  s   NUMPY s   NUMPY s   NUMPYs   NUMPY)s   NUMPY s    NUMPY s   numpy s   MATLB s   NUMPYs   NUMPYrP   c                  .   [        5       n [        5       n[        R                  " S[        S9n[        R
                  " XSS9  [        R
                  " XSS9  U R                  S5        UR                  S5        [        R                  " U 5      n[        R                  " U5      n[        US:H  5        [        US:H  5        [        U R                  5       [        R                  :H  5        [        UR                  5       [        R                  :H  5        g )Nr   r   r   r   r   r   r   )r   r   r   r   r   r]   r   
read_magicr   tell	MAGIC_LEN)s1s2ra   version1version2s        rN   test_read_magicr)  :  s    	B	B
''&
&C
r/
r/GGAJGGAJ  $H  $HHHBGGI)))*BGGI)))*rP   c                  r    [          H-  n [        U 5      n[        [        [        R
                  U5        M/     g rR   )malformed_magicr   r
   rw   r   r_   magicrb   s     rN   test_read_magic_bad_magicr.  O  s'     ENj&"3"3Q7 !rP   c                      [         [        -    H-  n [        U 5      n[        [        [
        R                  U5        M/     g rR   )bad_version_magicr+  r   r
   rw   r   r_   r,  s     rN   test_read_version_1_0_bad_magicr1  U  s,    "_4ENj&"3"3Q7 5rP   c                     [        [        [        R                  SS5        [        [        [        R                  SS5        [        [        [        R                  SS5        [        [        [        R                  SS5        g )Nr   r7      )r
   rw   r   r-  rQ   rP   rN   test_bad_magic_argsr4  [  sJ    *fllB2*fllC3*fllAr2*fllAs3rP   c                      [        5       n SSSS.n[        R                  " X5        [        5       n SS-  S4/US'   [        [        [        R                  X5        g )NrQ   Fz<i8r   r   r      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxr3  r   )r   r   write_array_header_1_0r
   rw   sr   s     rN   test_large_headerr;  b  sQ    	Auu=A
!!!'	As?E*+AgJ*f;;QBrP   c                  l   [        5       n [        R                  " S[        S9n[        R
                  " XSS9  U R                  [        R                  5        [        R                  " U 5      u  p#n[        U R                  5       [        R                  -  S:H  5        [        X#U4SS[        4:H  5        g )Nr!  r   r   r   r   F)r   r   r   r   r   r]   r   r$  read_array_header_1_0r   r#  r  r:  ra   r   fortranr   s        rN   test_read_array_header_1_0r@  l      	A
''&
&C
qv.FF6"88;EEAFFHv)))Q./UU#u'==>rP   c                  l   [        5       n [        R                  " S[        S9n[        R
                  " XSS9  U R                  [        R                  5        [        R                  " U 5      u  p#n[        U R                  5       [        R                  -  S:H  5        [        X#U4SS[        4:H  5        g )Nr!  r   r   r   r   F)r   r   r   r   r   r]   r   r$  read_array_header_2_0r   r#  r  r>  s        rN   test_read_array_header_2_0rD  y  rA  rP   c                     [        5       n [        [        [        R                  U 5        [        S5      n [        [        [        R                  U 5        [        S5      n [        [        [        R                  U 5        [        S5      n [        [        [        R                  U 5        SSSSS.n[        5       n [        R
                  " X5        [        [        [        R                  U 5        g )	N   1s    s@   NUMPY 6 {'descr': 'x', 'shape': (1, 2), }                    
r7   r   Fr   r   )r   r   r   extrakey)r   r
   rw   r   r=  r8  r9  s     rN   test_bad_headerrI    s    	A*f::A>A*f::A> 	A*f::A>
 		"	A *f::A>	A 		A
!!!'*f::A>rP   c                    [         R                  S:X  d  [         R                  S:X  a  [        R                  " S5        [        R
                  R                  U S5      n SS KnUR                  SSSU/5        [        US
5       nUR                  S5        [        R                  " S5      n[        R                  " X45        S S S 5        [        US5       nUR                  S5        [        R                  " U5      nS S S 5        [!        WW5        g ! [         a    [        R                  " S	5         Nf = f! , (       d  f       N}= f! , (       d  f       NR= f)Nwin32cygwinz)Unknown if Windows has sparse filesystemssparse_filer   r   z-s
5368709120zCould not create 5GB large filer{   l        rC   r|   )sysplatformr   skipr   r   r   
subprocess
check_call	Exceptionr   r   r   r  r   r   r	   )r   tf_namesprb   r   r   s         rN   test_large_file_supportrW    s    3<<8#;?@ggll6=1G7 	 
z4w?@ 
gt		zIIaL
 

 
gt		zGGAJ 
 q!  7567 
	
 
	s*    D >D:(E D76D7:
E
Ezflaky on PyPyztest requires 64-bit systeml        )
free_byteszcrashes with low memoryc                    Sn [         R                  " U[         R                  S9n[        R                  R                  U S5      n[        US5       n[         R                  " UWS9  S S S 5        A[        US5       n[         R                  " U5      S   nS S S 5        WR                  U:X  d   eg ! [         a    [        R
                  " S5         Nf = f! , (       d  f       Nv= f! , (       d  f       NX= f)	N)i   @r   r   zCould not create large filelarge_archiver{   rx   r|   ra   )r   emptyuint8MemoryErrorr   rQ  r   r   r   r   r   r   r   )r   r   r   r   rb   new_as         rN   test_large_archiver_    s     E3HHU"((+ GGLL1E	eT	a
 
 	
	eT	a
5! 
 ;;%  3123
 
	
 
	s)   #B3 C>C*3 CC
C'*
C8c                     [         R                  R                  U S5      n[        R                  " U5        [        R
                  " U5       n S S S 5        g ! , (       d  f       g = f)Nznothing.npz)r   r   r   r   r   r   )r   r   npss      rN   test_empty_npzrb    s;    GGLL/EHHUO	3 
s   A
A&c                 r   [         R                  " / SQS[        4S[        4/S9n[        R                  R                  U S5      n[        US5       n[        R                  " X1SS9  S S S 5        [        US	5       n[        R                  " U5      nS S S 5        [        UW5        [        US5       n[        R                  " [        5         [        R                  " X1S S9  S S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       Ny= f! , (       d  f       N9= f! , (       d  f       g = f)
N)r7   r   rG  rd  rG  intu   整形r   zunicode.npyr{   )r   r   r   r|   )r   r   re  r   r   r   r   r   r]   r_   r	   r   r   r   )r   ra   r   rb   rd   s        rN   test_unicode_field_namesrf    s    
((  
	GMC GGLL/E	eT	a162 
	eT	a  # 
sD! 
eT	a\\+&qt4 ' 
	 
			 '& 
	s<   C5<D3D(D$D(5
D
D
D%	!D((
D6c                     / SQ/ SQ/ SQ/ SQ4 H  u  pn[        [        R                  5       Vs/ s H  nSU-  PM
     sn Hr  n[        5       n[        R                  " UU (       a  SU4OUS4U [
        R                  " SU-  [        4/5      S.5        [        UR                  5       5      U:X  a  Mr   e   M     g s  snf )	N)F      )F      )Trj  ri  )T   rk  r   r    r6  )
r   r   GROWTH_AXIS_MAX_DIGITSr   r8  r   r   re  r  r^   )is_fortran_arraydtype_spaceexpected_header_lengthr   rL   r   s         rN   test_header_growth_axisrr    s    *O_B='= %*&*G*G$HI$HqRU$HIDB))"&6!TT1I!1C+$5s#;"<=/  r{{}%)???? JB Js   B=S3somestuff)metadatasubarrayr   )   r   r    zPyPy bug in error formattingc                    [         R                  " SU S9n[        5       n[        R                  " [
        5         [         R                  " X!5        S S S 5        UR                  S5        [         R                  " U5      nSSK	J
n  [        X5        U" UR                  5      UR                  Ld   eU" UR                  5      UR                  L d   eg ! , (       d  f       N= f)Nr   r   r   )drop_metadata)r   r   r   r   r   r   r   r   r   numpy.lib._utils_implrz  r	   r   )r   ra   bufrd   rz  s        rN   test_metadata_dtyper}    s     ''"B
C
)C	k	"
 
#HHQK 773<D3s!#399444$

222 
#	"s   C
C")m__doc__r   rO  r   ior   r   numpyr   	numpy.libr   numpy.testingr   r   r   r   r	   r
   r   numpy.testing._private.utilsr   r\  int8uint16int16uint32int32uint64int64float32float64	complex64
complex128rt   scalarsro   scalarendianr   newbyteorderr  astypebasicextendr   reshapeTPdescrPbufferTNdescrNbufferTr   rp   rE   re   rg   ri   rm   rr   ru   ry   r   r   markskipifslowr   r   r   dt2dt3dt4dt5dt6parametrizer   version_infoxfailr   r  r   r   re  r   r
  r  r  r  r  r0  r+  r)  r.  r1  r4  r;  r@  rD  rI  rW  thread_unsafer_  rb  rf  rr  r   implementationr   r}  rQ   rP   rN   <module>r     s	  Rf 
 
        9 HHGGIIHHIIHHIIHHJJJJLLMM
 F --f5		$&&u-HHRu%HHRu%MM(#MM(#%%MM(#DbD#A#I.
 	  6
 Vr2hR!1%Vr2hR!1%( 	   	!
 		 	   #
( Vb"tb"XBx!Q8$E	:R2r(+Q0Vb"tb"XBx!Q8$F	:R2r(+Q0 HHXRXXf-::3?@HHXRXXf-::3?@HHXRXXf-::3?@HHXRXXf-::3?@HHQ123" "&*@
-24 G$CD  E<" 	hh|4(hh#stq6# $ 	hh#ss<=hhTFQJ?@hh#stq6dD\; < 	hh:;S#sC=>" ?" C$$/G7#FG) H H) PR,1R,1^&  HHsBGGnBHHoBHHo  HHsBHHc
*.*+Q*+
      HH    HHsBHH
HHSz"&"#Q"#% &  	 		
 	 	 

 
 HH	bhhHHHHc
bhh#s48$<45q645(7 8 9  	 	   
  	
 =0  0b#c0b#@2 G$CD E< sDk2! 3!&!(86 +*884C
?
??:2 GO4L)FGI&";<  = '  H 5
 ,5.@ HHSzrxx!7+8- 0. / 0HHSFG,-HHzC;'(FG3DEHHSzrxx3%RXXcB5O4PQR/  	  	 GG 2 2 : :i G-  /3/	3rP   