code: def test_get_level_values(idx):
      result = idx.get_level_values(0)
      expected = Index(
          ["foo", "foo", "bar", "baz", "qux", "qux"], name="first"
      )
      tm.assert_index_equal(result, expected)
      assert result.name == "first"
  
      result = idx.get_level_values("first")
      expected = idx.get_level_values(0)
      tm.assert_index_equal(result, expected)
  
      # GH 10460
      index = MultiIndex(
          levels=[
              CategoricalIndex(["A", "B"]),
              CategoricalIndex([1, 2, 3]),
          ],
          codes=[
              np.array([0, 0, 0, 1, 1, 1]),
              np.array([0, 1, 2, 0, 1, 2]),
          ],
      )
  
      exp = CategoricalIndex(["A", "A", "A", "B", "B", "B"])
      tm.assert_index_equal(index.get_level_values(0), exp)
      exp = CategoricalIndex([1, 2, 3, 1, 2, 3])
      tm.assert_index_equal(index.get_level_values(1), exp)
  
file_path: pandas/pandas/tests/indexes/multi/test_get_level_values.py
imports: import numpy
  import pandas
  from pandas import CategoricalIndex, Index, MultiIndex, Timestamp, date_range
  import pandas._testing
label_desc: Use image node_id 1 for calling a global function with example usage: test_get_level_values(idx) without return types