code: def test_scitype_to_mtype(mtype, scitype):
      """Tests that scitype_to_mtype yields the correct output for a string.
  
      Parameters
      ----------
      mtype : str - mtype string, mtype belonging to scitype
      scitype : str - scitype string, scitype of mtype
  
      Raises
      ------
      AssertionError scitype_to_mtype does not return correct list of mtypes
      Exception if any is raised by scitype_to_mtype
      """
      # check that mtype is always returned in "all" setting
      result = scitype_to_mtype(scitype, softdeps="all")
      msg = (
          f"scitype_to_mtype does not correctly retrieve all mtypes for scitype "
          f'"{scitype}", mtype "{mtype}" is missing from result returned: {result}'
      )
      assert mtype in result, msg
  
      # check that mtype is not returned in "exclude" setting if requires soft dep
      result_no_softdeps = scitype_to_mtype(scitype, softdeps="exclude")
      assert (mtype in MTYPE_SOFT_DEPS.keys()) != (
          mtype in result_no_softdeps
      )
  
      if mtype in MTYPE_SOFT_DEPS.keys():
          softdep_present = _check_soft_dependencies(
              MTYPE_SOFT_DEPS[mtype], severity="none"
          )
      else:
          softdep_present = True
  
      # check that mtype is returned for "present" setting iff soft dep is satisfied
      result_present = scitype_to_mtype(scitype, softdeps="present")
      assert (mtype in result_present) == softdep_present
  
imports: import pytest
  from sktime.datatypes._registry import MTYPE_REGISTER, MTYPE_SOFT_DEPS, mtype_to_scitype, scitype_to_mtype
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 3 for calling a global function with example usage: test_scitype_to_mtype(mtype, scitype) without return types