code: def gammainc(ctx, z, a=0, b=None, regularized=False):
      regularized = bool(regularized)
      z = ctx.convert(z)
      if a is None:
          a = ctx.zero
          lower_modified = False
      else:
          a = ctx.convert(a)
          lower_modified = a != ctx.zero
      if b is None:
          b = ctx.inf
          upper_modified = False
      else:
          b = ctx.convert(b)
          upper_modified = b != ctx.inf
      # Complete gamma function
      if not (upper_modified or lower_modified):
          if regularized:
              if ctx.re(z) < 0:
                  return ctx.inf
              elif ctx.re(z) > 0:
                  return ctx.one
              else:
                  return ctx.nan
          return ctx.gamma(z)
      if a == b:
          return ctx.zero
      # Standardize
      if ctx.re(a) > ctx.re(b):
          return -ctx.gammainc(z, b, a, regularized)
      # Generalized gamma
      if upper_modified and lower_modified:
          return +ctx._gamma3(z, a, b, regularized)
      # Upper gamma
      elif lower_modified:
          return ctx._upper_gamma(z, a, regularized)
      # Lower gamma
      elif upper_modified:
          return ctx._lower_gamma(z, b, regularized)
  
imports: from .functions import defun, defun_wrapped
label_desc: Use image node_id 11 for calling a global function with example usage: gammainc(ctx, z, a, b, regularized) and returns: ctx, ctx, unknown, unknown, ctx, ctx, ctx, ctx, ctx