code: def test_narrow_code_storage(self):
      create_categories = self.create_categories
      check_roundtrip = self.check_roundtrip
  
      # uint8
      categories = create_categories(8, plus_one=False)
      arr = LabelArray(
          categories,
          missing_value=categories[0],
          categories=categories,
      )
      self.assertEqual(arr.itemsize, 1)
      check_roundtrip(arr)
  
      # uint8 inference
      arr = LabelArray(categories, missing_value=categories[0])
      self.assertEqual(arr.itemsize, 1)
      check_roundtrip(arr)
  
      # just over uint8
      categories = create_categories(8, plus_one=True)
      arr = LabelArray(
          categories,
          missing_value=categories[0],
          categories=categories,
      )
      self.assertEqual(arr.itemsize, 2)
      check_roundtrip(arr)
  
      # fits in uint16
      categories = create_categories(16, plus_one=False)
      arr = LabelArray(
          categories,
          missing_value=categories[0],
          categories=categories,
      )
      self.assertEqual(arr.itemsize, 2)
      check_roundtrip(arr)
  
      # uint16 inference
      arr = LabelArray(categories, missing_value=categories[0])
      self.assertEqual(arr.itemsize, 2)
      check_roundtrip(arr)
  
      # just over uint16
      categories = create_categories(16, plus_one=True)
      arr = LabelArray(
          categories,
          missing_value=categories[0],
          categories=categories,
      )
      self.assertEqual(arr.itemsize, 4)
      check_roundtrip(arr)
  
      # uint32 inference
      arr = LabelArray(categories, missing_value=categories[0])
      self.assertEqual(arr.itemsize, 4)
      check_roundtrip(arr)
  
imports: from itertools import product
  from operator import eq, ne
  import warnings
  import numpy
  from toolz import take
  from zipline.lib.labelarray import LabelArray
  from zipline.testing import check_arrays, parameter_space, ZiplineTestCase
  from zipline.testing.predicates import assert_equal
  from zipline.utils.compat import unicode
label_desc: Use image node_id 16 for calling the LabelArrayTestCase obj's underlying member method code with example usage: obj.test_narrow_code_storage() without return types