code: def test_index_multi_data(self):
      # Auto broadcast for scalar
      sd = idd.MultiData(0, index=["foo", "bar"], columns=["f", "g"])
      print(sd)
  
      # Bad case: the input is not aligned
      with self.assertRaises(ValueError):
          idd.MultiData(
              range(10), index=["foo", "bar"], columns=["f", "g"]
          )
  
      # test indexing
      sd = idd.MultiData(
          np.arange(4).reshape(2, 2),
          index=["foo", "bar"],
          columns=["f", "g"],
      )
      print(sd)
      print(sd.iloc[1])  # get second row
  
      # Bad case: it is not in the index
      with self.assertRaises(KeyError):
          print(sd.loc[1])
  
      print(sd.loc["foo"])
  
      # Test slicing
  
      print(sd.loc[:"foo"])
  
      print(sd.loc[:, "g":])
  
file_path: qlib/tests/misc/test_index_data.py
imports: import numpy
  import pandas
  import qlib.utils.index_data
  import unittest
label_desc: Use image node_id 2 for calling the IndexDataTest obj's underlying member method code with example usage: obj.test_index_multi_data() without return types