code: def convert_pandas_to_dask(
      obj, npartitions=1, chunksize=None, sort=True
  ):
      """Convert pandas DataFrame to dask DataFrame, preserving MultiIndex.
  
      Parameters
      ----------
      obj : dask DataFrame
      npartitions : int or None, optional, default = 1
          npartitions passed to dask from_pandas when converting obj to dask
      chunksize : int or None, optional, default = None
          chunksize passed to dask from_pandas when converting obj to dask
      sort : bool, optional, default = True
          sort passed to dask from_pandas when converting obj to dask
  
      Returns
      -------
      pandas.DataFrame
          MultiIndex levels 0 .. -1 of X are converted to columns of name
          __index__[indexname], where indexname is name of multiindex level,
          or the integer index if the level has no name
          other columns and column names are identical to those of X
      """
      from dask.dataframe import from_pandas
  
      def dask_mi_names(names):
          res = list(names).copy()
          for i, name in enumerate(names):
              if name is None:
                  res[i] = str(i)
          return [f"__index__{x}" for x in res]
  
      if isinstance(obj.index, pd.MultiIndex):
          names = obj.index.names
          new_names = dask_mi_names(names)
          new_index = [str(x) for x in obj.index]
  
          obj = obj.copy()
          obj.index.names = new_names
          obj = obj.reset_index()
          obj.index = new_index
  
      obj = from_pandas(
          obj, npartitions=npartitions, chunksize=chunksize, sort=sort
      )
  
      return obj
  
imports: import pandas
  from sktime.datatypes._common import _req
  from sktime.datatypes._common import _ret
label_desc: Use image node_id 4 for calling a global function with example usage: convert_pandas_to_dask(obj, npartitions, chunksize, sort) and returns: obj, unknown