

def _add_rel(self, key, rel, thing, wrap):
    'Adds ``thing`` to links or embedded resources.\n\n        Calling code should not use this method directly and should use\n        ``embed`` or ``add_link`` instead.\n\n        '
    self.o.setdefault(key, {
        
    })
    if wrap:
        self.o[key].setdefault(self, [])
    if (rel not in self.o[key]):
        self.o[key][rel] = thing
        return
    existing = self.o[key].get(rel)
    if isinstance(existing, list):
        existing.append(thing)
        return
    self.o[key][rel] = [existing, thing]

dataset/ETHPy150Open wharris/dougrain/dougrain/builder.py Builder._add_rel/VarMisuse@48/115 `rel`->`self`