code: def _log_beta_1(alpha, value, is_sparse):
      if is_sparse:
          mask = value != 0
          value, alpha, mask = torch.broadcast_tensors(
              value, alpha, mask
          )
          result = torch.zeros_like(value)
          value = value[mask]
          alpha = alpha[mask]
          result[mask] = (
              torch.lgamma(1 + value)
              + torch.lgamma(alpha)
              - torch.lgamma(value + alpha)
          )
          return result
      else:
          return (
              torch.lgamma(1 + value)
              + torch.lgamma(alpha)
              - torch.lgamma(value + alpha)
          )
  
imports: import numbers
  import torch
  from torch.distributions.utils import broadcast_all
  from pyro.ops.special import log_beta, log_binomial
  from .None import constraints
  from .torch import Beta, Binomial, Dirichlet, Gamma, Multinomial, Poisson
  from .torch_distribution import TorchDistribution
  from .util import broadcast_shape
label_desc: Use image node_id 1 for calling a global function with example usage: _log_beta_1(alpha, value, is_sparse) and returns: result, unknown