code: def _count_base_changes_and_indel_sizes(single_stats):
      """Count each base change, such as A->G or C->T, and count the number of indels of each size.
  
      Args:
        single_stats: list of VariantStats objects.
  
      Returns:
        base_changes: {(ref, alt): count, ...}
        indel_sizes: {size: count, ...}
      """
      base_changes = collections.defaultdict(int)
      indel_sizes = collections.defaultdict(int)
      for v in single_stats:
          ref = v.reference_bases
          alts = v.alternate_bases
          # RefCalls are ignored
          if v.is_variant:
              # Multiallelic variants ignored here because they have different indel
              # sizes and/or base changes
              if v.variant_type == BIALLELIC_SNP:
                  # SNV: get base change
                  base_changes[(ref, alts[0])] += 1
              elif v.variant_type in [
                  BIALLELIC_INSERTION,
                  BIALLELIC_DELETION,
              ]:
                  # indel: get size
                  # + = insertion
                  # - = deletion
                  size = len(alts[0]) - len(ref)
                  indel_sizes[size] += 1
  
      base_changes_for_json = []
      for key in base_changes:
          ref, alt = key
          base_changes_for_json.append([ref, alt, base_changes[key]])
  
      indel_sizes_for_json = []
      for key in indel_sizes:
          indel_sizes_for_json.append([int(key), indel_sizes[key]])
  
      return base_changes_for_json, indel_sizes_for_json
  
imports: import collections
  import itertools
  import math
  import numpy
  from third_party.nucleus.util import variant_utils
  from third_party.nucleus.util import variantcall_utils
  from deepvariant import vcf_stats_vis
label_desc: Use image node_id 9 for calling a global function with example usage: _count_base_changes_and_indel_sizes(single_stats) and returns: base_changes_for_json,  indel_sizes_for_json