def _sub_func(expr, sub_dict):
    if expr in sub_dict:
        return sub_dict[expr]
    elif not expr.args or expr.is_Derivative:
        return expr
Perform direct matching substitution, ignoring derivatives.
dataset/ETHPy150Open sympy/sympy/sympy/physics/mechanics/functions.py/_sub_func