<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_from_docinfo(self, docinfo, delete_missing=False, raise_failure=False):
 """Populate the XMP metadata object with DocumentInfo Arguments: docinfo: a DocumentInfo, e.g pdf.docinfo delete_missing: if the entry is not DocumentInfo, delete the equivalent from XMP raise_failure: if True, raise any failure to convert docinfo; otherwise warn and continue A few entries in the deprecated DocumentInfo dictionary are considered approximately equivalent to certain XMP records. This method copies those entries into the XMP metadata. """

        for uri, shortkey, docinfo_name, converter in self.DOCINFO_MAPPING:
            qname = QName(uri, shortkey)
            # docinfo might be a dict or pikepdf.Dictionary, so lookup keys
            # by str(Name)
            val = docinfo.get(str(docinfo_name))
            if val is None:
                if delete_missing and qname in self:
                    del self[qname]
                continue
            try:
                val = str(val)
                if converter:
                    val = converter.xmp_from_docinfo(val)
                if not val:
                    continue
                self[qname] = val
            except (ValueError, AttributeError) as e:
                msg = "The metadata field {} could not be copied to XMP".format(
                    docinfo_name
                )
                if raise_failure:
                    raise ValueError(msg) from e
                else:
                    warn(msg)