code: def from_nested_to_long(
      X,
      instance_column_name=None,
      time_column_name=None,
      dimension_column_name=None,
  ):
      """Convert nested DataFrame to long DataFrame.
  
      Parameters
      ----------
      X : pd.DataFrame
          The nested DataFrame
  
      instance_column_name : str
          The name of column corresponding to the DataFrame's instances
  
      time_column_name : str
          The name of the column corresponding to the DataFrame's timepoints.
  
      dimension_column_name : str
          The name of the column corresponding to the DataFrame's dimensions.
  
      Returns
      -------
      long_df : pd.DataFrame
          Long pandas DataFrame
      """
      long_df = from_nested_to_multi_index(
          X, instance_index="index", time_index="time_index"
      )
      long_df.reset_index(inplace=True)
      long_df = long_df.melt(
          id_vars=["index", "time_index"], var_name="column"
      )
  
      col_rename_dict = {}
      if instance_column_name is not None:
          col_rename_dict["index"] = instance_column_name
  
      if time_column_name is not None:
          col_rename_dict["time_index"] = time_column_name
  
      if dimension_column_name is not None:
          col_rename_dict["column"] = dimension_column_name
  
      if len(col_rename_dict) > 0:
          long_df = long_df.rename(columns=col_rename_dict)
  
      return long_df
  
imports: import numpy
  import pandas
  from sktime.datatypes._convert_utils._coerce import _coerce_df_dtypes
  from sktime.datatypes._convert_utils._convert import _extend_conversions
  from sktime.datatypes._panel._registry import MTYPE_LIST_PANEL
  from sktime.utils.pandas import df_map
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 21 for calling a global function with example usage: from_nested_to_long(X, instance_column_name, time_column_name, dimension_column_name) and returns: long_df