code: def write_variant_call(writer, prediction):
      """Write the variant call based on prediction.
  
      Args:
        writer: A object with a write() function that will be called for each
          encoded_variant and genotype likelihoods.
        prediction: A [3] tensor of floats. These are the predicted genotype
          likelihoods (p00, p0x, pxx) for some alt allele x, in the same order as
          encoded_variants.
  
      Returns:
        The return status from writer.
      """
      encoded_variant = prediction["variant"]
      encoded_alt_allele_indices = prediction["alt_allele_indices"]
      rounded_gls = round_gls(
          prediction["probabilities"], precision=_GL_PRECISION
      )
  
      # Write it out.
      true_labels = (
          prediction["label"]
          if FLAGS.debugging_true_label_mode
          else None
      )
      if FLAGS.debugging_true_label_mode:
          if "label" not in prediction:
              logging.warning(
                  "No label is available for debugging_true_label_mode."
              )
          else:
              true_labels = prediction["label"]
      image_encoded = (
          prediction["image_encoded"]
          if FLAGS.include_debug_info
          else None
      )
      cvo = _create_cvo_proto(
          encoded_variant,
          rounded_gls,
          encoded_alt_allele_indices,
          true_labels,
          logits=prediction.get("logits"),
          prelogits=prediction.get("prelogits"),
          image_encoded=image_encoded,
      )
      return writer.write(cvo)
  
imports: import multiprocessing
  import os
  import time
  from typing import Any
  from absl import flags
  from absl import logging
  import numpy
  import tensorflow
  from deepvariant import dv_utils
  from deepvariant import keras_modeling
  from deepvariant import logging_level
  from deepvariant.protos import deepvariant_pb2
  from absl import app
  import multiprocessing
  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 proto_utils
  from third_party.nucleus.util import variant_utils
label_desc: Use image node_id 2 for calling a global function with example usage: write_variant_call(writer, prediction) and returns: writer