def _is_function_class_equation(func_class, f, symbol):
 if (f.is_Mul or f.is_Add):
  return all((_is_function_class_equation(func_class, arg, symbol) for arg in f.args))
 if f.is_Pow:
  if (not f.exp.has(symbol)):
   return _is_function_class_equation(func_class, f.base, symbol)
  else:
   return False
 if (not f.has(symbol)):
  return True
 if isinstance(f, func_class):
  try:
   g = Poly(f.args[0], symbol)
   return (g.degree() <= 1)
  except PolynomialError:
   return False
 else:
  return False

def _is_function_class_equation ( func_class , f , symbol ) : if ( f . is_Mul or f . is_Add ) : return all ( ( _is_function_class_equation ( func_class , arg , symbol ) for arg in f . args ) ) if f . is_Pow : if ( not f . exp . has ( symbol ) ) : return _is_function_class_equation ( func_class , f . base , symbol ) else : return False if ( not f . has ( symbol ) ) : return True if isinstance ( f , func_class ) : try : g = Poly ( f . args [ 0 ] , symbol ) return ( g . degree ( ) <= 1 ) except PolynomialError : return False else : return False
tests whether the equation is an equation of the given function class .