def __setitem__(self, key, val):
        """The idea here is that a key and a value are interchangeable,
        but either direction should still enforce the rules of a traditional
        map (or dictionary, in this case.)"""
        keys = self.items.keys()
        values = self.items.values()
        is_both_key = key in keys and values in key
        is_both_val = val in keys and val in values
        if is_both_key or is_both_val:
            raise ValueError(
                'Item already exists in both key and value'
                ' -- it can only exist in one!')
        super(BidirectionalMap, self).__setitem__(key, val)
dataset/ETHPy150Open christabor/MoAL/MOAL/data_structures/abstract/map.py/BidirectionalMap.__setitem__/swapped operands of `in`