<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def place2thing(self, name, location):
 """Turn a Place into a Thing with the given location. It will keep all its attached Portals. """

        self.engine._set_thing_loc(
            self.name, name, location
        )
        if (self.name, name) in self.engine._node_objs:
            obj = self.engine._node_objs[self.name, name]
            thing = Thing(self, name)
            for port in obj.portals():
                port.origin = thing
            for port in obj.preportals():
                port.destination = thing
            self.engine._node_objs[self.name, name] = thing