code: def convert_to_scitype(
      obj,
      to_scitype,
      from_scitype=None,
      store=None,
      return_to_mtype=False,
  ):
      """Convert single-series or single-panel between mtypes.
  
      Assumes input is conformant with one of the mtypes
          for one of the scitypes Series, Panel, Hierarchical.
      This method does not perform full mtype checks, use mtype or check_is_mtype for
      checks.
  
      Parameters
      ----------
      obj : an object of scitype Series, Panel, or Hierarchical.
      to_scitype : str, scitype that obj should be converted to
      from_scitype : str, optional. Default = inferred from obj
          scitype that obj is of, and being converted from
          if avoided, function will skip type inference from obj
      store : dict, optional. Converter store for back-conversion.
      return_to_mtype: bool, optional (default=False)
          if True, also returns the str of the mtype converted to
  
      Returns
      -------
      obj of scitype to_scitype
          if converted to or from Hierarchical, the mtype will always be one of
              pd.DataFrame (Series), pd-multiindex (Panel), or pd_multiindex_hier
          if converted to or from Panel, mtype will attempt to keep python type
              e.g., np.ndarray (Series) converted to numpy3D (Panel) or back
              if not possible, will be one of the mtypes with pd.DataFrame python type
      """
      if from_scitype is None:
          from_scitype = scitype(
              obj,
              candidate_scitypes=["Series", "Panel", "Hierarchical"],
          )
  
      if to_scitype == from_scitype:
          return obj
  
      func_name = f"convert_{from_scitype}_to_{to_scitype}"
      func = eval(func_name)
  
      return func(obj, store=store, return_to_mtype=return_to_mtype)
  
file_path: sktime/sktime/datatypes/_series_as_panel/_convert.py
imports: import numpy
  import pandas
  from sktime.datatypes import convert_to, scitype
label_desc: Use image node_id 7 for calling a global function with example usage: convert_to_scitype(obj, to_scitype, from_scitype, store, return_to_mtype) and returns: func, obj