code: def test_scitype_generic(force_single_scitype, coerce_to_list):
      """Test that the scitype function recovers the correct scitype(s)."""
      from sktime.base import BaseObject
  
      class _DummyClass(BaseObject):
          _tags = {"object_type": ["foo", "bar"]}
  
      scitype_inferred = scitype(
          _DummyClass(),
          force_single_scitype=force_single_scitype,
          coerce_to_list=coerce_to_list,
      )
  
      if force_single_scitype and coerce_to_list:
          expected = ["foo"]
      if not force_single_scitype and coerce_to_list:
          expected = ["foo", "bar"]
      if not coerce_to_list:
          expected = "foo"
  
      assert scitype_inferred == expected
  
      class _DummyClass2(BaseObject):
          _tags = {"object_type": "foo"}
  
      scitype_inferred = scitype(
          _DummyClass2(),
          force_single_scitype=force_single_scitype,
          coerce_to_list=coerce_to_list,
      )
  
      if coerce_to_list:
          expected = ["foo"]
      if not coerce_to_list:
          expected = "foo"
  
      assert scitype_inferred == expected
  
      class _DummyClass3(BaseObject):
          _tags = {"object_type": ["foo"]}
  
      scitype_inferred = scitype(
          _DummyClass3(),
          force_single_scitype=force_single_scitype,
          coerce_to_list=coerce_to_list,
      )
  
      if coerce_to_list:
          expected = ["foo"]
      if not coerce_to_list:
          expected = "foo"
  
      assert scitype_inferred == expected
  
label_desc: Use image node_id 2 for calling a global function with example usage: test_scitype_generic(force_single_scitype, coerce_to_list) without return types