code: def _trainLoop(
      self,
      train_op,
      train_steps,
      time_dir,
      time_step,
      memory_dir,
      memory_step,
      profile_dir,
      dump_step,
  ):
      with session.Session(
          config=self._no_rewrite_session_config()
      ) as sess:
          self.evaluate(variables.global_variables_initializer())
          # start from 1 because variable_initializer took one step.
          for i in range(1, train_steps + 1):
              _ = self.evaluate(train_op)
              if i in time_step:
                  ret = gfile.ListDirectory(time_dir)
                  self.assertEqual(len(ret), 1)
                  self.assertTrue(
                      gfile.Open(os.path.join(time_dir, ret[0]), "r")
                      .read()
                      .find("execution time")
                      > 0
                  )
                  _ = [
                      gfile.Remove(os.path.join(time_dir, x))
                      for x in ret
                  ]
              else:
                  self.assertEqual(
                      len(gfile.ListDirectory(time_dir)), 0
                  )
              if i in memory_step:
                  ret = gfile.ListDirectory(memory_dir)
                  self.assertEqual(len(ret), 1)
                  self.assertTrue(
                      gfile.Open(os.path.join(memory_dir, ret[0]), "r")
                      .read()
                      .find("requested bytes")
                      > 0
                  )
                  _ = [
                      gfile.Remove(os.path.join(memory_dir, x))
                      for x in ret
                  ]
              else:
                  self.assertEqual(
                      len(gfile.ListDirectory(memory_dir)), 0
                  )
              if i in dump_step:
                  ret = gfile.ListDirectory(profile_dir)
                  self.assertAllEqual(ret, ["profile_%d" % i])
                  _ = [
                      gfile.Remove(os.path.join(profile_dir, x))
                      for x in ret
                  ]
              else:
                  if i < dump_step[0]:
                      self.assertFalse(gfile.Exists(profile_dir))
                  else:
                      self.assertEqual(
                          len(gfile.ListDirectory(profile_dir)), 0
                      )
  
imports: import gzip
  import io
  import os
  import random
  import re
  import numpy
  from tensorflow.core.profiler import profile_pb2
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.core.protobuf import rewriter_config_pb2
  from tensorflow.python.client import session
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradients
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.ops import while_loop
  from tensorflow.python.platform import gfile
  from tensorflow.python.platform import test
  from tensorflow.python.profiler import model_analyzer
  from tensorflow.python.profiler import option_builder
  from tensorflow.python.profiler import profile_context
  from tensorflow.python.profiler.internal import model_analyzer_testlib
  from tensorflow.python.util import compat
label_desc: Use image node_id 15 for calling the PrintModelAnalysisTest obj's underlying member method code with example usage: obj._trainLoop(train_op, train_steps, time_dir, time_step, memory_dir, memory_step, profile_dir, dump_step) without return types