+
    ei  c                   s   R t ^ RIt^ RIt^ RIt^ RIHt ^ RIt^ RIt^ RI	H
t
 ^ RIHtHtHtHtHtHtHtHt ^ RIHt ]P,                  ]P.                  ]P0                  ]P2                  ]P4                  ]P6                  ]P8                  ]P:                  ]P<                  ]P>                  ]P@                  ]PB                  ]".t#. t$]# F  t%R F  t&]PN                  ! ]%4      PQ                  ]&4      t']PR                  ! R4      PU                  ]'4      t+]$PY                  ]PZ                  ! . ]'R7      ]PZ                  ! ^
]'R7      ]+]+P]                  Rd4      ]+P]                  Rd4      P^                  ]+P]                  Rd4      RRRe1R	3,          .4       K  	  K  	  . RjOt0^^.RR.RR..^3^^.RR.RR..^	3.t1RgRRkRlR. RnO3RmRo.3RpRRqRr.3RhRi.t2^^.RRRRR.RR.^^.3RR3RRsRR.RR..^3^^.RRRRR.RR.^^.3RR3RRtRR.RR..^	3.t3]PZ                  ! ]1]PN                  ! ]04      PQ                  R4      R7      ]PZ                  ! ]3]PN                  ! ]24      PQ                  R4      R7      ]PZ                  ! ]1]PN                  ! ]04      PQ                  R 4      R7      ]PZ                  ! ]3]PN                  ! ]24      PQ                  R 4      R7      ]Ph                  ! ^Rv.R7      .t5 ! R" R#]4      t6R$ t7R% t8R& t9R' t:R( t;R) t<R* t=R+ t>R, t?]P                  P                  ]R-R.7      ]P                  P                  R/ 4       4       tCR0 tD]PN                  ! R1RR27      tE]PN                  ! R3R4R5.R6RR.R7^^./4      tF]PN                  ! R3R!R8.R6R]F./4      tG]PN                  ! R3. RwOR6R.^,          /4      tH]PN                  ! R3R4R5.R6RR.R7^^.R9R:R;./4      tI]PN                  ! R3. R6. R<^/4      tJ]P                  P                  R=]E]F]G]H]I]J.4      R> 4       tL]P                  P                  ]P                  Rx8  R?R.7      ]P                  P                  ]R@R.7      RA 4       4       tORB tPRC tQ]P                  P                  R=]PN                  ! ]PN                  ! R4]P.                  3R5]P2                  3R!]P6                  3.RR27      Ry4      ]PN                  ! R
]PN                  ! R3R4R5.R6RDRD.R7^ ^.R<^/Ry4      Rz3.4      ]PN                  ! R{.4      ]PN                  ! R
]PN                  ! ]PN                  ! ]PN                  ! R3R4R5.R6RDRD.R7^ ^.R<^/4      Ry34      Rz34      3.4      ]PN                  ! R4]PN                  ! ]PN                  ! ]PN                  ! ]PN                  ! R4]R3R5]PN                  ! R3R4R5.R6RDRD.R7^ ^.R<^/4      3.4      Ry34      Rz34      Ru34      3.4      .4      RE 4       tSRF tT]P                  P                  ]R-R.7      RG 4       tU]P                  P                  RHRIR.4      RJ 4       tVRK tWRL tX. R|OtY. R}OtZRM t[RN t\RO t]RP t^RQ t_RR t`RS taRT tbRU tc]P                  P                  ]RVR.7      ]P                  P                  ]'       * RWR.7      ]P                  P                  ]! R~RX7      RY 4       4       4       4       tdRZ teR[ tfR\ tg]P                  P                  R=]PN                  ! R3R4R5.R6]h]PN                  ! R]R^R_/R`7      ./4      ]PN                  ! ]RR^R_/R`7      ]PN                  ! Ra]RRf33.R^R_/R`7      ]PN                  ! R3R4R5.R6]h]PN                  ! R3R!.R6]PN                  ! ]R/ R`7      ./4      ./4      .4      ]P                  P                  ];'       d    ]P                  P                  R8*  RbR.7      Rc 4       4       tkR# )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assert_warns)requires_memoryz<>i  dtype:NN   xi4g      @g      @g      @g      @ZInfoZInfo2Zinfo              @Znny              @NNTZcc              @Zooy              @OOFZddZ<Z>cc                   s6   a a ] tR tRt oRV 3R lltRtVtV ;t# )BytesIOSRandomSizei  c                sN   < ^ RI pVP                  ^V4      p\        SV `  V4      # )    N)randomZrandintZsuperread)Zselfsizer   	__class__s   && B/usr/lib64/python3.14/site-packages/numpy/lib/tests/test_format.pyr   ZBytesIOSRandomSize.read  s%    ~~a&w|D!!     N)Z__name__Z
__module__Z__qualname__Z__firstlineno__r   Z__static_attributes__Z__classdictcell__Z__classcell__)r   Z__classdict__s   @@r   r   r     s     " "r   r   c                 s    \        4       p\        P                  ! W4       \        VP                  4       4      p\        P                  ! VR R7      pV# )Tallow_pickler    r   write_arraygetvalue
read_arrayarrfZf2arr2   &   r   	roundtripr*     s>    	A
q		BRd3DKr   c                 s    \        4       p\        P                  ! W4       \        VP	                  4       4      p\        P
                  ! V4      pV# r   )r    r   r"   r   r#   r$   r%   r)   r   roundtrip_randsizer+     s<    	A
q	AJJL	)BR DKr   c                 s    \        4       p\        P                  ! W4       \        VP                  4       ^ R 4      p\        P                  ! V4      pV# )r   r!   r%   r)   r   roundtrip_truncatedr-     sC    	A
q	a#	$BR DKr   c                 s     \        W8H  4       R # r   )r   )Zo1Zo2s   &&r   assert_equal_r.     s    BHr   c                  sb    \         \        ,            F  p \        V 4      p\        W4       K  	  R # r   )basic_arraysrecord_arraysr*   r   r&   r(        r   test_roundtripr3     s%    m++~3% ,r   c                  s    \         \        ,            F0  p V P                  \        8w  g   K  \	        V 4      p\        W4       K2  	  R # r   )r/   r0   r   objectr+   r   r1   r2   r   test_roundtrip_randsizer5     s2    m++99%c*Ds) ,r   c                  sx    \          F/  p V P                  \        8w  g   K  \        \        \
        V 4       K1  	  R # r   )r/   r   r4   r   
ValueErrorr-   r&   s    r   test_roundtrip_truncatedr8     s%    99*&93? r   c           
      s   V R ,          p\          EF  pVP                  \        8w  g   K  \        VR4      ;_uu_ 4       p\        P
                  ! W24       RRR4       \        VR4      ;_uu_ 4       pVP                  R\        P                  4       VP                  4        RRR4       \        VR4      ;_uu_ 4       p\        P                  ! \        VP                  ^ 8X  d   RMRR7      ;_uu_ 4        \        P                  ! V4      pRRR4       RRR4       EK  	  R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     LE; i  + '       g   i     EK`  ; i)	za.npywbNzrb+rbz9EOF: 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\?\)Zmatchr,   )r/   r   r4   openr   r"   seekosZSEEK_ENDtruncatepytestraisesr6   r   r$   )Ztmp_pathpathr&   r'   Z_   &    r   test_file_truncatedrD     s    gD|99dD!!Q""1* " dE""ar2;;'

 # dD!!Q]] Q:>  ))!,A "! !! #"  "!!s;   D%21D8?8E7EE%D58EEEE0c                  s    \         P                  ! ^\         P                  ! \        \        P
                  ^,           34      R7      p \        V 4      p\        W4       R# )   r   N)nponesr   strr   ZBUFFER_SIZEr*   r   )Zlong_str_arrZlong_str_arr2r2   r   test_long_strrI     s=    771BHHc63E3E3I-J$KLLl+M|3r   zmemmap doesn't work correctly)Zreasonc           	      s
   \        \        \        ,           4       EF  w  rVP                  P                  '       d   K$  \
        P                  P                  V R V R24      p\
        P                  P                  V RV R24      p\        VR4      ;_uu_ 4       p\        P                  ! WR4       RRR4       VP                  P                  ;'       d    VP                  P                  '       * p\        P                  ! VRVP                  VP                  VR7      pW'R&   VP!                  4        \        VR4      ;_uu_ 4       pVP#                  4       pRRR4       \        VR4      ;_uu_ 4       pVP#                  4       p	RRR4       \%        XX	4       \        P                  ! VR	R
7      pVP!                  4        EK  	  R#   + '       g   i     EL"; i  + '       g   i     L; i  + '       g   i     Lr; i)Znormalz.npyZmemmapr9   Nw+)moder   shapefortran_order.r:   r)rK   )Z	enumerater/   r0   r   Z	hasobjectr>   rB   joinr<   r   r"   ZflagsZf_contiguousZc_contiguousopen_memmaprL   flushr   r.   )
tmpdirir&   ZnfnZmfnfprM   maZnormal_bytesZmemmap_bytess
   &         r   test_memmap_roundtriprV     s_    L=8999ggll6VA3d#34ggll6VA3d#34#t__r'  II""AA399+A+A'A 	$cii&)ii}N3

 #t__779L #t__779L lL1 #.

5 : __ __s$   G
G7G2GG/2Hc                 sR   \         P                  P                  ^^4      p\        P                  P                  V R4      p\         P                  ! W!R7       \         P                  ! V4      ;_uu_ 4       pVR,          pRRR4       \        VX4       R#   + '       g   i     L; i)i   zcompressed.npzr7   r&   N)	rF   r   Zrandr>   rB   rO   Zsavez_compressedloadr   )rR   r&   npz_filenpzarr1rC   r   test_compressed_roundtripr[     sk    
))..c
"Cww||F$45H*			c5z 
sD! 
	s   6
BB&	z
i1, i4, i1)ZalignZnamesabZformatsZoffsetsdZtitlesZaaZbbZitemsizedtc                 sz   \         P                  ! ^V4      p\        ^4       F  pV^,           W#&   K  	  \        P                  P                  V R4      p\         P                  ! WBR7       \         P                  ! V4      ;_uu_ 4       pVR,          pRRR4       \        VX4       R#   + '       g   i     L; i)   zaligned.npzr7   r&   N)	rF   zerosranger>   rB   rO   savezrW   r   )rR   r_   r&   rS   rX   rY   rZ   s   &&     r   test_load_padded_dtyperd   #  s|    
((1b/C1XQ ww||FM2HHHX			c5z 
sD! 
	s   

B**B:	zsee gh-23988z!Emscripten NODEFS has a buggy dupc                  sz   R p \         P                  P                  \         P                  P                  \        4      RV 4      p\
        P                  ! \        RR7      ;_uu_ 4        \        P                  ! V4      pRRR4       \        X\        P                  ! ^4      4       R#   + '       g   i     L2; i)zwin64python2.npydatazReading.*this warning\.r;   N)r>   rB   rO   dirname__file__r@   warnsUserWarningrF   rW   r   rG   )fnamerB   re   s      r   %test_python2_python3_interoperabilityrk   /  sm     E77<<165AD	k)C	D	Dwwt} 
EtRWWQZ( 
E	Ds   )B**B:	c            
      s   \         P                  P                  \         P                  P                  \        4      R 4      p \
        P                  ! R\        RR.\        R7      pR EF  p\         P                  P                  W4      pR F  p\
        P                  ! VRVR7      pVP                  R4      '       d   VR	,          pVP                  4        MTpVR8X  du   VP                  R
4      '       d^   \        \        V^,          \        4      4       \!        VRR VRR 4       \!        VR,          P#                  V4      VR,          4       K  \        \        V^,          \$        4      4       \!        Wa4       K  	  VP                  R
4      '       g   EK8  VP                  R4      '       d   \
        P                  ! VRR7      p\'        \(        VP*                  R	4       VP                  4        \
        P                  ! VRRRR7      p\'        \,        VP*                  R	4       VP                  4        EK  \'        \(        \
        P                  VRR7       \'        \,        \
        P                  VRRRR7       EK!  	  R# )re   Nu   優良s   不良r   latin1Tr    encodingz.npzr   Zpy2r   F)r    Zfix_importsrn   )zpy2-np0-objarr.npypy2-objarr.npypy2-objarr.npzzpy3-objarr.npyzpy3-objarr.npz)bytesrl   r,   )r>   rB   rO   rf   rg   rF   arrayrb   r4   rW   ZendswithZcloseZ
startswithr   Z
isinstancerH   r   Zencoderq   r   ZUnicodeError__getitem__ZImportError)data_dirZexpectedrj   rB   rn   Zdata_fre             r   test_pickle_python2_python3rv   9  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'/1 1C6r   c           
      s   \         P                  P                  \         P                  P                  \        4      R 4      p\         P                  P                  VR4      p\        \        \        P                  VRRR7       \         P                  P                  VR4      p\        P                  ! VRRR7      ;_uu_ 4       p\        \        VP                  R4       RRR4       \         P                  P                  V R4      p\        \        \        P                  V\        P                  ! R.\        R	7      RR
7       R#   + '       g   i     Lo; i)re   ro   Frl   rm   rp   r   Nzpickle-disabled.npyr   r   )r>   rB   rO   rf   rg   r   r6   rF   rW   rs   saverr   r4   )rR   rt   rB   r'   r)   r   test_pickle_disallowrx   h  s    ww||BGGOOH5v>H77<<"23D*bggt$x9 77<<"23D	EH	=	=j!--5 
> 77<< 56D*bggtRXXtfF-K$&	 
>	=s   EE	Zi1c                 s    \         P                  ! V P                  4      p\        W4       \        P
                  ! ^V 4      p\        V4      p\        W#4       R# )r`   N)r   Zdescr_to_dtypedescrr.   rF   ra   r*   r   )r_   dt1rZ   r(   r)   r   test_descr_to_dtyper{   w  sA    b 


)C#88Ar?DT?Dt"r   c                  s@   \        4       p \        R 4       Uu. uF  pRV,          ^d,          \        3NK  	  pp\        P                  ! RVR7      p\
        P                  ! WRR7       \        P                  ! RR7      ;_uu_ 4       p\        P                  ! RR\        4       \
        P                  ! W4       \        V^ ,          P                  \        J 4       R	R	R	4       V P                  ^ 4       V P                  4       p\        \        V4      \
        P                   ,          ^ 8H  4       V P                  ^ 4       \
        P"                  ! V R
R7      p\%        W64       \'        \(        \
        P                  WR4       R	# u upi   + '       g   i     L; i)  %d  r   versionTZrecordalways N@ max_header_sizer   r   rE   r   )r    rb   floatrF   rG   r   r"   warningscatch_warningsfilterwarningsri   r   categoryr=   ZreadlinelenARRAY_ALIGNr$   r   r   r6   )r'   rS   r_   r^   wZheaderZnru   r   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   FAFF	c           
      s   \        R 4       Uu. uF  pRV,          ^d,          \        3NK  	  pp\        P                  ! RVR7      p\        P
                  P                  V R4      p\        P
                  P                  V R4      p\        \        \        P                  VRVP                  VP                  RR7       \        P                  ! VRVP                  VP                  RR7      pW6R&   VP                  4        \        P                  ! VR	R
R7      p\        Wc4       \        P                   ! RR7      ;_uu_ 4       p\        P"                  ! RR\$        4       \        P                  ! VRVP                  VP                  RR7      p\'        V^ ,          P(                  \$        J 4       W6R&   VP                  4        RRR4       \        P                  ! VR	R
R7      p\        Wc4       R# u upi   + '       g   i     L;; i)r|   r}   r~   r   zversion2_01.npyzversion2_02.npyrJ   )rK   r   rL   r   .rN   r   )rK   r   Tr   r   r   Nr   r   )rb   r   rF   rG   r>   rB   rO   r   r6   r   rP   r   rL   rQ   r   r   r   r   ri   r   r   )rR   rS   r_   r^   Ztf1Ztf2rU   r   s   &       r   test_version_2_0_memmapr     sz    .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   G5BG::H
		mmap_moderN   c                 s(   \         P                  P                  V R 4      p\        P                  ! ^RR,          R,           R7      p\
        P                  ! \        RR7      ;_uu_ 4        \        P                  ! W#4       RRR4       \
        P                  ! \        RR7      ;_uu_ 4        \        P                  ! W!R	7       RRR4       \
        P                  ! \        RR7      ;_uu_ 4        \        P                  ! W!R
R7       RRR4       \        P                  ! W!RR7      p\        WC4       \        P                  ! W!RR7      p\        WC4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L~; i)zlarge_header.npyi,'  rS   r   .*format 2.0r;   NHeader.*large)r    N  )r   r   T)r   r      )r>   rB   rO   rF   rr   r@   rh   ri   rw   rA   r6   rW   r   )rR   r   r'   r&   ress   &&   r   test_huge_headerr     s    
V/0A
((1D5L3.
/C	k	8	8
 
9 
z	9	9
' 
: 
z	9	9
> 
: ''!t
<Cs 
''!&
ACs  
9	8 
:	9 
:	9s$   +E.E.2FE+	.E>	F	c                 s`   \         P                  P                  V R 4      p\        P                  ! ^RR,          R,           R7      p\
        P                  ! \        RR7      ;_uu_ 4        \        P                  ! WR7       RRR4       \
        P                  ! \        R	R7      ;_uu_ 4        \        P                  ! V4      R
,           RRR4       \
        P                  ! \        R	R7      ;_uu_ 4        \        P                  ! VRR7      R
,           RRR4       \        P                  ! VRR7      R
,          p\        W24       \        P                  ! VRR7      R
,          p\        W24       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i)zlarge_header.npzr   r   rS   r   r   r;   r7   Nr   r&   r   r   Tr   r   )r>   rB   rO   rF   rr   r@   rh   ri   rc   rA   r6   rW   r   )rR   r'   r&   r   r)   r   test_huge_header_npzr     s    
V/0A
((1D5L3.
/C	k	8	8
 
9 
z	9	9

5 
: 
z	9	9
5)%0 
: ''!$
'
.Cs 
''!V
,U
3Cs  
9	8 
:	9 
:	9s$   +E7/F
9 F7F	
F	F-	c            	      s   \        4       p \        P                  ! ^4      p\        P                  ! WRR7       \        P                  ! W4       \        P                  ! WRR7       \        P                  ! W4       \        P                  ! WRR7       \        P                  ! W4       . ROpV F<  p\        \        R4      ;_uu_ 4        \        P                  ! WVR7       RRR4       K>  	  R#   + '       g   i     KS  ; i)rE   r   Nz we only support format version.*r   r   ))rE   rE   )r   r   )r   rE   r   r   )   r   )r    rF   aranger   r"   r   r6   )r'   r&   Zbad_versionsr   s       r   test_write_versionr     s    	A
))A,C
qv.
q
qt,
q
qv.
qL   !CE Eqw7E E  E E Es   C33Dc                  sB   \        4       p \        4       p\        P                  ! R\        R7      p\        P
                  ! WRR7       \        P
                  ! WRR7       V P                  ^ 4       VP                  ^ 4       \        P                  ! V 4      p\        P                  ! V4      p\        VR8H  4       \        VR8H  4       \        V P                  4       \        P                  8H  4       \        VP                  4       \        P                  8H  4       R# )r`   r   r   Nr`   i   r   r   )r    rF   rG   r   r   r"   r=   Z
read_magicr   tell	MAGIC_LEN)Zs1Zs2r&   Zversion1Zversion2        r   test_read_magicr   ;  s    	B	B
''&
&C
r/
r/GGAJGGAJ  $H  $HHHBGGI)))*BGGI)))*r   c                  st    \          F-  p \        V 4      p\        \        \        P
                  V4       K/  	  R # r   )malformed_magicr    r   r6   r   r$   magicr'   r2   r   test_read_magic_bad_magicr   P  s'     ENj&"3"3Q7 !r   c                  s    \         \        ,            F-  p \        V 4      p\        \        \
        P                  V4       K/  	  R # r   )bad_version_magicr   r    r   r6   r   r$   r   r2   r   test_read_version_1_0_bad_magicr   V  s/    "_44ENj&"3"3Q7 5r   c                  s   \        \        \        P                  R^4       \        \        \        P                  R^4       \        \        \        P                  ^R4       \        \        \        P                  ^R4       R# )rE      Nr,   )r   r6   r   r   r   r   r   test_bad_magic_argsr   \  sJ    *fllB2*fllC3*fllAr2*fllAs3r   c                  s    \        4       p R RRRRR/p\        P                  ! W4       \        4       p RR,          R3.VR&   \        \        \        P                  W4       R# )	rL   rM   Fry   z<i8r   Nr   A   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)r    r   write_array_header_1_0r   r6   sr^   r2   r   test_large_headerr   c  sW    	A	"ougu=A
!!!'	As?E*+AgJ*f;;QBr   c                     \        4       p \        P                  ! R\        R7      p\        P
                  ! WRR7       V P                  \        P                  4       \        P                  ! V 4      w  r#p\        V P                  4       \        P                  ,          ^ 8H  4       \        W#V3RR\        38H  4       R# )r`   r   r   FNr   r   )r    rF   rG   r   r   r"   r=   r   read_array_header_1_0r   r   r   r   r&   rL   Zfortranr   r   r   test_read_array_header_1_0r   m      	A
''&
&C
qv.FF6"88;EEAFFHv)))Q./UU#u'==>r   c                  r   )r`   r   r   FNr   r   )r    rF   rG   r   r   r"   r=   r   Zread_array_header_2_0r   r   r   r   r   r   test_read_array_header_2_0r   z  r   r   c                  s   \        4       p \        \        \        P                  V 4       \        R 4      p \        \        \        P                  V 4       \        R4      p \        \        \        P                  V 4       \        R4      p \        \        \        P                  V 4       RR
RRRRRR/p\        4       p \        P
                  ! W4       \        \        \        P                  V 4       R	# )s   1s    s@   NUMPY 6 {'descr': 'x', 'shape': (1, 2), }                    
rL   rM   Fry   r   ZextrakeyNrE   r   r,   )r    r   r6   r   r   r   r   r2   r   test_bad_headerr     s    	A*f::A>A*f::A> 	A*f::A>
 		"	A *f::A>	&	%	#	R	A 		A
!!!'*f::A>r   c                 s   \         P                  R 8X  g   \         P                  R8X  d   \        P                  ! R4       \        P
                  P                  V R4      p ^ RIpVP                  RRRV.4       \        VR	4      ;_uu_ 4       pVP                  R
4       \        P                  ! ^4      p\        P                  ! W44       RRR4       \        VR4      ;_uu_ 4       pVP                  R
4       \        P                  ! V4      pRRR4       \!        XX4       R#   \         d    \        P                  ! R4        Li ; i  + '       g   i     L; i  + '       g   i     LX; i)Zwin32Zcygwinz)Unknown if Windows has sparse filesystemsZsparse_fileNr?   z-sZ
5368709120zCould not create 5GB large filer9   l        r:   )sysZplatformr@   skipr>   rB   rO   Z
subprocessZ
check_callZ	Exceptionr<   r=   rF   r   rw   rW   r   )rR   Ztf_nameZspr'   r^   rN      &     r   test_large_file_supportr     s    3<<8#;?@ggll6=1G7 	 
z4w?@ 
gt			zIIaL
 

 
gt			zGGAJ 
 q!  7567 
	
 
	s*   "D' >E)(E!'!E
EE	!E1	zflaky on PyPyztest requires 64-bit system)Z
free_bytesc                 s8   R	p \         P                  ! V\         P                  R7      p\        P                  P                  V R4      p\        VR4      ;_uu_ 4       p\         P                  ! VXR7       RRR4       ?\        VR4      ;_uu_ 4       p\         P                  ! V4      R,          pRRR4       XP                  V8X  g   Q hR#   \         d    \        P
                  ! R4        Li ; i  + '       g   i     L; i  + '       g   i     L_; i)
r   r   zCould not create large fileZlarge_archiver9   r7   Nr:   r&   )i   @r   )rF   Zemptyuint8ZMemoryErrorr@   r   r>   rB   rO   r<   rc   rW   rL   )rR   rL   r\   rj   r'   Znew_ar   r   test_large_archiver     s     E3HHU"((+ GGLL1E	eT		a
 
 	
	eT		a
5! 
 ;;%  3123
 
	
 
	s)   &C C6D	!C32C36D		D	c                 s    \         P                  P                  V R 4      p\        P                  ! V4       \        P
                  ! V4      ;_uu_ 4       p RRR4       R#   + '       g   i     R# ; i)znothing.npzN)r>   rB   rO   rF   rc   rW   )rR   rj   Znpss   &  r   test_empty_npzr     s?    GGLL/EHHUO	3 
s   A!!A2	c           
      s   \         P                  ! . R	OR\        3R\        3.R7      p\        P                  P                  V R4      p\        VR4      ;_uu_ 4       p\        P                  ! W1R
R7       RRR4       \        VR4      ;_uu_ 4       p\        P                  ! V4      pRRR4       \        VX4       \        VR4      ;_uu_ 4       p\        \        4      ;_uu_ 4        \        P                  ! W1RR7       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L@; i  + '       g   i     R# ; i)rE   intu   整形r   zunicode.npyr9   r   Nr:   )rE   r`   r   r   r   )r`   r   )rF   rr   r   r>   rB   rO   r<   r   r"   r$   r   r	   ri   )rR   r&   rj   r'   r(   rC   r   test_unicode_field_namesr     s    
((  
	GMC GGLL/E	eT		a162 
	eT		a  # 
sD! 
eT		a+&&qt4 ' 
	 
			 '& 
		s<   DD'E)D:	ED$	'D7	:E
EE	c                  s   . RO. RO. RO. R	O3 F  w  rp\        \        P                  4       Uu. uF  p^
V,          NK  	  up Fz  p\        4       p\        P                  ! TRV '       d   ^V3MV^3RV R\
        P                  ! RV,          \        3.4      /4       \        VP                  4       4      V8X  d   Kz  Q h	  K  	  R# u upi )
FrL   rM   ry   Z N)Fi      )F      )Tr   r   )Ti   r   )
rb   r   ZGROWTH_AXIS_MAX_DIGITSr    r   rF   r   r   r   r#   )Zis_fortran_arrayZdtype_spaceZexpected_header_lengthrS   r   rT   s         r   test_header_growth_axisr     s    *O_B='= %*&*G*G$HI$HqRUU$HIDB))"&6!TT1I!1C+$5s#;"<=/  r{{}%)???? JB Js   C	ZS3ZsomeZstuff)ZmetadataZsubarrayzPyPy bug in error formattingc                 s   \         P                  ! ^
V R7      p\        4       p\        \        4      ;_uu_ 4        \         P
                  ! W!4       RRR4       TP                  ^ 4       \         P                  ! V4      p^ RIH	p \        W4       V! VP                  4      VP                  Jg   Q hV! VP                  4      VP                  J g   Q hR#   + '       g   i     L; i)i
   r   N)drop_metadata)rF   rG   r    r	   ri   rw   r=   rW   Znumpy.lib._utils_implr   r   r   )r_   r&   Zbufr(   r   rC   r   test_metadata_dtyper     s     ''"B
C
)C	k	"	"
 
#HHQK 773<D3s!#399444$

222 
#	"s   CC'	)i   i2   r,   r   r   r   r   Zyf8r   ZzZu1)r   r   r   )valuec16)Zy2r   ZnameS2)r   )r   r   r   )Zy3r   r   )Zz3Zu4r   )Zz2Zb1)Zcolorr   )ZNameZU8)ZValuer   )r   r   )r   r   i   )r   z<f8r   r   )r\   r   r]   )r`   i   )r`   )i   )r   r   r   )s   NUMPYs   NUMPY  s   NUMPY s   NUMPY s   NUMPYs   NUMPY)s   NUMPY s    NUMPY s   numpy s   MATLB s   NUMPYs   NUMPYr   l        )i   r`   i   )lZ__doc__r>   r   r   Zior    r@   ZnumpyrF   Z	numpy.libr   Znumpy.testingr   r   r   r   r   r   r   r	   Znumpy.testing._private.utilsr
   r   Zint8Zuint16Zint16Zuint32Zint32Zuint64Zint64Zfloat32Zfloat64Z	complex64Z
complex128r4   Zscalarsr/   ZscalarZendianr   Znewbyteorderr   ZastypeZbasicZextendrr   ZreshapeZTZPdescrZPbufferTZNdescrZNbufferTra   r0   r   r*   r+   r-   r.   r3   r5   r8   rD   rI   ZmarkZskipifZslowrV   r[   rz   Zdt2Zdt3Zdt4Zdt5Zdt6Zparametrizerd   Zversion_infoZxfailrk   rv   rx   r   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Zimplementationr   r   r   r   r   <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#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YtAq6# $ 	hh#sYs<=hhTFQJ?@hh#sYtAq68dD\; < 	hhYJ:;S#sC=>" ?" C$$/G7#FG) H H),1^& HHRXXRWW~RXXRXX  $% 	
 HHsBHHgSz'$'!Q(!
     HH    HHsBHH
HHgSz$!Q !% &  	 		
 	 	 

 
 HH	bhhHHHHc
bhh#s(1D$<(1Aq6(2A(7 8 9  	 	   
  	
 ;/  /`#a/`#@2 G$CD E< sDk2! 3!&!(86 +*884C
?
??:2 GO4L)FGI&  '  H 5 ,5.@ HHgSz9rxx!7+8- 0. / 0HHSFG,-HHzC;'(FG3DEHHgSz9rxx3%RXXcB5O4PQR/  	  	 GGG 2 2 : :i G-  /3/	3r   