code: def test_all_estimators_return_tags(return_tags, return_names):
      """Test ability to return estimator value of passed tags."""
      estimators = all_estimators(
          return_tags=return_tags,
          return_names=return_names,
      )
      # Helps us keep track of estimator index within the tuple:
      ESTIMATOR_INDEX = 1 if return_names else 0
      TAG_START_INDEX = ESTIMATOR_INDEX + 1
  
      assert isinstance(estimators[0], tuple)
      # check length of tuple is what we expect:
      if isinstance(return_tags, str):
          assert len(estimators[0]) == TAG_START_INDEX + 1
      else:
          assert (
              len(estimators[0]) == len(return_tags) + TAG_START_INDEX
          )
  
      # check that for each estimator the value for that tag is correct:
      for est_tuple in estimators:
          est = est_tuple[ESTIMATOR_INDEX]
          if isinstance(return_tags, str):
              assert (
                  est.get_class_tag(return_tags)
                  == est_tuple[TAG_START_INDEX]
              )
          else:
              for tag_index, tag in enumerate(return_tags):
                  assert (
                      est.get_class_tag(tag)
                      == est_tuple[TAG_START_INDEX + tag_index]
                  )
  
file_path: sktime/sktime/registry/tests/test_lookup.py
imports: import pytest
  from sktime.base import BaseObject
  from sktime.registry import all_estimators, all_tags, scitype
  from sktime.registry._base_classes import BASE_CLASS_LOOKUP, BASE_CLASS_SCITYPE_LIST, TRANSFORMER_MIXIN_SCITYPE_LIST
  from sktime.registry._lookup import _check_estimator_types
label_desc: Use image node_id 8 for calling a global function with example usage: test_all_estimators_return_tags(return_tags, return_names) without return types