code: def test_from_multi_index_to_nested(
      n_instances, n_columns, n_timepoints
  ):
      """Test from_multi_index_to_nested for correctness."""
      mi_df = make_multi_index_dataframe(
          n_instances=n_instances,
          n_timepoints=n_timepoints,
          n_columns=n_columns,
      )
      nested_df = from_multi_index_to_nested(
          mi_df, instance_index="case_id", cells_as_numpy=False
      )
  
      assert is_nested_dataframe(nested_df)
      assert nested_df.shape == (n_instances, n_columns)
      assert (nested_df.columns == mi_df.columns).all()
  
imports: import numpy
  import pandas
  import pytest
  from sktime.datasets import generate_example_long_table, make_multi_index_dataframe
  from sktime.datatypes._adapter import convert_from_multiindex_to_listdataset
  from sktime.datatypes._panel._check import are_columns_nested, is_nested_dataframe
  from sktime.datatypes._panel._convert import from_2d_array_to_nested, from_3d_numpy_to_2d_array, from_3d_numpy_to_multi_index, from_3d_numpy_to_nested, from_long_to_nested, from_multi_index_to_3d_numpy, from_multi_index_to_nested, from_nested_to_2d_array, from_nested_to_3d_numpy, from_nested_to_long, from_nested_to_multi_index
  from sktime.utils._testing.panel import make_classification_problem
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 8 for calling a global function with example usage: test_from_multi_index_to_nested(n_instances, n_columns, n_timepoints) without return types