code: def _check_str_or_list_of_str(obj, obj_name="obj"):
      """Check whether obj is str or list of str; coerces to list of str."""
      if isinstance(obj, list):
          if not np.all([isinstance(x, str) for x in obj]):
              raise TypeError(f"{obj} must be a str or list of str")
          else:
              return obj
      elif not isinstance(obj, str):
          raise TypeError(f"{obj} must be a str or list of str")
      else:
          return [obj]
  
file_path: sktime/sktime/datatypes/_convert.py
imports: from copy import deepcopy
  import numpy
  import pandas
  from sktime.datatypes._check import mtype
  from sktime.datatypes._hierarchical import convert_dict_Hierarchical
  from sktime.datatypes._panel import convert_dict_Panel
  from sktime.datatypes._proba import convert_dict_Proba
  from sktime.datatypes._registry import mtype_to_scitype
  from sktime.datatypes._series import convert_dict_Series
  from sktime.datatypes._table import convert_dict_Table
label_desc: Use image node_id 5 for calling a global function with example usage: _check_str_or_list_of_str(obj, obj_name) and returns: obj, list