code: def pack_unpack(xs, pattern):
      x, ps = pack(xs, pattern)
      unpacked = unpack(xs, ps, pattern)
      assert len(unpacked) == len(xs)
      for a, b in zip(unpacked, xs):
          assert np.allclose(asnumpy(a), asnumpy(b))
  
file_path: einops/tests/test_packing.py
imports: import dataclasses
  import typing
  import numpy
  import pytest
  from einops import EinopsError, asnumpy, pack, unpack
  from tests import collect_test_backends
label_desc: Use image node_id 1 for calling a global function with example usage: pack_unpack(xs, pattern) without return types