<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_visit_fn(cls, kind, is_leaving=False) -> Callable: """Get the visit function for the given node kind and direction."""

        method = "leave" if is_leaving else "enter"
        visit_fn = getattr(cls, f"{method}_{kind}", None)
        if not visit_fn:
            visit_fn = getattr(cls, method, None)
        return visit_fn