code: def check_dask_frame(
      obj,
      return_metadata=False,
      var_name="obj",
      freq_set_check=False,
      scitype="Series",
  ):
      """Check dask frame, generic for sktime check format."""
      import dask
  
      metadata = {}
  
      if not isinstance(obj, dask.dataframe.core.DataFrame):
          msg = (
              f"{var_name} must be a dask DataFrame, found {type(obj)}"
          )
          return ret(False, msg, None, return_metadata)
  
      # we now know obj is a dask DataFrame
  
      index_cols = get_mi_cols(obj)
  
      # check right number of cols depending on scitype
      if scitype == "Series":
          cols_msg = (
              f"{var_name} must have exactly one index column, "
              f"found {len(index_cols)}, namely: {index_cols}"
          )
          right_no_index_cols = len(index_cols) <= 1
      elif scitype == "Panel":
          cols_msg = (
              f"{var_name} must have exactly two index columns, "
              f"found {len(index_cols)}, namely: {index_cols}"
          )
          right_no_index_cols = len(index_cols) == 2
      elif scitype == "Hierarchical":
          cols_msg = (
              f"{var_name} must have three or more index columns, "
              f"found {len(index_cols)}, namely: {index_cols}"
          )
          right_no_index_cols = len(index_cols) >= 3
      else:
          return RuntimeError(
              'scitype arg of check_dask_frame must be one of strings "Series", '
              f'"Panel", or "Hierarchical", but found {scitype}'
          )
  
      if not right_no_index_cols:
          # dask series should have at most one __index__ col
          return ret(False, cols_msg, None, return_metadata)
  
      if _req("is_empty", return_metadata):
          metadata["is_empty"] = (
              len(obj.index) < 1 or len(obj.columns) < 1
          )
      if _req("is_univariate", return_metadata):
          metadata["is_univariate"] = len(obj.columns) == 1
      if _req("n_features", return_metadata):
          metadata["n_features"] = len(obj.columns)
      if _req("feature_names", return_metadata):
          metadata["feature_names"] = obj.columns.to_list()
  
      # check that columns are unique
      if not obj.columns.is_unique:
          msg = f"{var_name} must have unique column indices, but found {obj.columns}"
          return ret(False, msg, None, return_metadata)
  
      # check whether the time index is of valid type
      # if not is_in_valid_index_types(index):
      #     msg = (
      #         f"{type(index)} is not supported for {var_name}, use "
      #         f"one of {VALID_INDEX_TYPES} or integer index instead."
      #     )
      #     return ret(False, msg, None, return_metadata)
  
      # Check time index is ordered in time
      if not obj.index.is_monotonic_increasing.compute():
          msg = (
              f"The (time) index of {var_name} must be sorted "
              f"monotonically increasing, but found: {obj.index}"
          )
          return ret(False, msg, None, return_metadata)
  
      if freq_set_check and isinstance(obj.index, pd.DatetimeIndex):
          if obj.index.freq is None:
              msg = f"{var_name} has DatetimeIndex, but no freq attribute set."
              return ret(False, msg, None, return_metadata)
  
      # check whether index is equally spaced or if there are any nans
      #   compute only if needed
      if _req("is_equally_spaced", return_metadata):
          # todo: logic for equal spacing
          metadata["is_equally_spaced"] = True
      if _req("has_nans", return_metadata):
          metadata["has_nans"] = obj.isnull().values.any().compute()
  
      if scitype in ["Panel", "Hierarchical"]:
          if _req("n_instances", return_metadata):
              instance_cols = index_cols[:-1]
              metadata["n_instances"] = len(
                  obj[instance_cols].drop_duplicates()
              )
  
      if scitype in ["Hierarchical"]:
          if _req("n_panels", return_metadata):
              panel_cols = index_cols[:-2]
              metadata["n_panels"] = len(
                  obj[panel_cols].drop_duplicates()
              )
  
      return ret(True, None, metadata, return_metadata)
  
imports: import pandas
  from sktime.datatypes._common import _req
  from sktime.datatypes._common import _ret
label_desc: Use image node_id 5 for calling a global function with example usage: check_dask_frame(obj, return_metadata, var_name, freq_set_check, scitype) and returns: ret, ret, ret, ret, ret, ret, RuntimeError