code: def allele_indices_with_num_alts(variant, num_alts, ploidy=2):
      """Returns a list of allele indices configurations with `num_alts` alternates.
  
      Args:
        variant: nucleus.genomics.v1.Variant. The variant of interest, which
          defines the candidate alternate alleles that can be used to generate
          allele indices configurations.
        num_alts: int in [0, `ploidy`]. The number of non-reference alleles for
          which to create the allele indices configurations.
        ploidy: int. The ploidy for which to return allele indices configurations.
  
      Returns: A list of tuples. Each tuple is of length `ploidy` and represents the
        allele indices of all `ploidy` genotypes that contain `num_alts`
        non-reference alleles.
  
      Raises:
        ValueError: The domain of `num_alts` is invalid.
        NotImplementedError: `ploidy` is not diploid.
      """
      if ploidy != 2:
          raise NotImplementedError(
              "allele_indices_with_num_alts only supports diploid."
          )
      if not 0 <= num_alts <= ploidy:
          raise ValueError(
              "Invalid number of alternate alleles requested: {} for ploidy {}".format(
                  num_alts, ploidy
              )
          )
  
      max_candidate_alt_ix = len(variant.alternate_bases)
      if num_alts == 0:
          return [(0, 0)]
      elif num_alts == 1:
          return [(0, i) for i in range(1, max_candidate_alt_ix + 1)]
      else:
          return [
              (i, j)
              for i in range(1, max_candidate_alt_ix + 1)
              for j in range(i, max_candidate_alt_ix + 1)
          ]
  
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 38 for calling a global function with example usage: allele_indices_with_num_alts(variant, num_alts, ploidy) and returns: list, unknown, unknown