code: def order_at(a, p, t):
      """
      Computes the order of a at p, with respect to t.
  
      Explanation
      ===========
  
      For a, p in k[t], the order of a at p is defined as nu_p(a) = max({n
      in Z+ such that p**n|a}), where a != 0.  If a == 0, nu_p(a) = +oo.
  
      To compute the order at a rational function, a/b, use the fact that
      nu_p(a/b) == nu_p(a) - nu_p(b).
      """
      if a.is_zero:
          return oo
      if p == Poly(t, t):
          return a.as_poly(t).ET()[0][0]
  
      # Uses binary search for calculating the power. power_list collects the tuples
      # (p^k,k) where each k is some power of 2. After deciding the largest k
      # such that k is power of 2 and p^k|a the loop iteratively calculates
      # the actual power.
      power_list = []
      p1 = p
      r = a.rem(p1)
      tracks_power = 1
      while r.is_zero:
          power_list.append((p1, tracks_power))
          p1 = p1 * p1
          tracks_power *= 2
          r = a.rem(p1)
      n = 0
      product = Poly(1, t)
      while len(power_list) != 0:
          final = power_list.pop()
          productf = product * final[0]
          r = a.rem(productf)
          if r.is_zero:
              n += final[1]
              product = productf
      return n
  
imports: from operator import mul
  from functools import reduce
  from sympy.core import oo
  from sympy.core.symbol import Dummy
  from sympy.polys import Poly, gcd, ZZ, cancel
  from sympy.functions.elementary.complexes import im, re
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.integrals.risch import gcdex_diophantine, frac_in, derivation, splitfactor, NonElementaryIntegralException, DecrementLevel, recognize_log_derivative
label_desc: Use image node_id 1 for calling a global function with example usage: order_at(a, p, t) and returns: n, oo, a