code: def get_short_id(
      variant: variants_pb2.Variant, indices: Sequence[int]
  ) -> str:
      """Prepare a locus ID, shortening ref and alt if necessary.
  
      Examples of long alleles replaced with their sizes:
      20:62456134_INS103bp.png
      20:62481177_DEL51bp.png
      Examples of short alleles where the full string is included:
      1:55424995_TC->T.png
      1:55424996_CT->CTT.png
      1:55424996_CT->C.png
      1:55424996_CT->TTT.png
      1:55424996_CT->C|CTT.png
  
      Args:
        variant: Variant object from which to get locus position and alleles.
        indices: list of allele indices for this particular pileup image.
  
      Returns:
        A short ID packed with variant information.
      """
  
      pos_prefix = "{}:{}".format(variant.reference_name, variant.start)
  
      ref_bases = variant.reference_bases
  
      alts = variant.alternate_bases
  
      # If any ref or alt strings are too long, shorten them all.
      if len(ref_bases) > MAX_SIZE_TO_PRINT or any(
          [len(alts[i]) > MAX_SIZE_TO_PRINT for i in indices]
      ):
          # If any alts are the same length (rare but possible), include their IDs.
          use_alt_indices = len(set([len(a) for a in alts])) < len(alts)
          alt_types = []
          for i in indices:
              a = alts[i]
              diff = len(a) - len(ref_bases)
              optional_id = "alt{}".format(i) if use_alt_indices else ""
              alt_type = ""
              if diff < 0:
                  alt_type = "DEL{}bp".format(-1 * diff)
              elif diff > 0:
                  alt_type = "INS{}bp".format(diff)
              else:
                  alt_type = "MNP{}bp".format(len(a))
              alt_types.append("{}{}".format(optional_id, alt_type))
          return "{}_{}".format(pos_prefix, "|".join(alt_types))
      else:
          # If ref and alts are short enough, show them fully: e.g. A->AG|C
          alt_strings = [alts[i] for i in indices]
          return "{}_{}->{}".format(
              pos_prefix, ref_bases, "|".join(alt_strings)
          )
  
imports: import gzip
  import json
  import os
  from typing import Any, Callable, Dict, Optional, Sequence, Set
  from absl import app
  from absl import flags
  from absl import logging
  import pandas
  import tensorflow
  from deepvariant.protos import deepvariant_pb2
  from third_party.nucleus.io import sharded_file_utils
  from third_party.nucleus.io import tfrecord
  from third_party.nucleus.protos import variants_pb2
  from third_party.nucleus.util import errors
  from third_party.nucleus.util import ranges
  from third_party.nucleus.util import vis
label_desc: Use image node_id 3 for calling a global function with example usage: get_short_id(variant, indices) and returns: str, str