code: def test_split_to_multiindex_expand_unequal_splits():
      idx = Index(
          [
              "some_unequal_splits",
              "one_of_these_things_is_not",
              np.nan,
              None,
          ]
      )
      result = idx.str.split("_", expand=True)
      exp = MultiIndex.from_tuples(
          [
              ("some", "unequal", "splits", np.nan, np.nan, np.nan),
              ("one", "of", "these", "things", "is", "not"),
              (np.nan, np.nan, np.nan, np.nan, np.nan, np.nan),
              (None, None, None, None, None, None),
          ]
      )
      tm.assert_index_equal(result, exp)
      assert result.nlevels == 6
  
      with pytest.raises(ValueError, match="expand must be"):
          idx.str.split("_", expand="not_a_boolean")
  
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 21 for calling a global function with example usage: test_split_to_multiindex_expand_unequal_splits() without return types