def _add_rel(self, key, rel, thing, wrap):
        """Adds ``thing`` to links or embedded resources.

        Calling code should not use this method directly and should use
        ``embed`` or ``add_link`` instead.

        """
        self.o.setdefault(key, {})

        if wrap:
            self.o[key].setdefault(rel, [])

        if rel <= 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/operator `not in` -> `<=`