code: def _get_all_allele_indices_configurations(
      variants, nonref_count_configuration
  ):
      """Returns an iterable of allele configurations that satisfy the genotype.
  
      Args:
        variants: list(Variant). The list of variants for which to generate
          configurations of valid allele_indices.
        nonref_count_configuration: list(int). The list of numbers of non-reference
          genotypes that should be generated for each variant.
  
      Returns:
        Iterable of lists of allele indices to assign to each Variant to satisfy the
        desired configuration of number of non-reference genotypes for each variant.
  
      Raises:
        ValueError: variants and nonref_count_configuration do not have the same
        length.
      """
      if len(variants) != len(nonref_count_configuration):
          raise ValueError(
              "len(variants) must equal len(nonref_count_configuration): {} vs {}".format(
                  len(variants), len(nonref_count_configuration)
              )
          )
  
      allele_indices_configs = [
          variant_utils.allele_indices_with_num_alts(
              variant, num_alts, ploidy=2
          )
          for variant, num_alts in zip(
              variants, nonref_count_configuration
          )
      ]
      return itertools.product(*allele_indices_configs)
  
imports: import copy
  import itertools
  from absl import flags
  from absl import logging
  import numpy
  from third_party.nucleus.util import genomics_math
  from third_party.nucleus.util import variant_utils
label_desc: Use image node_id 5 for calling a global function with example usage: _get_all_allele_indices_configurations(variants, nonref_count_configuration) and returns: itertools