def _functions(expr, x):
 from sympy import Function
 return set((e.func for e in expr.atoms(Function) if (x in e.free_symbols)))

def _functions ( expr , x ) : from sympy import Function return set ( ( e . func for e in expr . atoms ( Function ) if ( x in e . free_symbols ) ) )
find the types of functions in expr .