code: def _check_list_of_str(obj, name="obj"):
      """Check whether obj is a list of str.
  
      Parameters
      ----------
      obj : any object, check whether is list of str
      name : str, default="obj", name of obj to display in error message
  
      Returns
      -------
      obj, unaltered
  
      Raises
      ------
      TypeError if obj is not list of str
      """
      if not isinstance(obj, list) or not all(
          isinstance(x, str) for x in obj
      ):
          raise TypeError(f"{name} must be a list of str")
      return obj
  
file_path: sktime/sktime/utils/_testing/scenarios.py
imports: from copy import deepcopy
  from inspect import isclass
label_desc: Use image node_id 1 for calling a global function with example usage: _check_list_of_str(obj, name) and returns: obj