

def embed(self, rel, target, wrap=False):
    'Embeds a document inside this document.\n\n        This method embeds the given document in this document with the given\n        ``rel``. If one or more documents have already been embedded for that\n        ``rel``, the new document will be embedded in addition to those\n        documents.\n\n        This method returns self, allowing it to be chained with additional\n        method calls.\n\n        Arguments:\n\n        - ``rel``: a string specifying the link relationship type of the\n          embedded resource. ``rel`` should be a well-known link relation name\n          from the IANA registry\n          (http://www.iana.org/assignments/link-relations/link-relations.xml),\n          a full URI, or a CURIE.\n        - ``target``: a ``Builder`` instance or a ``dougrain.Document``\n          instance that will be embedded in this document.\n        - ``wrap``: Defaults to False, but if True, specifies that the embedded\n          resource object should be initally wrapped in a JSON array even if it\n          is the first embedded resource for the given ``rel``.\n\n        Unlike ``dougrain.Document.embed``, this method does not detect\n        equivalence between relationship types with different representations.\n\n        WARNING: ``target`` should not be identical to ``self`` or any document\n        that embeds ``self``.\n        '
    new_embed = target.as_object()
    self._add_rel('_embedded', rel, new_embed, wrap)
    if self.draft.automatic_link:
        wrap.add_link(rel, target, wrap)
    return self

dataset/ETHPy150Open wharris/dougrain/dougrain/builder.py Builder.embed/VarMisuse@50/524 `self`->`wrap`