Ë
    ¡ehÏŸ  ã                   óp  — d Z ddlZddlZddlZddlZddlmZ ddlZddl	m
Z
mZmZmZmZmZmZmZ ddlmZ ddlmZ ej,                  ej.                  ej0                  ej2                  ej4                  ej6                  ej8                  ej:                  ej<                  ej>                  ej@                  ejB                  e"gZ#g Z$e#D ]È  Z%dD ]Á  Z& ejN                  e%«      jQ                  e&«      Z' ejR                  d«      jU                  e'«      Z+e$jY                   ejZ                  g e'¬	«       ejZ                  d
e'¬	«      e+e+j]                  d«      e+j]                  d«      j^                  e+j]                  d«      ddd…ddd…f   g«       ŒÃ ŒÊ g d¢Z0ddgddgddggdfddgddgddggdfgZ1dddddg d¢fddgfdd d!d"gfd#d$gZ2ddgd%dd&d%d'gddgd(dgfd)d*fd+d,ddgddggdfddgd-dd.d-d/gddgdd(gfd0d1fd2d3ddgddggdfgZ3 ejZ                  e1 ejN                  e0«      jQ                  d4«      ¬	«       ejZ                  e3 ejN                  e2«      jQ                  d4«      ¬	«       ejZ                  e1 ejN                  e0«      jQ                  d5«      ¬	«       ejZ                  e3 ejN                  e2«      jQ                  d5«      ¬	«       ejh                  d(d6g¬	«      gZ5 G d7„ d8e«      Z6d9„ Z7d:„ Z8d;„ Z9d<„ Z:d=„ Z;d>„ Z<d?„ Z=d@„ Z>ej~                  j�                  edA¬B«      ej~                  j‚                  dC„ «       «       ZBdD„ ZC ejN                  dEd*¬F«      ZD ejN                  dGdHgdIdIgd(dJgdKœ«      ZE ejN                  dLdMgdIeEgdNœ«      ZF ejN                  g dO¢dIgdz  dNœ«      ZG ejN                  dGdHgdIdIgd(dJgdPdQgdRœ«      ZH ejN                  g g ddSœ«      ZIej~                  j•                  dTeDeEeFeGeHeIg«      dU„ «       ZKej~                  j�                  ej˜                  dVk\  dW¬B«      ej~                  j›                  edX¬B«      dY„ «       «       ZNdZ„ ZOd[„ ZPej~                  j•                  dT ejN                   ejN                  dGej.                  fdHej2                  fdLej6                  fgd*¬F«      d\«       ejN                  d] ejN                  dGdHgd^d^gddgdd_œd\«      d`fg«       ejN                  dag«       ejN                  d] ejN                   ejN                   ejN                  dGdHgd^d^gddgdd_œ«      d\f«      d`f«      fg«       ejN                  dG ejN                   ejN                   ejN                   ejN                  dGeQfdH ejN                  dGdHgd^d^gddgdd_œ«      fg«      d\f«      d`f«      dbf«      fg«      g«      dc„ «       ZRdd„ ZSej~                  j�                  edA¬B«      de„ «       ZTej~                  j•                  dfdgdg«      dh„ «       ZUdi„ ZVdj„ ZWg dk¢ZXg dl¢ZYdm„ ZZdn„ Z[do„ Z\dp„ Z]dq„ Z^dr„ Z_ds„ Z`dt„ Zadu„ Zbej~                  j�                  edv¬B«      ej~                  j�                  e dw¬B«      ej~                  j‚                   edx¬y«      dz„ «       «       «       «       Zcd{„ Zdd|„ Zed}„ Zfej~                  j•                  dT ejN                  dGdHgeg ejN                  d~dd€i¬�«      gdNœ«       ejN                  eQdd€i¬�«       ejN                  d‚eQdƒffgdd€i¬�«       ejN                  dGdHgeg ejN                  dLg ejN                  eQi ¬�«      gdNœ«      gdNœ«      g«      ej~                  j�                  exr ejÐ                  jÒ                  d„k  d…¬B«      d†„ «       «       Zjy)‡a¹D   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)Úassert_Úassert_array_equalÚassert_raisesÚassert_raises_regexÚassert_warnsÚIS_PYPYÚIS_WASMÚIS_64BIT)Úrequires_memory)Úformatz<>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)r9   r6   ù              @Úooy              @ÚOOFÚdd)r=   r;   ú<ú>)Úc©z<f8©é   r   c                   ó    ‡ — e Zd Zdˆ fd„	Zˆ xZS )ÚBytesIOSRandomSizec                 óN   •— dd l }|j                  d|«      }t        ‰| �  |«      S )Nr   r8   )ÚrandomÚrandintÚsuperÚread)ÚselfÚsizerH   Ú	__class__s      €úY/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/numpy/lib/tests/test_format.pyrK   zBytesIOSRandomSize.read‘  s%   ø€ ÛØ�~‰~˜a Ó&ˆÜ‰w‰|˜DÓ!Ð!ó    ©N)Ú__name__Ú
__module__Ú__qualname__rK   Ú__classcell__)rN   s   @rO   rF   rF   �  s   ø„ ÷"ñ "rP   rF   c                 ó¦   — t        «       }t        j                  || «       t        |j                  «       «      }t        j                  |d¬«      }|S )NT©Úallow_pickle©r   r   Úwrite_arrayÚgetvalueÚ
read_array©ÚarrÚfÚf2Úarr2s       rO   Ú	roundtriprb   —  s@   € Ü‹	€AÜ
×Ñ�q˜#ÔÜ	�—‘“Ó	€BÜ×Ñ˜R¨dÔ3€DØ€KrP   c                 ó¢   — t        «       }t        j                  || «       t        |j	                  «       «      }t        j
                  |«      }|S rQ   )r   r   rZ   rF   r[   r\   r]   s       rO   Úroundtrip_randsizerd   Ÿ  s>   € Ü‹	€AÜ
×Ñ�q˜#ÔÜ	˜AŸJ™J›LÓ	)€BÜ×Ñ˜RÓ €DØ€KrP   c                 ó¨   — t        «       }t        j                  || «       t        |j                  «       dd «      }t        j                  |«      }|S )Nr   r   rY   r]   s       rO   Úroundtrip_truncatedrf   §  sE   € Ü‹	€AÜ
×Ñ�q˜#Ôä	�—‘“˜a Ð#Ó	$€BÜ×Ñ˜RÓ €DØ€KrP   c                 ó    — t        | |k(  «       y rQ   )r   )Úo1Úo2s     rO   Úassert_equal_rj   °  s   € ÜˆB�"‰HÕrP   c                  óV   — t         t        z   D ]  } t        | «      }t        | |«       Œ y rQ   )Úbasic_arraysÚrecord_arraysrb   r   ©r^   ra   s     rO   Útest_roundtripro   ´  s)   € ÜœmÑ+ò &ˆÜ˜‹~ˆÜ˜3 Õ%ñ&rP   c                  ó~   — t         t        z   D ]-  } | j                  t        k7  sŒt	        | «      }t        | |«       Œ/ y rQ   )rl   rm   r   Úobjectrd   r   rn   s     rO   Útest_roundtrip_randsizerr   º  s6   € ÜœmÑ+ò *ˆØ�9‰9œÓÜ% cÓ*ˆDÜ˜s DÕ)ñ*rP   c                  ól   — t         D ]+  } | j                  t        k7  sŒt        t        t
        | «       Œ- y rQ   )rl   r   rq   r   Ú
ValueErrorrf   ©r^   s    rO   Útest_roundtrip_truncatedrv   Á  s,   € Üò @ˆØ�9‰9œÓÜœ*Ô&9¸3Õ?ñ@rP   c                  ó´   — t        j                  dt        j                  t        t        j
                  dz   f«      ¬«      } t        | «      }t        | |«       y )Nr8   r   )ÚnpÚonesr   Ústrr   ÚBUFFER_SIZErb   r   )Úlong_str_arrÚlong_str_arr2s     rO   Útest_long_strr~   Ç  s?   € ä—7‘7˜1¤B§H¡H¬c´6×3EÑ3EÈÑ3IÐ-JÓ$KÔL€LÜ˜lÓ+€MÜ�| ]Õ3rP   zmemmap doesn't work correctly)Úreasonc                 ó~  — t        t        t        z   «      D �]  \  }}|j                  j                  rŒt
        j                  j                  | d|› d�«      }t
        j                  j                  | d|› d�«      }t        |d«      5 }t        j                  ||«       d d d «       |j                  j                  xr |j                  j                   }t        j                  |d|j                  |j                  |¬«      }||d<   |j!                  «        t        |d«      5 }|j#                  «       }d d d «       t        |d«      5 }|j#                  «       }	d d d «       t%        	«       t        j                  |d	¬
«      }|j!                  «        �Œ‚ y # 1 sw Y   ŒüxY w# 1 sw Y   ŒqxY w# 1 sw Y   ŒXxY w)NÚnormalz.npyÚmemmapÚwbúw+)Úmoder   ÚshapeÚfortran_order.ÚrbÚr)r…   )Ú	enumeraterl   rm   r   Ú	hasobjectÚosÚpathÚjoinÚopenr   rZ   ÚflagsÚf_contiguousÚc_contiguousÚopen_memmapr†   ÚflushrK   rj   )
ÚtmpdirÚir^   ÚnfnÚmfnÚfpr‡   ÚmaÚnormal_bytesÚmemmap_bytess
             rO   Útest_memmap_roundtripr�   Î  sv  € ô œL¬=Ñ8Ó9ó ‰ˆˆ3Ø�9‰9×Òàä�g‰g�l‰l˜6 V¨A¨3¨dÐ#3Ó4ˆÜ�g‰g�l‰l˜6 V¨A¨3¨dÐ#3Ó4ˆÜ�#�t‹_ð 	( Ü×Ñ˜r 3Ô'÷	(ð �I‰I×"Ñ"ÒA¨3¯9©9×+AÑ+AÐ'Að 	ä×Ñ ¨$°c·i±iØ&)§i¡i¸}ôNˆàˆˆ3‰Ø
�‰Œ
ô �#�t‹_ð 	% ØŸ7™7›9ˆL÷	%ä�#�t‹_ð 	% ØŸ7™7›9ˆL÷	%ä�l LÔ1ô ×Ñ ¨#Ô.ˆØ
�‰Ž
ñ5÷	(ð 	(ú÷	%ð 	%ú÷	%ð 	%ús$   Â	FÄ&F'ÅF3ÆF$	Æ'F0	Æ3F<	c                 ó(  — t         j                  j                  dd«      }t        j                  j                  | d«      }t        j                  ||¬«       t        j                  |«      5 }|d   }d d d «       t        |«       y # 1 sw Y   ŒxY w)NéÈ   zcompressed.npzru   r^   )	rx   rH   ÚrandrŒ   r�   rŽ   Úsavez_compressedÚloadr   )r•   r^   Únpz_fileÚnpzÚarr1s        rO   Útest_compressed_roundtripr¦   î  sq   € Ü
�)‰)�.‰.˜˜cÓ
"€CÜ�w‰w�|‰|˜FÐ$4Ó5€HÜ×Ñ˜ cÕ*Ü	�‰�Ó	ð ˜cØ�5‰zˆ÷ä�s˜DÕ!÷ð ús   Á-BÂBz
i1, i4, i1)ÚalignÚaÚbr   é   )ÚnamesÚformatsÚoffsetsrA   Úd)r«   r¬   )r¨   Ú r©   ÚaaÚbb)r«   r¬   r­   Útitles)r«   r¬   ÚitemsizeÚdtc                 óD  — t        j                  d|«      }t        d«      D ]
  }|dz   ||<   Œ t        j                  j                  | d«      }t        j                  ||¬«       t        j                  |«      5 }|d   }d d d «       t        |«       y # 1 sw Y   ŒxY w)Nr    rD   zaligned.npzru   r^   )	rx   ÚzerosÚrangerŒ   r�   rŽ   Úsavezr¢   r   )r•   r´   r^   r–   r£   r¤   r¥   s          rO   Útest_load_padded_dtyper¹     s‰   € ä
�(‰(�1�b‹/€CÜ�1‹Xò ˆØ�Q‘ˆˆAŠðä�w‰w�|‰|˜F MÓ2€HÜ‡H�HˆX˜3ÕÜ	�‰�Ó	ð ˜cØ�5‰zˆ÷ä�s˜DÕ!÷ð ús   Á;BÂB)r    é   zsee gh-23988z!Emscripten NODEFS has a buggy dupc                  óT  — d} t         j                  j                  t         j                  j                  t        «      d| «      }t        j                  t        d¬«      5  t        j                  |«      }d d d «       t        t        j                  d«      «       y # 1 sw Y   Œ)xY w)Nzwin64python2.npyÚdatazReading.*this warning\.©Úmatchr   )rŒ   r�   rŽ   ÚdirnameÚ__file__ÚpytestÚwarnsÚUserWarningrx   r¢   r   ry   )Úfnamer�   r¼   s      rO   Ú%test_python2_python3_interoperabilityrÅ     so   € ð €EÜ�7‰7�<‰<œŸ™Ÿ™¬Ó1°6¸5ÓA€DÜ	�‰”kÐ)CÔ	Dñ Ü�w‰w�t‹}ˆ÷ä�tœRŸW™W Q›ZÕ(÷ð ús   Á BÂB'c            	      óª  — t         j                  j                  t         j                  j                  t        «      d«      } t        j                  d t        ddgt        ¬«      }dD �]é  }t         j                  j                  | |«      }dD ]Ñ  }t        j                  |d|¬«      }|j                  d	«      r|d
   }|j                  «        n|}|dk(  ra|j                  d«      rPt        t        |d   t        «      «       t!        |d d |d d «       t!        |d   j#                  |«      |d   «       Œªt        t        |d   t$        «      «       t!        ||«       ŒÓ |j                  d«      s�Œ|j                  d	«      rˆt        j                  |d¬«      }t'        t(        |j*                  d
«       |j                  «        t        j                  |ddd¬«      }t'        t,        |j*                  d
«       |j                  «        �Œ¦t'        t(        t
        j                  |d¬«       t'        t,        t
        j                  |ddd¬«       �Œì y )Nr¼   u   å„ªè‰¯s   ä¸�è‰¯r   )zpy2-np0-objarr.npyúpy2-objarr.npyúpy2-objarr.npzzpy3-objarr.npyzpy3-objarr.npz)ÚbytesÚlatin1T©rX   Úencodingz.npzr   rÊ   Úpy2r    r   rW   F)rX   Úfix_importsrÌ   )rŒ   r�   rŽ   r¿   rÀ   rx   Úarrayr·   rq   r¢   ÚendswithÚcloseÚ
startswithr   Ú
isinstancerz   r   ÚencoderÉ   r   ÚUnicodeErrorÚ__getitem__ÚImportError)Údata_dirÚexpectedrÄ   r�   rÌ   Údata_fr¼   s          rO   Útest_pickle_python2_python3rÛ     sÌ  € ô �w‰w�|‰|œBŸG™GŸO™O¬HÓ5°vÓ>€Hä�x‰x˜œu nØ4ð6ä$ô&€Hð6ó #1ˆä�w‰w�|‰|˜H eÓ,ˆà+ò 	3ˆHÜ—W‘W˜T°¸xÔHˆFØ�~‰~˜fÔ%Ø˜c‘{�Ø—‘•à�à˜8Ò#¨×(8Ñ(8¸Ô(?Üœ
 4¨¡7¬CÓ0Ô1Ü" 4¨¨ 9¨h°s¸¨mÔ<ä" 4¨¡8§?¡?°8Ó#<¸hÀr¹lÕKäœ
 4¨¡7¬EÓ2Ô3Ü" 4¨Õ2ð	3ð" ×Ñ˜EÖ"Ø�~‰~˜fÔ%Ü—w‘w˜t°$Ô7�Üœl¨D×,<Ñ,<¸cÔBØ—
‘
”Ü—w‘w˜t°$ÀEØ(0ô2�äœk¨4×+;Ñ+;¸SÔAØ—
‘
–äœl¬B¯G©G°TØ+/õ1äœk¬2¯7©7°DØ+/¸UØ'/÷1ñC#1rP   c           	      ó’  — t         j                  j                  t         j                  j                  t        «      d«      }t         j                  j                  |d«      }t        t        t        j                  |dd¬«       t         j                  j                  |d«      }t        j                  |dd¬«      5 }t        t        |j                  d«       d d d «       t         j                  j                  | d«      }t        t        t        j                  |t        j                  d gt        ¬	«      d¬
«       y # 1 sw Y   ŒfxY w)Nr¼   rÇ   FrÊ   rË   rÈ   r   zpickle-disabled.npyr   rW   )rŒ   r�   rŽ   r¿   rÀ   r   rt   rx   r¢   rÖ   ÚsaverÏ   rq   )r•   rØ   r�   r_   s       rO   Útest_pickle_disallowrÞ   K  sØ   € Ü�w‰w�|‰|œBŸG™GŸO™O¬HÓ5°vÓ>€Hä�7‰7�<‰<˜Ð"2Ó3€DÜ”*œbŸg™g tØ$¨xõ9ô �7‰7�<‰<˜Ð"2Ó3€DÜ	�‰� E°HÔ	=ð 6ÀÜ”j !§-¡-°Ô5÷6ô �7‰7�<‰<˜Ð 5Ó6€DÜ”*œbŸg™g t¬R¯X©X°t°fÄFÔ-KØ$ö&÷	6ð 6ús   Â<D=Ä=E)r    r   Úi1)r«   r¬   r­   r³   )r"   )r   rB   r   rC   c                 ó´   — t        j                  | j                  «      }t        || «       t	        j
                  d| «      }t        |«      }t        ||«       y )Nr    )r   Údescr_to_dtypeÚdescrrj   rx   r¶   rb   r   )r´   Údt1r¥   ra   s       rO   Útest_descr_to_dtyperä   Z  sE   € ôd ×
Ñ
 §¡Ó
)€CÜ�#�rÔÜ�8‰8�A�r‹?€DÜ�T‹?€DÜ�t˜TÕ"rP   c                  óø  — t        «       } t        d«      D �cg c]  }d|z  dz  t        f‘Œ }}t        j                  d|¬«      }t        j                  | |d¬«       t        j                  d¬	«      5 }t        j                  d
dt        «       t        j                  | |«       t        |d   j                  t        u «       d d d «       | j                  d«       | j                  «       }t        t        |«      t
        j                   z  dk(  «       | j                  d«       t        j"                  | d¬«      }t%        ||«       t'        t(        t
        j                  | |d«       y c c}w # 1 sw Y   Œ­xY w)Néô  ú%déd   éè  r   ©r   r   ©ÚversionT©ÚrecordÚalwaysr¯   r   é@ ©Úmax_header_size©r8   r   )r   r·   Úfloatrx   ry   r   rZ   ÚwarningsÚcatch_warningsÚfilterwarningsrÃ   r   ÚcategoryÚseekÚreadlineÚlenÚARRAY_ALIGNr\   r   r   rt   )r_   r–   r´   r®   ÚwÚheaderÚns          rO   Útest_version_2_0r   ’  s$  € Ü‹	€Aä-2°3«ZÖ	8¨ˆD�1‰H˜ÑœUÒ
#Ð	8€BÐ	8Ü
�‰�˜BÔ€Aä
×Ñ�q˜! VÕ,Ü	×	 Ñ	 ¨Ô	-ð .°Ü×Ñ ¨"¬kÔ:Ü×Ñ˜1˜aÔ Ü��!‘—‘¤Ð,Ô-÷.ð ‡F�Fˆ1„IØ�Z‰Z‹\€FÜŒC�‹Kœ&×,Ñ,Ñ,°Ñ1Ô2à‡F�Fˆ1„IÜ×Ñ˜!¨VÔ4€AÜ�q˜!Ôô ”*œf×0Ñ0°!°Q¸Õ?ùò' 
9÷.ð .ús   ˜E+Á4AE0Å0E9c           	      óØ  — t        d«      D �cg c]  }d|z  dz  t        f‘Œ }}t        j                  d|¬«      }t        j
                  j                  | d«      }t        j
                  j                  | d«      }t        t        t        j                  |d|j                  |j                  d	¬
«       t        j                  |d|j                  |j                  d¬
«      }||d<   |j                  «        t        j                  |dd¬«      }t        ||«       t        j                   d¬«      5 }t        j"                  ddt$        «       t        j                  |d|j                  |j                  d ¬
«      }t'        |d   j(                  t$        u «       ||d<   |j                  «        d d d «       t        j                  |dd¬«      }t        ||«       y c c}w # 1 sw Y   Œ3xY w)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ô   rx   ry   rŒ   r�   rŽ   r   rt   r   r“   r   r†   r”   r   rõ   rö   r÷   rÃ   r   rø   )r•   r–   r´   r®   Útf1Útf2rš   rý   s           rO   Útest_version_2_0_memmapr  «  s…  € ô .3°3«ZÖ	8¨ˆD�1‰H˜ÑœUÒ
#Ð	8€BÐ	8Ü
�‰�˜BÔ€AÜ
�'‰'�,‰,�vÐ0Ó
1€CÜ
�'‰'�,‰,�vÐ0Ó
1€Cô ”*œf×0Ñ0°#¸DÈÏÉØ"#§'¡'°6õ;ô 
×	Ñ	˜C d°!·'±'Ø"#§'¡'°6ô
;€Bà€B€s�GØ‡H�H„JÜ	×	Ñ	˜C c¸6Ô	B€BÜ�r˜1Ôä	×	 Ñ	 ¨Ô	-ð °Ü×Ñ ¨"¬kÔ:Ü×Ñ ¨$°a·g±gØ&'§g¡g°tô=ˆä��!‘—‘¤Ð,Ô-Øˆˆ3‰Ø
�‰Œ
÷ô 
×	Ñ	˜C c¸6Ô	B€Bä�r˜1Õùò5 
9÷ ð ús   ŽGÄ1A=G Ç G)Ú	mmap_moder‰   c                 ó¸  — t         j                  j                  | d«      }t        j                  dddz  dz   ¬«      }t        j                  t        d¬«      5  t        j                  ||«       d d d «       t        j                  t        d	¬«      5  t        j                  ||¬
«       d d d «       t        j                  t        d	¬«      5  t        j                  ||d¬«       d d d «       t        j                  ||d¬«      }t        ||«       t        j                  ||d¬«      }t        ||«       y # 1 sw Y   ŒÉxY w# 1 sw Y   ŒšxY w# 1 sw Y   ŒjxY w)Nzlarge_header.npyr8   úi,é'  r–   r   ú.*format 2.0r½   úHeader.*large)r  é N  )r  rò   T)r  rX   é ¿ )rŒ   r�   rŽ   rx   rÏ   rÁ   rÂ   rÃ   rÝ   Úraisesrt   r¢   r   )r•   r  r_   r^   Úress        rO   Útest_huge_headerr  Ê  s  € ä
�‰�‰�VÐ/Ó0€AÜ
�(‰(�1˜D ™J s™NÔ
+€Cä	�‰”k¨Ô	8ñ Ü
�‰��3Œ÷ô 
�‰”z¨Ô	9ñ (Ü
�‰�˜YÕ'÷(ô 
�‰”z¨Ô	9ñ ?Ü
�‰�˜Y¸Õ>÷?ô �'‰'�!˜y°tÔ
<€CÜ�s˜CÔ ä
�'‰'�!˜y¸&Ô
A€CÜ�s˜CÕ ÷ð ú÷(ð (ú÷?ð ?ús$   ÁD8ÂEÃEÄ8EÅEÅEc                 óÈ  — t         j                  j                  | d«      }t        j                  dddz  dz   ¬«      }t        j                  t        d¬«      5  t        j                  ||¬	«       d d d «       t        j                  t        d
¬«      5  t        j                  |«      d    d d d «       t        j                  t        d
¬«      5  t        j                  |d¬«      d    d d d «       t        j                  |d¬«      d   }t        ||«       t        j                  |d¬«      d   }t        ||«       y # 1 sw Y   ŒÐxY w# 1 sw Y   Œ xY w# 1 sw Y   ŒnxY w)Nzlarge_header.npzr8   r  r  r–   r   r	  r½   ru   r
  r^   r  rñ   TrW   r  )rŒ   r�   rŽ   rx   rÏ   rÁ   rÂ   rÃ   r¸   r  rt   r¢   r   )r•   r_   r^   r  s       rO   Útest_huge_header_npzr  Þ  s  € Ü
�‰�‰�VÐ/Ó0€AÜ
�(‰(�1˜D ™J s™NÔ
+€Cä	�‰”k¨Ô	8ñ Ü
�‰�˜Õ÷ô 
�‰”z¨Ô	9ñ Ü
�‰�‹
�5Ò÷ô 
�‰”z¨Ô	9ñ 1Ü
�‰� 5Ô)¨%Ò0÷1ô �'‰'�! $Ô
'¨Ñ
.€CÜ�s˜CÔ ä
�'‰'�! VÔ
,¨UÑ
3€CÜ�s˜CÕ ÷ð ú÷ð ú÷1ð 1ús$   ÁE ÂEÃEÅ E	ÅEÅE!c                  óæ  — t        «       } t        j                  d«      }t        j                  | |d¬«       t        j                  | |«       t        j                  | |d ¬«       t        j                  | |«       t        j                  | |d¬«       t        j                  | |«       g d¢}|D ]3  }t        t        d«      5  t        j                  | ||¬«       d d d «       Œ5 y # 1 sw Y   Œ@xY w)Nr8   ró   rë   rê   ))r8   r8   )r   r   )r   r8   r   )éÿ   r  z we only support format version.*)r   rx   Úaranger   rZ   r   rt   )r_   r^   Úbad_versionsrì   s       rO   Útest_write_versionr  ò  sÎ   € Ü‹	€AÜ
�)‰)�A‹,€Cä
×Ñ�q˜# vÕ.Ü
×Ñ�q˜#Ôä
×Ñ�q˜# tÕ,Ü
×Ñ�q˜#Ôä
×Ñ�q˜# vÕ.Ü
×Ñ�q˜#Ôò€Lð  ò 8ˆÜ ¤Ø!CóEñ 	8ä×Ñ˜q #¨wÕ7÷	8ð 	8ñ8÷	8ð 	8ús   ÃC'Ã'C0	)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                  ó:  — t        «       } t        «       }t        j                  dt        ¬«      }t	        j
                  | |d¬«       t	        j
                  ||d¬«       | j                  d«       |j                  d«       t	        j                  | «      }t	        j                  |«      }t        |dk(  «       t        |dk(  «       t        | j                  «       t        j                  k(  «       t        |j                  «       t        j                  k(  «       y )N©r    rª   r   ró   rë   rê   r   )r   rx   ry   rô   r   rZ   rù   Ú
read_magicr   ÚtellÚ	MAGIC_LEN)Ús1Ús2r^   Úversion1Úversion2s        rO   Útest_read_magicr     sÆ   € Ü	‹€BÜ	‹€Bä
�'‰'�&¤Ô
&€Cä
×Ñ�r˜3¨Õ/Ü
×Ñ�r˜3¨Õ/à‡G�GˆA„JØ‡G�GˆA„Jä× Ñ  Ó$€HÜ× Ñ  Ó$€HäˆH˜ÑÔÜˆH˜ÑÔäˆB�G‰G‹Iœ×)Ñ)Ñ)Ô*ÜˆB�G‰G‹Iœ×)Ñ)Ñ)Õ*rP   c                  ón   — t         D ],  } t        | «      }t        t        t        j
                  |«       Œ. y rQ   )Úmalformed_magicr   r   rt   r   r\   ©Úmagicr_   s     rO   Útest_read_magic_bad_magicr%  4  s,   € Ü ò 8ˆÜ�E‹NˆÜ”j¤&×"3Ñ"3°QÕ7ñ8rP   c                  ó|   — t         t        z   D ],  } t        | «      }t        t        t
        j                  |«       Œ. y rQ   )Úbad_version_magicr"  r   r   rt   r   r\   r#  s     rO   Útest_read_version_1_0_bad_magicr(  :  s1   € Ü"¤_Ñ4ò 8ˆÜ�E‹NˆÜ”j¤&×"3Ñ"3°QÕ7ñ8rP   c                  ó  — t        t        t        j                  dd«       t        t        t        j                  dd«       t        t        t        j                  dd«       t        t        t        j                  dd«       y )Nr   r8   é   )r   rt   r   r$  © rP   rO   Útest_bad_magic_argsr,  @  sJ   € Ü”*œfŸl™l¨B°Ô2Ü”*œfŸl™l¨C°Ô3Ü”*œfŸl™l¨A¨rÔ2Ü”*œfŸl™l¨A¨sÕ3rP   c                  óÊ   — t        «       } t        «       dddœ}t        j                  | |«       t        «       } ddz  dfg|d<   t	        t
        t        j                  | |«       y )NFz<i8©r†   r‡   râ   Á   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxr*  râ   )r   Útupler   Úwrite_array_header_1_0r   rt   ©Úsr®   s     rO   Útest_large_headerr4  G  sW   € Ü‹	€AÜ“'¨E¸EÑB€AÜ
×!Ñ! ! QÔ'ä‹	€AØ˜3‘; Ð&Ð'€A€g�JÜ”*œf×;Ñ;¸QÀÕBrP   c                  óx  — t        «       } t        j                  dt        ¬«      }t	        j
                  | |d¬«       | j                  t        j                  «       t	        j                  | «      \  }}}t        | j                  «       t        j                  z  dk(  «       t        |||fddt        fk(  «       y )Nr  r   ró   rë   r   F)r   rx   ry   rô   r   rZ   rù   r  Úread_array_header_1_0r   r  rü   ©r3  r^   r†   Úfortranr   s        rO   Útest_read_array_header_1_0r9  Q  ó�   € Ü‹	€Aä
�'‰'�&¤Ô
&€CÜ
×Ñ�q˜# vÕ.à‡F�FŒ6×ÑÔÜ"×8Ñ8¸Ó;Ñ€Eˆ7�EäˆA�F‰F‹H”v×)Ñ)Ñ)¨QÑ.Ô/ÜˆU�G˜UÐ#¨°´uÐ'=Ñ=Õ>rP   c                  óx  — t        «       } t        j                  dt        ¬«      }t	        j
                  | |d¬«       | j                  t        j                  «       t	        j                  | «      \  }}}t        | j                  «       t        j                  z  dk(  «       t        |||fddt        fk(  «       y )Nr  r   rê   rë   r   F)r   rx   ry   rô   r   rZ   rù   r  Úread_array_header_2_0r   r  rü   r7  s        rO   Útest_read_array_header_2_0r=  ^  r:  rP   c                  óÞ  — t        «       } t        t        t        j                  | «       t        d«      } t        t        t        j                  | «       t        d«      } t        t        t        j                  | «       t        d«      } t        t        t        j                  | «       dddddœ}t        «       } t        j
                  | |«       t        t        t        j                  | «       y )	Nó   1s    s@   “NUMPY 6 {'descr': 'x', 'shape': (1, 2), }                    
©r8   r   Fr   r   )r†   r‡   râ   Úextrakey)r   r   rt   r   r6  r1  r2  s     rO   Útest_bad_headerrB  k  s·   € ä‹	€AÜ”*œf×:Ñ:¸AÔ>Ü�‹€AÜ”*œf×:Ñ:¸AÔ>ô 	�Ó€AÜ”*œf×:Ñ:¸AÔ>ô
 	ð	"ó	€Aô ”*œf×:Ñ:¸AÔ>àØØØñ	€Aô 	‹	€AÜ
×!Ñ! ! QÔ'Ü”*œf×:Ñ:¸AÕ>rP   c                 ó–  — t         j                  dk(  st         j                  dk(  rt        j                  d«       t        j
                  j                  | d«      }	 dd l}|j                  ddd|g«       t        |d
«      5 }|j                  d«       t        j                  d«      }t        j                  ||«       d d d «       t        |d«      5 }|j                  d«       t        j                  |«      }d d d «       t!        «       y # t        $ r t        j                  d	«       Y Œ¹w xY w# 1 sw Y   ŒuxY w# 1 sw Y   ŒFxY w)NÚwin32Úcygwinz)Unknown if Windows has sparse filesystemsÚsparse_filer   Útruncatez-sÚ
5368709120zCould not create 5GB large filerƒ   l        rD   rˆ   )ÚsysÚplatformrÁ   ÚskiprŒ   r�   rŽ   Ú
subprocessÚ
check_callÚ	Exceptionr�   rù   rx   r  rÝ   r¢   r   )r•   Útf_nameÚspr_   r®   r‰   s         rO   Útest_large_file_supportrQ  ˆ  s  € Ü�‰˜Ò¤3§<¡<°8Ò#;Ü�‰Ð?Ô@ä�g‰g�l‰l˜6 =Ó1€Gð7ó 	 Ø
�‰�z 4¨°wÐ?Ô@ô 
ˆg�tÓ	ð  Ø	�‰ˆzÔÜ�I‰I�a‹LˆÜ
�‰��1Œ÷ô
 
ˆg�tÓ	ð  Ø	�‰ˆzÔÜ�G‰G�A‹Jˆ÷ô �q˜!Õøô ò 7Ü�‰Ð5Ö6ð7ú÷ð ú÷
ð ús*   ÁD Â=D3Ã'D?ÄD0Ä/D0Ä3D<Ä?Ezflaky on PyPyztest requires 64-bit systeml        )Ú
free_bytesc                 óâ  — d}	 t        j                  |t         j                  ¬«      }t        j                  j                  | d«      }t        |d«      5 }t        j                  |¬«       d d d «       ~t        |d«      5 }t        j                  |«      d   }d d d «       j                  |k(  sJ ‚y # t        $ r t	        j
                  d«       Y Œ¬w xY w# 1 sw Y   ŒmxY w# 1 sw Y   ŒKxY w)	N)i   @r   r   zCould not create large fileÚlarge_archiverƒ   ru   rˆ   r^   )rx   ÚemptyÚuint8ÚMemoryErrorrÁ   rK  rŒ   r�   rŽ   r�   r¸   r¢   r†   )r•   r†   r¨   rÄ   r_   Únew_as         rO   Útest_large_archiverY  ¡  sÑ   € ð €Eð3Ü�H‰H�U¤"§(¡(Ô+ˆô �G‰G�L‰L˜ Ó1€Eä	ˆe�TÓ	ð ˜aÜ
�‰�˜Õ÷ð 	
ä	ˆe�TÓ	ð "˜aÜ—‘˜“
˜5Ñ!ˆ÷"ð �;‰;˜%ÒÐÑøô ò 3Ü�‰Ð1Ö2ð3ú÷
ð ú÷
"ð "ús)   „%B5 ÁCÂC%Â5CÃCÃC"Ã%C.c                 óÄ   — t         j                  j                  | d«      }t        j                  |«       t        j
                  |«      5 }	 d d d «       y # 1 sw Y   y xY w)Nznothing.npz)rŒ   r�   rŽ   rx   r¸   r¢   )r•   rÄ   Únpss      rO   Útest_empty_npzr\  »  sF   € ä�G‰G�L‰L˜ Ó/€EÜ‡H�HˆU„OÜ	�‰�‹ð ˜3Ø÷÷ ñ ús   ÁAÁAc                 óB  — t        j                  g d¢dt        fdt        fg¬«      }t        j                  j                  | d«      }t        |d«      5 }t        j                  ||d¬«       d d d «       t        |d	«      5 }t        j                  |«      }d d d «       t        |«       t        |d«      5 }t        t        «      5  t        j                  ||d ¬«       d d d «       d d d «       y # 1 sw Y   Œ…xY w# 1 sw Y   ŒgxY w# 1 sw Y   Œ*xY w# 1 sw Y   y xY w)
N)©r8   r    r@  r^  r@  Úintu   æ•´å½¢r   zunicode.npyrƒ   )r    r   rë   rˆ   )rx   rÏ   r_  rŒ   r�   rŽ   r�   r   rZ   r\   r   r   rÃ   )r•   r^   rÄ   r_   ra   s        rO   Útest_unicode_field_namesr`  Ã  s  € ä
�(‰(ò ð 
”ˆØ	GÌÐMðô€Cô �G‰G�L‰L˜ Ó/€EÜ	ˆe�TÓ	ð 3˜aÜ×Ñ˜1˜c¨6Õ2÷3ä	ˆe�TÓ	ð $˜aÜ× Ñ  Ó#ˆ÷$ä�s˜DÔ!ô 
ˆe�TÓ	ð 5˜aÜœ+Ó&ñ 	5Ü×Ñ˜q #¨tÕ4÷	5÷5ð 5÷3ð 3ú÷$ð $ú÷	5ð 	5ú÷5ð 5ús<   ÁC1ÂC=Â7DÃD	Ã DÃ1C:Ã=DÄ	D	ÄDÄDc                  óh  — g d¢g d¢g d¢g d¢fD ]œ  \  } }}t        t        j                  «      D �cg c]  }d|z  ‘Œ	 c}D ]i  }t        «       }t        j                  || rd|fn|df| t        j                  d|z  t        fg«      dœ«       t        |j                  «       «      |k(  rŒiJ ‚ Œž y c c}w )	N)Fé   é€   )Fé   éÀ   )Trd  rc  )Té   re  r   r   ú r.  )
r·   r   ÚGROWTH_AXIS_MAX_DIGITSr   r1  rx   r   r_  rû   r[   )Úis_fortran_arrayÚdtype_spaceÚexpected_header_lengthr–   rM   r™   s         rO   Útest_header_growth_axisrl  Ú  s¾   € âÒ*ªOº_ðBò @Ñ=Ð˜+Ð'=ô %*¬&×*GÑ*GÓ$HÖI˜q�R˜“UÒIò 	@ˆDÜ“ˆBÜ×)Ñ)¨"Ù&6˜!˜T™¸TÀ1¸IØ!1ÜŸ™ C¨¡O´SÐ#9Ð":Ó;ñ/ô ô �r—{‘{“}Ó%Ð)?Ó?Ð?Ð?ñ	@ñ@ùò Js   ±B/ÚS3ÚsomeÚstuff)ÚmetadataÚsubarrayr   )é   r    r!   zPyPy bug in error formattingc                 óª  — t        j                  d| ¬«      }t        «       }t        t        «      5  t        j
                  ||«       d d d «       |j                  d«       t        j                  |«      }ddlm	} t        ||«        ||j                  «      |j                  usJ ‚ ||j                  «      |j                  u sJ ‚y # 1 sw Y   Œ‚xY w)Nr   r   r   )Údrop_metadata)rx   ry   r   r   rÃ   rÝ   rù   r¢   Únumpy.lib._utils_implrt  r   r   )r´   r^   Úbufra   rt  s        rO   Útest_metadata_dtyperw  è  s£   € ô �'‰'�"˜BÔ
€CÜ
‹)€CÜ	”kÓ	"ñ Ü
�‰��SÔ÷à‡H�HˆQ„Kô �7‰7�3‹<€Då3Ü�s˜DÔ!Ù˜Ÿ™Ó#¨3¯9©9Ñ4Ð4Ð4Ù˜Ÿ™Ó$¨¯
©
Ñ2Ð2Ñ2÷ð ús   ±C	Ã	C)kÚ__doc__rI  rŒ   rõ   rÁ   Úior   Únumpyrx   Únumpy.testingr   r   r   r   r   r	   r
   r   Únumpy.testing._private.utilsr   Ú	numpy.libr   rV  Úint8Úuint16Úint16Úuint32Úint32Úuint64Úint64Úfloat32Úfloat64Ú	complex64Ú
complex128rq   Úscalarsrl   ÚscalarÚendianr   Únewbyteorderr  ÚastypeÚbasicÚextendrÏ   ÚreshapeÚTÚPdescrÚPbufferTÚNdescrÚNbufferTr¶   rm   rF   rb   rd   rf   rj   ro   rr   rv   r~   ÚmarkÚskipifÚslowr�   r¦   rã   Údt2Údt3Údt4Údt5Údt6Úparametrizer¹   Úversion_infoÚxfailrÅ   rÛ   rÞ   r_  rä   r   r  r  r  r  r'  r"  r   r%  r(  r,  r4  r9  r=  rB  rQ  rY  r\  r`  rl  rô   Úimplementationrì   rw  r+  rP   rO   ú<module>r¢     s2	  ðñRóf Û 	Û Û Ý ã ÷÷ ó õ 9Ý ð
 ‡H�HØ‡G�GØ‡I�IØ‡H�HØ‡I�IØ‡H�HØ‡I�IØ‡H�HØ‡J�JØ‡J�JØ‡L�LØ‡M�MØ
ð€ð €Øò €FØò ˆØ�—‘˜Ó ×-Ñ-¨fÓ5ˆØ�—	‘	˜$“×&Ñ& uÓ-ˆØ×ÑàˆB�H‰H�R˜uÔ%àˆB�H‰H�R˜uÔ%àà�M‰M˜(Ó#à�M‰M˜(Ó#×%Ñ%à�M‰M˜(Ó#¡D b D©#¨A¨# IÑ.ð
õ 	ñðò6
€ð ˆ€Vˆr�2ˆh˜˜R˜Ð! 1Ð%Øˆ€Vˆr�2ˆh˜˜R˜Ð! 1Ð%ð€ð( ØØØØ	ò  ð 	!ð
 	Øð	ð 	ð ØØØðð ð Øð#
€ð. ˆ€Vˆb�"�t˜b "˜X¨¨B x°!°Q°Ð8¸$ÀÐEØ	ˆ:˜˜R˜ 2 r (Ð+¨Qð0àˆ€Vˆb�"�t˜b "˜X¨¨B x°!°Q°Ð8¸$ÀÐFØ	ˆ:˜˜R˜ 2 r (Ð+¨Qð0ð€ð €B‡H�HˆX˜X˜RŸX™X fÓ-×:Ñ:¸3Ó?Ô@Ø€B‡H�HˆX˜X˜RŸX™X fÓ-×:Ñ:¸3Ó?Ô@Ø€B‡H�HˆX˜X˜RŸX™X fÓ-×:Ñ:¸3Ó?Ô@Ø€B‡H�HˆX˜X˜RŸX™X fÓ-×:Ñ:¸3Ó?Ô@Ø€B‡H�HˆQÐ1Ð2Ô3ð€ô"˜ô "òòòòò&ò*ò@ò4ð ‡�×Ñ�GÐ$CÐÓDØ‡�×Ññó ó Eðò<"ð €b‡h�hˆ| 4Ô(€à€b‡h�h˜#˜s˜°°t°Ø˜q˜6ñ#ó $€ð €b‡h�h˜#˜s˜°°s°Ñ<Ó=€à€b‡h�hš°T°F¸1±HÑ=Ó>€à€b‡h�h˜#˜s˜°°t°Ø˜q˜6¨d°D¨\ñ;ó <€ð €b‡h�h˜¨¸Ñ:Ó;€à‡�×Ñ˜  S¨#¨s°C¸Ð=Ó>ñ"ó ?ð"ð ‡�×Ñ�C×$Ñ$¨Ñ/¸ÐÓGØ‡�×Ñ�7Ð#FÐÓGñ)ó Hó Hð)ò,1ò^&ð ‡�×Ñ˜Ø€B‡H�HˆXˆR�X‰X˜˜RŸW™W�~Ø˜RŸX™X�Ø˜RŸX™X�ðð  $ô%ð ó	ð
 €B‡H�Hˆs�H�B—H‘H s¨3 iØ)-¨d¨Ø)*¨1¨Ø)*ñð
 óð ðð ó ð €B‡H�Hð ð ó ð €B‡H�Hˆs�H�B—H‘HØˆ�‰ØˆB�H‰H˜s 3˜iØ!% d Ø!" 1 Ø!"ñ$ó %ð ðó 	ð 	ð	
ó 	ð 	ð 

ó 
ð €B‡H�HØ	ˆhˆb�h‰hØˆB�H‰HØ�—‘Ø�B—H‘HØ˜c˜
Ø˜h˜bŸh™h°°S°	Ø37¸°+Ø34°Q°%Ø34ñ(6ó 7ð 8ðó ð ð	ó 	ð ðó ð ð
ó ð 	ð
ó ð;/ ó /ñb#óc/ðb#ò@ð2 ‡�×Ñ�GÐ$CÐÓDñó Eðð< ‡�×Ñ˜ s¨D kÓ2ñ!ó 3ð!ò&!ò(8ò6Ð ò€ò+ò*8ò8ò4òCò
?ò
?ò?ò:ð2 ‡�×Ñ�G OÐÓ4Ø‡�×Ñ˜�LÐ)FÐÓGØ‡�×ÑÙ˜IÔ&ñ ó 'ó ó Hó 5ð ò,ò5ò.@ð ‡�×Ñ˜Ø€B‡H�H˜˜S�z°°x°r·x±xÀØ! 7Ð+ô8-ð 0.ñ /ó 0à€B‡H�HˆS˜F GÐ,Ô-Ø€B‡H�Hˆz˜C ˜;Ð'Ð(°F¸GÐ3DÔEà€B‡H�H˜˜S�zØˆxˆr�x‰x 3 %°X°R·X±X¸cÈBÔ5OÐ4PÑQÓRð/ñ ó ð	 ó 	ð ‡�×Ñ�GÒG × 2Ñ 2× :Ñ :¸iÑ GØ-ð ó /ñ3ó/ó	ñ3rP   