code: def test_item_len(
      scitype, mtype, fixture_index, iterate_as, iterate_cols
  ):
      """Tests __len__ returns correct length.
  
      Fixtures parameterized
      ----------------------
      scitype : str - scitype of fixture
      mtype : str - mtype of fixture
      fixture_index : int - index of fixture tuple with that scitype and mtype
      iterate_as : str - level on which to iterate over
      iterate_cols : bool - whether to iterate over columns
      """
      # escape for the invalid combinations, see above
      if not _is_valid_iterate_as(scitype, iterate_as):
          return None
  
      # retrieve fixture for checking
      fixture = get_examples(mtype=mtype, as_scitype=scitype).get(
          fixture_index
      )
  
      # get true length
      if iterate_as == scitype:
          true_length = 1
      elif iterate_as == "Series":
          _, _, metadata = check_is_mtype(
              fixture,
              mtype=mtype,
              scitype=scitype,
              return_metadata=True,
              msg_return_dict="list",
          )
          true_length = metadata["n_instances"]
      elif iterate_as == "Panel":
          _, _, metadata = check_is_mtype(
              fixture,
              mtype=mtype,
              scitype=scitype,
              return_metadata=True,
              msg_return_dict="list",
          )
          true_length = metadata["n_panels"]
  
      # construct VectorizedDF - we've tested above that this works
      X_vect = VectorizedDF(
          X=fixture,
          iterate_as=iterate_as,
          is_scitype=None,
          iterate_cols=iterate_cols,
      )
  
      # if columns are being iterated over, length is multiplied by no columns iterated
      if iterate_cols:
          true_length = true_length * len(X_vect.X_multiindex.columns)
  
      # check length against n_instances metadata field
      assert len(X_vect) == true_length, (
          "X_vect.__len__ returns incorrect length.",
          f"True={true_length}, returned={len(X_vect)}",
      )
  
imports: import numpy
  import pandas
  import pytest
  from sktime.datatypes import MTYPE_REGISTER, SCITYPE_REGISTER
  from sktime.datatypes._check import AMBIGUOUS_MTYPES, check_is_mtype
  from sktime.datatypes._examples import get_examples
  from sktime.datatypes._vectorize import VectorizedDF, _enforce_index_freq
  from sktime.utils._testing.deep_equals import deep_equals
  from sktime.utils.pandas import df_map
  from sktime.utils.parallel import _get_parallel_test_fixtures
label_desc: Use image node_id 8 for calling a global function with example usage: test_item_len(scitype, mtype, fixture_index, iterate_as, iterate_cols) and returns: None