code: def _check_scitype_valid(scitype: str = None):
      """Check validity of scitype."""
      valid_scitypes = list({x[1] for x in check_dict.keys()})
  
      if not isinstance(scitype, str):
          raise TypeError(
              f"scitype should be a str but found {type(scitype)}"
          )
  
      if scitype is not None and scitype not in valid_scitypes:
          raise TypeError(scitype + " is not a supported scitype")
  
file_path: sktime/sktime/datatypes/_check.py
imports: from typing import List, Union
  import numpy
  from sktime.datatypes._alignment import check_dict_Alignment
  from sktime.datatypes._common import _metadata_requested, _ret
  from sktime.datatypes._hierarchical import check_dict_Hierarchical
  from sktime.datatypes._panel import check_dict_Panel
  from sktime.datatypes._proba import check_dict_Proba
  from sktime.datatypes._registry import AMBIGUOUS_MTYPES, SCITYPE_LIST, mtype_to_scitype
  from sktime.datatypes._series import check_dict_Series
  from sktime.datatypes._table import check_dict_Table
  from sktime.utils.warnings import warn
label_desc: Use image node_id 1 for calling a global function with example usage: _check_scitype_valid(scitype) without return types