code: def scitype_to_mtype(scitype: str, softdeps: str = "exclude"):
      """Return list of all mtypes belonging to scitype.
  
      Parameters
      ----------
      scitype : str, or list of str
          scitype(s) to find mtypes for, a valid scitype string
          valid scitype strings, with explanation, are in datatypes.SCITYPE_REGISTER
      softdeps : str, optional, default = "exclude"
          whether to return mtypes that require soft dependencies
          "exclude" = only mtypes that do not require soft dependencies are returned
          "present" = only mtypes with soft deps satisfied by the environment are returned
          "all" = all mtypes, irrespective of soft deps satisfied or required, returned
          any other value defaults to "all"
  
      Returns
      -------
      mtypes : list of str
          all mtypes such that mtype_to_scitype(element) is in the list scitype
          if list, returns this function element-wise applied
          if nested list/str object, replaces mtype str by scitype str
          if None, returns None
  
      Raises
      ------
      TypeError, if input is not of the type specified
      ValueError, if one of the strings is not a valid scitype string
      RuntimeError, if there is no mtype for the/some scitype string (this must be a bug)
      """
      msg = "scitype argument must be str or list of str"
      # handle the "None" case first
      if scitype is None or scitype == "None":
          raise TypeError(msg)
      # recurse if mtype is a list
      if isinstance(scitype, list):
          scitype_list = [
              y for x in scitype for y in scitype_to_mtype(x)
          ]
          return scitype_list
  
      # checking for type. Checking str is enough, recursion above will do the rest.
      if not isinstance(scitype, str):
          raise TypeError(msg)
  
      # now we know scitype is a string, check if it is in the register
      if scitype not in SCITYPE_LIST:
          raise ValueError(
              f'"{scitype}" is not a valid scitype string, see datatypes.SCITYPE_REGISTER'
          )
  
      mtypes = [k[0] for k in MTYPE_REGISTER if k[1] == scitype]
  
      if len(mtypes) == 0:
          # if there are no mtypes, this must have been reached by mistake/bug
          raise RuntimeError("no mtypes defined for scitype " + scitype)
  
      if softdeps not in ["exclude", "present"]:
          return mtypes
  
      if softdeps == "exclude":
          # subset to mtypes that require no soft deps
          mtypes = [
              m for m in mtypes if m not in MTYPE_SOFT_DEPS.keys()
          ]
          return mtypes
  
      if softdeps == "present":
          from sktime.utils.validation._dependencies import (
              _check_soft_dependencies,
          )
  
          def present(x):
              """Return True if x has satisfied soft dependency or has no soft dep."""
              if x not in MTYPE_SOFT_DEPS.keys():
                  return True
              else:
                  return _check_soft_dependencies(
                      MTYPE_SOFT_DEPS[x], severity="none"
                  )
  
          # return only mtypes with soft dependencies present (or requiring none)
          mtypes = [m for m in mtypes if present(m)]
          return mtypes
  
imports: from sktime.datatypes._alignment._registry import MTYPE_LIST_ALIGNMENT, MTYPE_REGISTER_ALIGNMENT
  from sktime.datatypes._hierarchical._registry import MTYPE_LIST_HIERARCHICAL, MTYPE_REGISTER_HIERARCHICAL, MTYPE_SOFT_DEPS_HIERARCHICAL
  from sktime.datatypes._panel._registry import MTYPE_LIST_PANEL, MTYPE_REGISTER_PANEL, MTYPE_SOFT_DEPS_PANEL
  from sktime.datatypes._proba._registry import MTYPE_LIST_PROBA, MTYPE_REGISTER_PROBA
  from sktime.datatypes._series._registry import MTYPE_LIST_SERIES, MTYPE_REGISTER_SERIES, MTYPE_SOFT_DEPS_SERIES
  from sktime.datatypes._table._registry import MTYPE_LIST_TABLE, MTYPE_REGISTER_TABLE
label_desc: Use image node_id 2 for calling a global function with example usage: scitype_to_mtype(scitype, softdeps) and returns: scitype_list, mtypes, mtypes, mtypes, True, _check_soft_dependencies