code: def _format(self, doc):
          
          if self.allow_partial_formatting:
              mapping = FormatDict(self.doc_dict)
          else:
              mapping = self.doc_dict
          formatter = string.Formatter()
          return formatter.vformat(doc, (), mapping)
docs: Formats the docstring using self.doc_dict