code: def test_single_dimension(self, names):
      a = named_array.NamedNumpyArray([1, 3, 6], names)
      self.assertEqual(a[0], 1)
      self.assertEqual(a[1], 3)
      self.assertEqual(a[2], 6)
      self.assertEqual(a[-1], 6)
      self.assertEqual(a.a, 1)
      self.assertEqual(a.b, 3)
      self.assertEqual(a.c, 6)
      with self.assertRaises(AttributeError):
          a.d  # pylint: disable=pointless-statement
      self.assertEqual(a["a"], 1)
      self.assertEqual(a["b"], 3)
      self.assertEqual(a["c"], 6)
      with self.assertRaises(KeyError):
          a["d"]  # pylint: disable=pointless-statement
  
      # New axis = None
      self.assertArrayEqual(a, [1, 3, 6])
      self.assertArrayEqual(a[np.newaxis], [[1, 3, 6]])
      self.assertArrayEqual(a[None], [[1, 3, 6]])
      self.assertArrayEqual(a[None, :], [[1, 3, 6]])
      self.assertArrayEqual(a[:, None], [[1], [3], [6]])
      self.assertArrayEqual(a[None, :, None], [[[1], [3], [6]]])
      self.assertArrayEqual(a[None, a % 3 == 0, None], [[[3], [6]]])
      self.assertArrayEqual(a[None][None], [[[1, 3, 6]]])
      self.assertArrayEqual(a[None][0], [1, 3, 6])
      self.assertEqual(a[None, 0], 1)
      self.assertEqual(a[None, "a"], 1)
      self.assertEqual(a[None][0].a, 1)
      self.assertEqual(a[None][0, "b"], 3)
  
      # range slicing
      self.assertArrayEqual(a[0:2], [1, 3])
      self.assertArrayEqual(a[1:3], [3, 6])
      self.assertArrayEqual(a[0:2:], [1, 3])
      self.assertArrayEqual(a[0:2:1], [1, 3])
      self.assertArrayEqual(a[::2], [1, 6])
      self.assertArrayEqual(a[::-1], [6, 3, 1])
      self.assertEqual(a[1:3][0], 3)
      self.assertEqual(a[1:3].b, 3)
      self.assertEqual(a[1:3].c, 6)
  
      # list slicing
      self.assertArrayEqual(a[[0, 0]], [1, 1])
      self.assertArrayEqual(a[[0, 1]], [1, 3])
      self.assertArrayEqual(a[[1, 0]], [3, 1])
      self.assertArrayEqual(a[[1, 2]], [3, 6])
      self.assertArrayEqual(a[np.array([0, 2])], [1, 6])
      self.assertEqual(a[[1, 2]].b, 3)
      self.assertEqual(a[[2, 0]].c, 6)
      with self.assertRaises(TypeError):
          # Duplicates lead to unnamed dimensions.
          a[[0, 0]].a  # pylint: disable=pointless-statement
  
      a[1] = 4
      self.assertEqual(a[1], 4)
      self.assertEqual(a.b, 4)
      self.assertEqual(a["b"], 4)
  
      a[1:2] = 2
      self.assertEqual(a[1], 2)
      self.assertEqual(a.b, 2)
      self.assertEqual(a["b"], 2)
  
      a[[1]] = 3
      self.assertEqual(a[1], 3)
      self.assertEqual(a.b, 3)
      self.assertEqual(a["b"], 3)
  
      a.b = 5
      self.assertEqual(a[1], 5)
      self.assertEqual(a.b, 5)
      self.assertEqual(a["b"], 5)
  
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 3 for calling the NamedArrayTest obj's underlying member method code with example usage: obj.test_single_dimension(names) without return types