def link_exits(self, direction, link_room):
        this_exit = self.exits.get(direction)
        that_dir = dir_opposites.get(direction)
        that_exit = link_room.exits.get(that_dir)
        if this_exit and this_exit.linked_exit:
            return ("This room's (id: " + this_exit.room.id + ") " +
                    this_exit.direction + " exit is already linked to " +
                    "room " + this_exit.to_room.id + ", area " + 
                    this_exit.to_room.area.name + ".\nYou must " +
                    "unlink it before linking it to a new room.")
        if that_exit and that_exit.linked_exit:
            return ("Room " + that_exit.room.id + "'s " +
                    that_exit.direction + " exit is already linked to " +
                    "room " + that_exit.to_room.id + ", area " + 
                    that_exit.to_room.area.name + ".\nYou must " +
                    "unlink it before linking it to a new room.")
        if this_exit:
            this_exit.to_room = link_room
        else:
            self.new_exit({'direction': direction, 'to_room':link_room})
            this_exit = self.exits[direction]
        if that_exit:
                that_exit.to_room = self
        else:
            link_room.new_exit({'direction': that_dir, 'to_room': self})
            that_exit = link_room.exits[that_dir]
        # Now that the exits have been properly created/set, set the exits to point to each other
        this_exit.linked_exit = that_exit.direction
        that_exit.linked_exit = this_exit.direction
        this_exit.save()
        that_exit.save()
        return 'Linked room %s\'s %s exit to room %s\'s %s exit.\n' % (this_exit.room.id, this_exit.direction,
                                                                      that_exit.room.id, that_exit.direction)
p2 * p1 with p2 in the coefficient domain of p1.
dataset/ETHPy150Open shinymud/ShinyMUD/src/shinymud/models/room.py/Room.link_exits--crossover with--dataset/ETHPy150Open sympy/sympy/sympy/polys/rings.py/PolyElement.__rmul__