def find_nodes_by_attr(subtree, attr, value):
    """
    Returns list of nodes in `subtree` that have attribute `attr` equal to `value`.
    """
    results = []
    if subtree[attr] == value:
        results.append(subtree)
    if 'children' in subtree:
        for child in subtree['children']:
            child_restuls = find_nodes_by_attr(child, attr, value)
            results.extend(child_restuls)
    return results