code: def test_labels_dtypes():
      # GH 8456
      i = MultiIndex.from_tuples([("A", 1), ("A", 2)])
      assert i.codes[0].dtype == "int8"
      assert i.codes[1].dtype == "int8"
  
      i = MultiIndex.from_product([["a"], range(40)])
      assert i.codes[1].dtype == "int8"
      i = MultiIndex.from_product([["a"], range(400)])
      assert i.codes[1].dtype == "int16"
      i = MultiIndex.from_product([["a"], range(40000)])
      assert i.codes[1].dtype == "int32"
  
      i = MultiIndex.from_product([["a"], range(1000)])
      assert (i.codes[0] >= 0).all()
      assert (i.codes[1] >= 0).all()
  
imports: import re
  import numpy
  import pytest
  from pandas._libs import index
  from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike
  import pandas
  from pandas import Index, IntervalIndex, MultiIndex, RangeIndex
  import pandas._testing
label_desc: Use image node_id 1 for calling a global function with example usage: test_labels_dtypes() without return types