code: def gegenbauer(ctx, n, a, z, **kwargs):
      # Special cases: a+0.5, a*2 poles
      if ctx.isnpint(a):
          return 0 * (z + n)
      if ctx.isnpint(a + 0.5):
          # TODO: something else is required here
          # E.g.: gegenbauer(-2, -0.5, 3) == -12
          if ctx.isnpint(n + 1):
              raise NotImplementedError(
                  "Gegenbauer function with two limits"
              )
  
          def h(a):
              a2 = 2 * a
              T = (
                  [],
                  [],
                  [n + a2],
                  [n + 1, a2],
                  [-n, n + a2],
                  [a + 0.5],
                  0.5 * (1 - z),
              )
              return [T]
  
          return ctx.hypercomb(h, [a], **kwargs)
  
      def h(n):
          a2 = 2 * a
          T = (
              [],
              [],
              [n + a2],
              [n + 1, a2],
              [-n, n + a2],
              [a + 0.5],
              0.5 * (1 - z),
          )
          return [T]
  
      return ctx.hypercomb(h, [n], **kwargs)
  
file_path: catboost/contrib/python/mpmath/py3/mpmath/functions/orthogonal.py
imports: from .functions import defun, defun_wrapped
label_desc: Use image node_id 7 for calling a global function with example usage: gegenbauer(ctx, n, a, z) and returns: ctx, unknown, ctx, list, list