code: def key_value_nested_generator(dict_obj):
      
      for key, value in dict_obj.items():
          if isinstance(value, dict):
              for key, value in key_value_nested_generator(value):
                  yield key, value
          else:
              yield key, value
docs: Recursively iterate over key-value pairs of nested dictionaries.
  
      Parameters
      ----------
      dict_obj : dict
          The outer-most dict to iterate on.
  
      Returns
      -------
      generator
          A generator over key-value pairs in all nested dictionaries.
  
      Example
      -------
      >>> dicti = {'a': 1, 'b': {'c': 3, 'd': 4}}
      >>> print(sorted(list(key_value_nested_generator(dicti))))
      [('a', 1), ('c', 3), ('d', 4)]