code: def testDumpToFile(self):
      ops.reset_default_graph()
      outfile = os.path.join(test.get_temp_dir(), "dump")
      opts = (
          builder(builder.trainable_variables_parameter())
          .with_file_output(outfile)
          .build()
      )
  
      with session.Session(
          config=self._no_rewrite_session_config()
      ) as sess:
          _ = lib.BuildSmallModel()
          model_analyzer.profile(sess.graph, options=opts)
  
          with gfile.Open(outfile, "r") as f:
              self.assertEqual(
                  "node name | # parameters\n"
                  "_TFProfRoot (--/451 params)\n"
                  "  DW (3x3x3x6, 162/162 params)\n"
                  "  DW2 (2x2x6x12, 288/288 params)\n"
                  "  ScalarW (1, 1/1 params)\n",
                  lib.CheckAndRemoveDoc(f.read()),
              )
  
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 2 for calling the PrintModelAnalysisTest obj's underlying member method code with example usage: obj.testDumpToFile() without return types