code: def genotype_as_alleles(variant, call_ix=0):
      """Gets genotype of the sample in variant as a list of actual alleles.
  
      Returns the alleles specified by the genotype indices of variant.calls[0].
      For example, if variant.reference_bases = 'A' and variant.alternative_bases
      = ['C'] and the genotypes are [0, 1], this function will return
      ['A', 'C'].
  
      Args:
        variant: nucleus.genomics.v1.Variant.
        call_ix: int. The index into the calls attribute indicating which
          VariantCall to return alleles for.
  
      Returns:
        A list of allele (string) from variant, one for each genotype in
        variant.calls[call_ix], in order.
  
      Raises:
        ValueError: If variant doesn't have a call at the specified index.
      """
      if not 0 <= call_ix < len(variant.calls):
          raise ValueError(
              "Unsupported: requesting call {} in variant with {} calls: {}".format(
                  call_ix, len(variant.calls), variant
              )
          )
      else:
          # Genotypes are encoded as integers, where 0 is the reference allele,
          # indices > 0 refer to alt alleles, and the no-call genotypes is encoded
          # as -1 in the genotypes. This code relies on this encoding to quickly
          # reference into the alleles by adding 1 to the genotype index.
          alleles = [
              vcf_constants.MISSING_FIELD,
              variant.reference_bases,
          ] + list(variant.alternate_bases)
          return [
              alleles[i + 1] for i in variant.calls[call_ix].genotype
          ]
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import enum
  import itertools
  import six
  from third_party.nucleus.protos import variants_pb2
  from third_party.nucleus.util import ranges
  from third_party.nucleus.util import variantcall_utils
  from third_party.nucleus.util import vcf_constants
label_desc: Use image node_id 30 for calling a global function with example usage: genotype_as_alleles(variant, call_ix) and returns: unknown