code: def reserve(self, doc):
          
          # Only registered PIDs can be updated.
          try:
              self.pid.reserve()
              self.api.metadata_post(doc)
          except (DataCiteError, HttpError):
              logger.exception("Failed to reserve in DataCite",
                               extra=dict(pid=self.pid))
              raise
          logger.info("Successfully reserved in DataCite",
                      extra=dict(pid=self.pid))
          return True
docs: Reserve a DOI (amounts to upload metadata, but not to mint).
  
          :param doc: Set metadata for DOI.
          :returns: `True` if is reserved successfully.