def get_port_at(self, tile_id, direction):
        """
        If no port is found, a new none port is made and added to self.ports.

        Returns the port.

        :param tile_id:
        :param direction:
        :return: Port
        """
        for port in self.ports:
            if port.tile_id == tile_id and port.direction == direction:
                return port
        port = Port(tile_id, direction, PortType.none)
        self.ports.append(port)
        return port
def get_port_at ( self , tile_id , direction ) : for port in self . ports : if port . tile_id == tile_id and port . direction == direction : return port port = Port ( tile_id , direction , PortType . none ) self . ports . append ( port ) return port
If no port is found, a new none port is made and added to self.ports.

        Returns the port.

        :param tile_id:
        :param direction:
        :return: Port