def sort_key(attrs, node):
    """
    Sort key for sorting lists of nodes.
    """
    acc = 0
    for i in range(len(attrs)):
        if attrs[i] in node.attrs:
            acc += 10**i
    return acc