code: def test_split_with_name_index():
      # GH 12617
      idx = Index(["a,b", "c,d"], name="xxx")
      res = idx.str.split(",")
      exp = Index([["a", "b"], ["c", "d"]], name="xxx")
      assert res.nlevels == 1
      tm.assert_index_equal(res, exp)
  
      res = idx.str.split(",", expand=True)
      exp = MultiIndex.from_tuples([("a", "b"), ("c", "d")])
      assert res.nlevels == 2
      tm.assert_index_equal(res, exp)
  
imports: from datetime import datetime
  import re
  import numpy
  import pytest
  import pandas
  from pandas import DataFrame, Index, MultiIndex, Series, _testing
  from pandas.tests.strings import _convert_na_value, object_pyarrow_numpy
label_desc: Use image node_id 30 for calling a global function with example usage: test_split_with_name_index() without return types