class_docstr: Tests of input_fn, doing end-to-end I/O.
  
  These tests instantiate an input stream and then check it in various ways,
  in increasing complexity.
class_docstr_tok: ["Tests","of","input_fn",",","doing","end-to-end","I\/O",".","These","tests","instantiate","an","input","stream","and","then","check","it","in","various","ways",",","in","increasing","complexity","."]
code: def testGoldenCallingExamples(self, use_tpu):
      # Read the golden calling examples, and read the batch_feed instantiated
      # from the golden calling examples, and ensure that we get the same
      # parsed records in both cases.
  
      # Read and parse the canonical data.
      expected_decoded_records = list(
          tfrecord.read_tfrecords(
              testdata.GOLDEN_CALLING_EXAMPLES,
              proto=example_pb2.Example,
          )
      )
  
      # Read and parse the data using tf.  This is the function under test,
      # although we indirectly check parse_tfexample as well.
      batch_feed = self.get_batch_feed(batch_size=1, use_tpu=use_tpu)
  
      with tf.compat.v1.Session() as sess:
          sess.run(tf.compat.v1.local_variables_initializer())
          sess.run(tf.compat.v1.global_variables_initializer())
  
          n = 0
          while True:
              # Read from batch.
              try:
                  features = sess.run(batch_feed)
              except tf.errors.OutOfRangeError:
                  break
  
              # Get the corresponding parsed golden example.
              example = expected_decoded_records[n]
              expected_alt_allele_indices_encoded = (
                  example.features.feature[
                      "alt_allele_indices/encoded"
                  ].bytes_list.value[0]
              )
              expected_variant_encoded = example.features.feature[
                  "variant/encoded"
              ].bytes_list.value[0]
              expected_sequencing_type = example.features.feature[
                  "sequencing_type"
              ].int64_list.value[0]
  
              # Compare against the parsed batch feed.
  
              a = features["image"][0]  # np.ndarray
              self.assertEqual(
                  list(a.shape), dv_constants.PILEUP_DEFAULT_DIMS
              )
              self.assertIsNotNone(a)
              if use_tpu:
                  self.assertEqual(a.dtype, np.dtype("int32"))
              else:
                  self.assertEqual(a.dtype, np.dtype("uint8"))
  
              a = features["alt_allele_indices"][0]
              if use_tpu:
                  self.assertEqual(a.dtype, np.dtype("int32"))
                  self.assertEqual(
                      a.shape, (dv_utils.STRING_TO_INT_BUFFER_LENGTH,)
                  )
                  actual_alt_allele_indices_encoded = (
                      dv_utils.int_tensor_to_string(a)
                  )
              else:
                  self.assertIsInstance(a, bytes)
                  actual_alt_allele_indices_encoded = a
              self.assertEqual(
                  expected_alt_allele_indices_encoded,
                  actual_alt_allele_indices_encoded,
              )
  
              a = features["variant"][0]
              if use_tpu:
                  self.assertEqual(a.dtype, np.dtype("int32"))
                  self.assertEqual(
                      a.shape, (dv_utils.STRING_TO_INT_BUFFER_LENGTH,)
                  )
                  actual_variant_encoded = (
                      dv_utils.int_tensor_to_string(a)
                  )
              else:
                  self.assertIsInstance(a, bytes)
                  actual_variant_encoded = a
              self.assertEqual(
                  expected_variant_encoded, actual_variant_encoded
              )
  
              self.assertEqual(
                  features["sequencing_type"], expected_sequencing_type
              )
  
              n += 1
  
          self.assertEqual(n, testdata.N_GOLDEN_CALLING_EXAMPLES)
  
imports: import math
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow import estimator
  from deepvariant import data_providers
  from deepvariant import dv_config
  from deepvariant import dv_constants
  from deepvariant import dv_utils
  from deepvariant import testdata
  from deepvariant.protos import deepvariant_pb2
  from third_party.nucleus.io import tfrecord
  from third_party.nucleus.testing import test_utils
  from third_party.nucleus.util import variant_utils
  from tensorflow.core.example import example_pb2
label_desc: Use image node_id 5 for calling the InputTest obj's underlying member method code with example usage: obj.testGoldenCallingExamples(use_tpu) without return types