code: def test_string(self):
      a = named_array.NamedNumpyArray(
          [1, 3, 6], ["a", "b", "c"], dtype=np.int32
      )
      self.assertEqual(str(a), "[1 3 6]")
      self.assertEqual(
          repr(a),
          (
              "NamedNumpyArray([1, 3, 6], ['a', 'b', 'c'], "
              "dtype=int32)"
          ),
      )
  
      a = named_array.NamedNumpyArray(
          [[1, 3], [6, 8]], [None, ["a", "b"]]
      )
      self.assertEqual(str(a), "[[1 3]\n [6 8]]")
      self.assertEqual(
          repr(a),
          (
              "NamedNumpyArray([[1, 3],\n"
              "                 [6, 8]], [None, ['a', 'b']])"
          ),
      )
  
      a = named_array.NamedNumpyArray(
          [[1, 3], [6, 8]], [["a", "b"], None]
      )
      self.assertEqual(str(a), "[[1 3]\n [6 8]]")
      self.assertEqual(
          repr(a),
          (
              "NamedNumpyArray([[1, 3],\n"
              "                 [6, 8]], [['a', 'b'], None])"
          ),
      )
  
      a = named_array.NamedNumpyArray(
          [0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0],
          [str(i) for i in range(13)],
          dtype=np.int32,
      )
      numpy_repr = np.array_repr(a)
      if "\n" in numpy_repr:  # ie numpy > 1.14
          self.assertEqual(
              repr(a),
              """
  NamedNumpyArray([ 0,  0,  0, 50,  0,  0,  0,  0,  0,  0,  0,  0,  0],
                  ['0', '1', '2', '3', '4', '...', '8', '9', '10', '11', '12'],
                  dtype=int32)""".strip(),
          )  # Keep the middle newlines.
      else:
          self.assertEqual(
              repr(a),
              (
                  "NamedNumpyArray("
                  "[ 0,  0,  0, 50,  0,  0,  0,  0,  0,  0,  0,  0,  0], "
                  "['0', '1', '2', '3', '4', '...', '8', '9', '10', '11', '12'], "
                  "dtype=int32)"
              ),
          )  # Note the lack of newlines.
  
      a = named_array.NamedNumpyArray(
          [list(range(50))] * 50, [None, ["a%s" % i for i in range(50)]]
      )
      self.assertIn("49", str(a))
      self.assertIn("49", repr(a))
      self.assertIn("a4", repr(a))
      self.assertIn("a49", repr(a))
  
      a = named_array.NamedNumpyArray(
          [list(range(50))] * 50, [["a%s" % i for i in range(50)], None]
      )
      self.assertIn("49", str(a))
      self.assertIn("49", repr(a))
      self.assertIn("a4", repr(a))
      self.assertIn("a49", repr(a))
  
imports: import collections
  import enum
  import pickle
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  from pysc2.lib import named_array
label_desc: Use image node_id 9 for calling the NamedArrayTest obj's underlying member method code with example usage: obj.test_string() without return types