code: def beta(ctx, x, y):
      x = ctx.convert(x)
      y = ctx.convert(y)
      if ctx.isinf(y):
          x, y = y, x
      if ctx.isinf(x):
          if x == ctx.inf and not ctx._im(y):
              if y == ctx.ninf:
                  return ctx.nan
              if y > 0:
                  return ctx.zero
              if ctx.isint(y):
                  return ctx.nan
              if y < 0:
                  return ctx.sign(ctx.gamma(y)) * ctx.inf
          return ctx.nan
      xy = ctx.fadd(x, y, prec=2 * ctx.prec)
      return ctx.gammaprod([x, y], [xy])
  
file_path: catboost/contrib/python/mpmath/py3/mpmath/functions/factorials.py
imports: from ..libmp.backend import xrange
  from .functions import defun, defun_wrapped
label_desc: Use image node_id 2 for calling a global function with example usage: beta(ctx, x, y) and returns: ctx, ctx, ctx, ctx, ctx, unknown