code: def test_nlevels(idx):
      assert idx.nlevels == 2
  
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 17 for calling a global function with example usage: test_nlevels(idx) without return types