code: def ode_order(expr, func):
      """
      Returns the order of a given differential
      equation with respect to func.
  
      This function is implemented recursively.
  
      Examples
      ========
  
      >>> from sympy import Function
      >>> from sympy.solvers.deutils import ode_order
      >>> from sympy.abc import x
      >>> f, g = map(Function, ['f', 'g'])
      >>> ode_order(f(x).diff(x, 2) + f(x).diff(x)**2 +
      ... f(x).diff(x), f(x))
      2
      >>> ode_order(f(x).diff(x, 2) + g(x).diff(x, 3), f(x))
      2
      >>> ode_order(f(x).diff(x, 2) + g(x).diff(x, 3), g(x))
      3
  
      """
      a = Wild("a", exclude=[func])
      if expr.match(a):
          return 0
  
      if isinstance(expr, Derivative):
          if expr.args[0] == func:
              return len(expr.variables)
          else:
              args = expr.args[0].args
              rv = len(expr.variables)
              if args:
                  rv += max(ode_order(_, func) for _ in args)
              return rv
      else:
          return (
              max(ode_order(_, func) for _ in expr.args)
              if expr.args
              else 0
          )
  
imports: from sympy.core import Pow
  from sympy.core.function import Derivative, AppliedUndef
  from sympy.core.relational import Equality
  from sympy.core.symbol import Wild
label_desc: Use image node_id 2 for calling a global function with example usage: ode_order(expr, func) and returns: int, unknown, len, rv