code: def _is_valid_iterate_as(scitype, iterate_as):
      """Return whether iterate_as has equal or lower type as scitype.
  
      Parameters
      ----------
      scitype : str - scitype
      iterate_as : str - scitype
  
      Returns
      -------
      valid : bool, whether iterate_as can be iterated over (lower or equal type)
      """
      if scitype == "Hierarchical":
          return True
      if scitype == "Panel" and iterate_as == "Hierarchical":
          return False
      if scitype == "Series" and iterate_as != "Series":
          return False
      return True
  
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 2 for calling a global function with example usage: _is_valid_iterate_as(scitype, iterate_as) and returns: True, True, False, False