code: def test_check_negative(scitype, mtype):
      """Tests that check_is_mtype correctly identifies wrong mtypes of examples.
  
      Parameters
      ----------
      scitype : str - scitype of fixture
      mtype : str - mtype of fixture
  
      Raises
      ------
      RuntimeError if scitype is not defined or has no mtypes or examples
      AssertionError if a examples are correctly identified as incompatible
      error if check itself raises an error
      """
      # if the scitype is ambiguous, we can't assume that other mtypes are negative
      if scitype in SCITYPES_AMBIGUOUS_MTYPE:
          return None
  
      mtypes = scitype_to_mtype(scitype)
      fixtures = dict()
  
      for other_mtype in mtypes:
          fixtures[other_mtype] = get_examples(
              mtype=other_mtype, as_scitype=scitype
          )
  
      n_fixtures = np.max([len(fixtures[mtype]) for mtype in mtypes])
  
      if n_fixtures == 0:
          raise RuntimeError(
              "no fixtures defined for scitype " + scitype
          )
  
      for i in range(n_fixtures):
          # if mtype is not ambiguous, other mtypes are negative examples
          for wrong_mtype in list(set(mtypes).difference({mtype})):
              # retrieve fixture for checking
              fixture_wrong_type = fixtures[wrong_mtype].get(i)
  
              # todo: possibly remove this once all checks are defined
              check_is_defined = (mtype, scitype) in check_dict.keys()
  
              # check fixtures that exist against checks that exist
              if fixture_wrong_type is not None and check_is_defined:
                  assert not check_is_mtype(
                      fixture_wrong_type,
                      mtype,
                      scitype,
                      msg_return_dict="list",
                  ), (
                      f"check_is_mtype {mtype} returns True "
                      f"on {wrong_mtype} fixture {i}"
                  )
  
              # check fixtures that exist against checks that exist
              if fixture_wrong_type is not None and check_is_defined:
                  result = check_is_mtype(
                      fixture_wrong_type,
                      mtype,
                      scitype,
                      return_metadata=[],
                      msg_return_dict="list",
                  )[0]
                  assert not result, (
                      f"check_is_mtype {mtype} returns True "
                      f"on {wrong_mtype} fixture {i}"
                  )
  
file_path: sktime/sktime/datatypes/tests/test_check.py
imports: import numpy
  from sktime.datatypes._check import AMBIGUOUS_MTYPES, check_dict, check_is_mtype, check_is_scitype
  from sktime.datatypes._check import mtype
  from sktime.datatypes._check import scitype
  from sktime.datatypes._examples import get_examples
  from sktime.datatypes._registry import SCITYPE_LIST, scitype_to_mtype
label_desc: Use image node_id 7 for calling a global function with example usage: test_check_negative(scitype, mtype) and returns: None