code: def _group_overlapping_variants(sorted_variants):
      """Yields lists of Variant protos that overlap on the reference sequence.
  
      Args:
        sorted_variants: Iterable of Variant protos, sorted in coordinate order.
  
      Yields:
        Lists of variants within `sorted_variants` that overlap with each other on
        the reference sequence.
      """
      curr_variants = []
      prev_chrom = None
      prev_max_end = -1
      for variant in sorted_variants:
          if (
              variant.reference_name != prev_chrom
              or variant.start >= prev_max_end
          ):
              if curr_variants:
                  yield curr_variants
              curr_variants = [variant]
              prev_chrom = variant.reference_name
              prev_max_end = variant.end
          else:
              curr_variants.append(variant)
              prev_max_end = max(prev_max_end, variant.end)
      # Fencepost.
      if curr_variants:
          yield curr_variants
  
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 2 for calling a global function with example usage: _group_overlapping_variants(sorted_variants) without return types