code: def testBasicTrainLoop(self):
      logdir = _test_dir("basic_train_loop")
      # Counts the number of calls.
      num_calls = [0]
  
      def train_fn(unused_sess, sv, y, a):
          num_calls[0] += 1
          self.assertEqual("y", y)
          self.assertEqual("A", a)
          if num_calls[0] == 3:
              sv.request_stop()
  
      with ops.Graph().as_default():
          sv = supervisor.Supervisor(logdir=logdir)
          basic_loops.basic_train_loop(
              sv, train_fn, args=(sv, "y"), kwargs={"a": "A"}
          )
          self.assertEqual(3, num_calls[0])
  
file_path: tensorflow/tensorflow/python/training/basic_loops_test.py
imports: import os
  import shutil
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import ops
  from tensorflow.python.platform import test
  from tensorflow.python.training import basic_loops
  from tensorflow.python.training import supervisor
label_desc: Use image node_id 1 for calling the BasicTrainLoopTest obj's underlying member method code with example usage: obj.testBasicTrainLoop() without return types