<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def tree_type_checker(*ref):
    '''Tree type checker functor

    Returns:
        Functor that takes a tree, and returns true if that tree matches any of
        NeuriteTypes in ref

    Ex:
        >>> from neurom.core.types import NeuriteType, tree_type_checker
        >>> tree_filter = tree_type_checker(NeuriteType.axon, NeuriteType.basal_dendrite)
        >>> nrn.i_neurites(tree.isegment, tree_filter=tree_filter)
    '''
    ref = tuple(ref)
    if NeuriteType.all in ref:
        def check_tree_type(_):
            '''Always returns true'''
            return True
    else:
        def check_tree_type(tree):
            '''Check whether tree has the same type as ref

            Returns:
                True if ref in the same type as tree.type or ref is NeuriteType.all
            '''
            return tree.type in ref

    return check_tree_type