code: def _call_end2end_helper(self, examples_path, model, shard_inputs):
      examples = list(tfrecord.read_tfrecords(examples_path))
  
      if shard_inputs:
          # Create a sharded version of our golden examples.
          source_path = test_utils.test_tmpfile("sharded@{}".format(3))
          tfrecord.write_tfrecords(examples, source_path)
      else:
          source_path = examples_path
  
      # If we point the test at a headless server, it will often be 2x2,
      # which has 8 replicas.  Otherwise a smaller batch size is fine.
      if FLAGS.use_tpu:
          batch_size = 8
      else:
          batch_size = 4
  
      if model.name == "constant":
          # For the constant model we can run everything.
          max_batches = None
      else:
          # For all other models we only run a single batch for inference.
          max_batches = 1
  
      outfile = test_utils.test_tmpfile("call_variants.tfrecord")
      call_variants_slim.call_variants(
          examples_filename=source_path,
          checkpoint_path=_LEAVE_MODEL_UNINITIALIZED,
          model=model,
          output_file=outfile,
          batch_size=batch_size,
          max_batches=max_batches,
          primary="",
          use_tpu=FLAGS.use_tpu,
      )
  
      call_variants_outputs = list(
          tfrecord.read_tfrecords(
              outfile, deepvariant_pb2.CallVariantsOutput
          )
      )
  
      return call_variants_outputs, examples, batch_size, max_batches
  
imports: import collections
  import errno
  import sys
  from unittest import mock
  from absl import flags
  from absl import logging
  from absl.testing import absltest
  from absl.testing import flagsaver
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow import estimator
  from deepvariant import call_variants_slim
  from deepvariant import dv_utils
  from deepvariant import modeling
  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
label_desc: Use image node_id 7 for calling the CallVariantsEndToEndTests obj's underlying member method code with example usage: obj._call_end2end_helper(examples_path, model, shard_inputs) and returns: call_variants_outputs,  examples,  batch_size,  max_batches