def find_node_by_coords(coords, nodes):
    """returns the first node, that has the given coordinates"""
    x_value, y_value = coords
    node = [node for node in nodes if node.x_coord == x_value and node.
        y_coord == y_value]
    if len(node):
        return node[0]
    else:
        return None
