code: def test_convert(scitype, from_mtype, to_mtype, fixture_index):
      """Tests that conversions for scitype agree with from/to example fixtures.
  
      Parameters
      ----------
      scitype : str - scitypes
      from_mtype : str - mtype of "from" conversion to test, belongs to scitype
      to_mtype : str - mtype of conversion target ("to") to test, belongs to scitype
      from_fixture : int - index of fixture tuple use for conversion
  
      Raises
      ------
      AssertionError if a converted object does not match fixture
      error if conversion itself raises an error
      """
      # retrieve from/to fixture for conversion
      from_fixture = get_examples(
          mtype=from_mtype, as_scitype=scitype, return_lossy=True
      ).get(fixture_index)
  
      to_fixture = get_examples(
          mtype=to_mtype, as_scitype=scitype, return_lossy=True
      ).get(fixture_index)
  
      # retrieve indicators whether conversion makes sense
      # to-fixture is in example dict and is not None
      cond1 = to_fixture is not None and to_fixture[0] is not None
      # from-fixture is in example dict and is not None
      cond2 = from_fixture is not None and from_fixture[0] is not None
      # from-fixture is not None and not lossy
      cond3 = (
          cond2 and from_fixture[1] is not None and not from_fixture[1]
      )
  
      msg = (
          f"conversion {from_mtype} to {to_mtype} failed for fixture {fixture_index}, "
          "expected result (y) and converted result (x) are not equal because: "
      )
  
      # test that converted from-fixture equals to-fixture
      if cond1 and cond2 and cond3:
          converted_fixture_i = convert(
              obj=from_fixture[0],
              from_type=from_mtype,
              to_type=to_mtype,
              as_scitype=scitype,
          )
  
          equals, deep_equals_msg = deep_equals(
              converted_fixture_i,
              to_fixture[0],
              return_msg=True,
          )
          assert equals, msg + deep_equals_msg
  
imports: from sktime.datatypes import SCITYPE_REGISTER, scitype_to_mtype
  from sktime.datatypes._convert import _conversions_defined, convert
  from sktime.datatypes._examples import get_examples
  from sktime.utils._testing.deep_equals import deep_equals
label_desc: Use image node_id 3 for calling a global function with example usage: test_convert(scitype, from_mtype, to_mtype, fixture_index) without return types