code: def to_dict(self, flat: bool=True) -> Dict[Any, Any]:
          
          if flat:
              return {key: value for key, value in self.items()}  # type: ignore
          else:
              return {key: self.getall(key) for key in self}
docs: Convert the multidict to a plain dictionary.
  
          Arguments:
  
              flat: If True only return the a value for each key, if
                  False return all values as lists.