def tree_type_checker(*ref):
ref = tuple(ref)<EOL>if NeuriteType.all in ref:<EOL><INDENT>def check_tree_type(_):<EOL><INDENT>'''<STR_LIT>'''<EOL>return True<EOL><DEDENT><DEDENT>else:<EOL><INDENT>def check_tree_type(tree):<EOL><INDENT>'''<STR_LIT>'''<EOL>return tree.type in ref<EOL><DEDENT><DEDENT>return check_tree_type<EOL>
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)