code: def write_variant_call(writer, prediction, use_tpu):
      """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.
          use_tpu: bool.  Decode the tpu specific encoding of prediction.
  
      Returns:
        The return status from writer.
      """
      encoded_variant = prediction["variant"]
      if use_tpu:
          encoded_variant = dv_utils.int_tensor_to_string(
              encoded_variant
          )
  
      encoded_alt_allele_indices = prediction["alt_allele_indices"]
      if use_tpu:
          encoded_alt_allele_indices = dv_utils.int_tensor_to_string(
              encoded_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
      )
      cvo = _create_cvo_proto(
          encoded_variant,
          rounded_gls,
          encoded_alt_allele_indices,
          true_labels,
          logits=prediction.get("logits"),
          prelogits=prediction.get("prelogits"),
      )
      return writer.write(cvo)
  
imports: import os
  import time
  from absl import flags
  from absl import logging
  import numpy
  import tensorflow
  from tensorflow import estimator
  from deepvariant import data_providers
  from deepvariant import dv_utils
  from deepvariant import logging_level
  from deepvariant import modeling
  from deepvariant.protos import deepvariant_pb2
  from google.protobuf import text_format
  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 3 for calling a global function with example usage: write_variant_call(writer, prediction, use_tpu) and returns: writer