def filter_nodes(doc_words, doc_threshold = 2):
    """Filter node names with the maximum amount of files they are in

    Parameters:
    doc_words (dic): A dict of node names to SOP file paths
    doc_threshold (int): The maximum amount of files a node name can be in


    Returns:
    list:A list of included node names

    """
    allowed_nodes = []

    for k, v in doc_words.items():
        if len(v) <= doc_threshold:
            allowed_nodes.append(k)

    return allowed_nodes