def find_node(nodes, attribute, value):
    """Search among nodes by attribute.

    Args:
        nodes: list of nodes
        attribute: attribute name
        value: attribute value

    Returns:
        First matched node

    Raises:
        IndexError if unable to find the node
    """
    return [
        node for node in nodes if node.getAttribute(attribute) == value
    ][0]