code: def _check_dict_of_dict(obj, name="obj"):
      """Check whether obj is a dict of dict, with str keys.
  
      Parameters
      ----------
      obj : any object, check whether is dict of dict, with str keys
      name : str, default="obj", name of obj to display in error message
  
      Returns
      -------
      obj, unaltered
  
      Raises
      ------
      TypeError if obj is not dict of dict, with str keys
      """
      if not (
          isinstance(obj, dict)
          and all(isinstance(x, dict) for x in obj.values())
          and all(isinstance(x, str) for x in obj.keys())
      ):
          raise TypeError(
              f"{name} must be a dict of dict, with str keys"
          )
      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 2 for calling a global function with example usage: _check_dict_of_dict(obj, name) and returns: obj