code: def sign(e, x):
      """
      Returns a sign of an expression e(x) for x->oo.
  
      ::
  
          e >  0 for x sufficiently large ...  1
          e == 0 for x sufficiently large ...  0
          e <  0 for x sufficiently large ... -1
  
      The result of this function is currently undefined if e changes sign
      arbitrarily often for arbitrarily large x (e.g. sin(x)).
  
      Note that this returns zero only if e is *constantly* zero
      for x sufficiently large. [If e is constant, of course, this is just
      the same thing as the sign of e.]
      """
      if not isinstance(e, Basic):
          raise TypeError("e should be an instance of Basic")
  
      if e.is_positive:
          return 1
      elif e.is_negative:
          return -1
      elif e.is_zero:
          return 0
  
      elif not e.has(x):
          from sympy.simplify import logcombine
  
          e = logcombine(e)
          return _sign(e)
      elif e == x:
          return 1
      elif e.is_Mul:
          a, b = e.as_two_terms()
          sa = sign(a, x)
          if not sa:
              return 0
          return sa * sign(b, x)
      elif isinstance(e, exp):
          return 1
      elif e.is_Pow:
          if e.base == S.Exp1:
              return 1
          s = sign(e.base, x)
          if s == 1:
              return 1
          if e.exp.is_Integer:
              return s**e.exp
      elif isinstance(e, log):
          return sign(e.args[0] - 1, x)
  
      # if all else fails, do it the hard way
      c0, e0 = mrv_leadterm(e, x)
      return sign(c0, x)
  
imports: from functools import reduce
  from sympy.core import Basic, S, Mul, PoleError, expand_mul
  from sympy.core.cache import cacheit
  from sympy.core.intfunc import ilcm
  from sympy.core.numbers import I, oo
  from sympy.core.symbol import Dummy, Wild
  from sympy.core.traversal import bottom_up
  from sympy.functions import log, exp, sign
  from sympy.series.order import Order
  from sympy.utilities.exceptions import SymPyDeprecationWarning
  from sympy.utilities.misc import debug_decorator
  from sympy.utilities.timeutils import timethis
label_desc: Use image node_id 5 for calling a global function with example usage: sign(e, x) and returns: sign, int, unknown, int, _sign, int, unknown, int, int, int, int, unknown, sign