code: def expint(ctx, n, z):
      if ctx.isint(n) and ctx._is_real_type(z):
          try:
              return ctx._expint_int(n, z)
          except NotImplementedError:
              pass
      if ctx.isnan(n) or ctx.isnan(z):
          return z * n
      if z == ctx.inf:
          return 1 / z
      if z == 0:
          # integral from 1 to infinity of t^n
          if ctx.re(n) <= 1:
              # TODO: reasonable sign of infinity
              return type(z)(ctx.inf)
          else:
              return ctx.one / (n - 1)
      if n == 0:
          return ctx.exp(-z) / z
      if n == -1:
          return ctx.exp(-z) * (z + 1) / z**2
      return z ** (n - 1) * ctx.gammainc(1 - n, z)
  
imports: from .functions import defun, defun_wrapped
label_desc: Use image node_id 15 for calling a global function with example usage: expint(ctx, n, z) and returns: unknown, unknown, unknown, unknown, unknown, ctx, type, unknown