code: def test_get_names_from_levels():
      idx = MultiIndex.from_product([["a"], [1, 2]], names=["a", "b"])
  
      assert idx.levels[0].name == "a"
      assert idx.levels[1].name == "b"
  
file_path: pandas/pandas/tests/indexes/multi/test_names.py
imports: import pytest
  import pandas
  from pandas import MultiIndex
  import pandas._testing
label_desc: Use image node_id 9 for calling a global function with example usage: test_get_names_from_levels() without return types