code: def _variant_reads_threshold_selector(
      allele_counter, model_conf, expanded_region
  ):
      """Returns a list of candidate positions.
  
      Following cigar operations generate candidate position:
        - ALIGNMENT_MATCH, SEQUENCE_MISMATCH, SEQUENCE_MATCH: at mismatch positions
          in the read when compared to the reference sequence.
        - DELETE: at positions within [cigar_start, cigar_start + cigar_len)
        - INSERT, CLIP_SOFT: at positions within
            [cigar_start - cigar_len, cigar_start + cigar_len)
  
       Note. Function implementation has changed to return positions beyond input
       region in case we have variants there. See the change at internal and
       internal.
  
      Args:
        allele_counter: learning.genomics.deepvariant.realigner.AlleleCounter in the
          considered region.
        model_conf: learning.genomics.deepvariant.realigner
          .WindowSelectorOptions.VariantReadsThresholdModel options determining the
          behavior of this window selector.
        expanded_region: nucleus.protos.Range. The region we are processing.
  
      Returns:
        A list. The elements are reference positions within region.
      """
  
      counts_vec = cpp_window_selector.variant_reads_candidates_from_allele_counter(
          allele_counter
      )
  
      return [
          expanded_region.start + i
          for i, count in enumerate(counts_vec)
          if (
              count >= model_conf.min_num_supporting_reads
              and count <= model_conf.max_num_supporting_reads
          )
      ]
  
file_path: deepvariant/deepvariant/realigner/window_selector.py
imports: from third_party.nucleus.protos import reads_pb2
  from third_party.nucleus.util import ranges
  from deepvariant.protos import deepvariant_pb2
  from deepvariant.protos import realigner_pb2
  from deepvariant.python import allelecounter
  from deepvariant.realigner.python import window_selector
label_desc: Use image node_id 2 for calling a global function with example usage: _variant_reads_threshold_selector(allele_counter, model_conf, expanded_region) and returns: unknown