code: def lgt_to_gt(lgt, la):
      """Transform LGT into GT using local alleles array.
  
      Parameters
      ----------
      lgt : :class:`.CallExpression`
          LGT value.
      la : :class:`.ArrayExpression`
          Local alleles array.
  
      Returns
      -------
      :class:`.CallExpression`
      """
      return hl.rbind(
          lgt,
          lambda lgt: hl.if_else(
              lgt.is_non_ref(),
              _func("lgt_to_gt", hl.tcall, lgt, la),
              lgt,
          ),
      )
  
imports: import hail
  from hail.expr.expressions import expr_array, expr_call, expr_int32, expr_any
  from hail.expr.functions import _func
  from hail.typecheck import typecheck, enumeration
label_desc: Use image node_id 1 for calling a global function with example usage: lgt_to_gt(lgt, la) and returns: hl