code: def check_raise(
      obj, mtype: str, scitype: str = None, var_name: str = "input"
  ):
      """Check object for compliance with mtype specification, raise errors.
  
      Parameters
      ----------
      obj - object to check
      mtype: str or list of str, mtype to check obj as
          valid mtype strings are in datatypes.MTYPE_REGISTER (1st column)
      scitype: str, optional, scitype to check obj as; default = inferred from mtype
          if inferred from mtype, list elements of mtype need not have same scitype
          valid mtype strings are in datatypes.SCITYPE_REGISTER (1st column)
      var_name: str, optional, default="input" - name of input in error messages
  
      Returns
      -------
      valid: bool - True if obj complies with the specification
              same as when return argument of check_is_mtype is True
              otherwise raises an error
  
      Raises
      ------
      TypeError with informative message if obj does not comply
      TypeError if no checks defined for mtype/scitype combination
      ValueError if mtype input argument is not of expected type
      """
      obj_long_name_for_avoiding_linter_clash = obj
      valid, msg, _ = check_is_mtype(
          obj=obj_long_name_for_avoiding_linter_clash,
          mtype=mtype,
          scitype=scitype,
          return_metadata=[],
          var_name=var_name,
          msg_return_dict="list",
      )
  
      if valid:
          return True
      else:
          raise TypeError(msg)
  
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 4 for calling a global function with example usage: check_raise(obj, mtype, scitype, var_name) and returns: True