docs: def _make_minimal(dictionary):
      """
      This function removes all the keys whose value is either None or an empty
      dictionary.
      """
      new_dict = {}
      for key, value in dictionary.items():
          if value is not None:
              if isinstance(value, dict):
                  new_value = _make_minimal(value)
                  if new_value:
                      new_dict[key] = new_value
              else:
                  new_dict[key] = value
      return new_dict