code: def _preprocess(expr, func=None, hint="_Integral"):
      """Prepare expr for solving by making sure that differentiation
      is done so that only func remains in unevaluated derivatives and
      (if hint does not end with _Integral) that doit is applied to all
      other derivatives. If hint is None, do not do any differentiation.
      (Currently this may cause some simple differential equations to
      fail.)
  
      In case func is None, an attempt will be made to autodetect the
      function to be solved for.
  
      >>> from sympy.solvers.deutils import _preprocess
      >>> from sympy import Derivative, Function
      >>> from sympy.abc import x, y, z
      >>> f, g = map(Function, 'fg')
  
      If f(x)**p == 0 and p>0 then we can solve for f(x)=0
      >>> _preprocess((f(x).diff(x)-4)**5, f(x))
      (Derivative(f(x), x) - 4, f(x))
  
      Apply doit to derivatives that contain more than the function
      of interest:
  
      >>> _preprocess(Derivative(f(x) + x, x))
      (Derivative(f(x), x) + 1, f(x))
  
      Do others if the differentiation variable(s) intersect with those
      of the function of interest or contain the function of interest:
  
      >>> _preprocess(Derivative(g(x), y, z), f(y))
      (0, f(y))
      >>> _preprocess(Derivative(f(y), z), f(y))
      (0, f(y))
  
      Do others if the hint does not end in '_Integral' (the default
      assumes that it does):
  
      >>> _preprocess(Derivative(g(x), y), f(x))
      (Derivative(g(x), y), f(x))
      >>> _preprocess(Derivative(f(x), y), f(x), hint='')
      (0, f(x))
  
      Do not do any derivatives if hint is None:
  
      >>> eq = Derivative(f(x) + 1, x) + Derivative(f(x), y)
      >>> _preprocess(eq, f(x), hint=None)
      (Derivative(f(x) + 1, x) + Derivative(f(x), y), f(x))
  
      If it's not clear what the function of interest is, it must be given:
  
      >>> eq = Derivative(f(x) + g(x), x)
      >>> _preprocess(eq, g(x))
      (Derivative(f(x), x) + Derivative(g(x), x), g(x))
      >>> try: _preprocess(eq)
      ... except ValueError: print("A ValueError was raised.")
      A ValueError was raised.
  
      """
      if isinstance(expr, Pow):
          # if f(x)**p=0 then f(x)=0 (p>0)
          if (expr.exp).is_positive:
              expr = expr.base
      derivs = expr.atoms(Derivative)
      if not func:
          funcs = set().union(*[d.atoms(AppliedUndef) for d in derivs])
          if len(funcs) != 1:
              raise ValueError(
                  "The function cannot be "
                  "automatically detected for %s." % expr
              )
          func = funcs.pop()
      fvars = set(func.args)
      if hint is None:
          return expr, func
      reps = [
          (d, d.doit())
          for d in derivs
          if not hint.endswith("_Integral")
          or d.has(func)
          or set(d.variables) & fvars
      ]
      eq = expr.subs(reps)
      return eq, func
  
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 1 for calling a global function with example usage: _preprocess(expr, func, hint) and returns: eq,  func, expr,  func