code: def genotype_likelihood_index(allele_indices):
      """Returns the genotype likelihood index for the given allele indices.
  
      Args:
        allele_indices: list(int). The list of allele indices for a given genotype.
          E.g. diploid homozygous reference is represented as [0, 0].
  
      Returns:
        The index into the associated genotype likelihood array corresponding to
        the likelihood of this list of alleles.
  
      Raises:
        NotImplementedError: The allele_indices are more than diploid.
      """
      if len(allele_indices) == 1:
          # Haploid case.
          return allele_indices[0]
      elif len(allele_indices) == 2:
          # Diploid case.
          g1, g2 = sorted(allele_indices)
          return g1 + (g2 * (g2 + 1) // 2)
      else:
          raise NotImplementedError(
              "Genotype likelihood index only supports haploid and diploid: {}".format(
                  allele_indices
              )
          )
  
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 36 for calling a global function with example usage: genotype_likelihood_index(allele_indices) and returns: allele_indices, unknown