code: def parse_allele_specific_ranksum(string, has_non_ref):
      typ = hl.ttuple(hl.tfloat64, hl.tint32)
      items = string.split(r"\|")
      items = hl.if_else(has_non_ref, items[:-1], items)
      return items.map(
          lambda s: hl.if_else(
              (hl.len(s) == 0) | (s == "."),
              hl.missing(typ),
              hl.rbind(
                  s.split(","),
                  lambda ss: hl.if_else(
                      hl.len(ss)
                      != 2,  # bad field, possibly 'NaN', just set it null
                      hl.missing(hl.ttuple(hl.tfloat64, hl.tint32)),
                      hl.tuple([hl.float64(ss[0]), hl.int32(ss[1])]),
                  ),
              ),
          )
      )
  
imports: import math
  from typing import Collection, Optional, Set, Union, List, Tuple, Dict
  import hail
  from hail import MatrixTable, Table
  from hail.experimental.function import Function
  from hail.expr import StructExpression, unify_all, construct_expr
  from hail.expr.expressions import expr_bool, expr_str
  from hail.genetics.reference_genome import reference_genome_type
  from hail.ir import Apply, TableMapRows
  from hail.typecheck import oneof, sequenceof, typecheck
  from ..variant_dataset import VariantDataset
label_desc: Use image node_id 14 for calling a global function with example usage: parse_allele_specific_ranksum(string, has_non_ref) and returns: items