code: def test_all_estimators_return_names(return_names):
      """Test return_names argument in all_estimators."""
      estimators = all_estimators(return_names=return_names)
      assert isinstance(estimators, list)
      assert len(estimators) > 0
  
      if return_names:
          assert all(
              [isinstance(estimator, tuple) for estimator in estimators]
          )
          names, estimators = list(zip(*estimators))
          assert all([isinstance(name, str) for name in names])
          assert all(
              [
                  name == estimator.__name__
                  for name, estimator in zip(names, estimators)
              ]
          )
  
      assert all(
          [isinstance(estimator, type) for estimator in estimators]
      )
  
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 5 for calling a global function with example usage: test_all_estimators_return_names(return_names) without return types