import logging


def filter_under_n(all_trees: list, n: int) -> list:
    """ Takes a list of tree dictionaries and filter trees that have under n nodes. 
    
    Arguments:
        all_trees {list} -- list of dictionary conversation trees like [{'node_id: node object}]
        n {int} -- the minimum number of nodes accepted in the tree
    
    Returns:
        list -- list of dictionary conversation trees like [{'node_id: node object}] after processing 
    """

    all_trees_processed = []
    
    logging.info(f'filtering trees under {n} nodes, input count of trees is {len(all_trees)}')
    for tree in all_trees:
        if len(tree) >= n:
            all_trees_processed.append(tree)
        else:
            pass
    logging.info(f'filtered, output count of trees is {len(all_trees_processed)}')

    return all_trees_processed