code: def WriteGraphFiles(self, graphs):
      fnames = []
      for i, graph in enumerate(graphs):
          fname = os.path.join(self.get_temp_dir(), "graph%s.pb" % i)
          with gfile.GFile(fname, "wb") as f:
              f.write(graph.SerializeToString())
          fnames.append(fname)
      return fnames
  
file_path: tensorflow/tensorflow/python/tools/print_selective_registration_header_test.py
imports: import os
  import sys
  from google.protobuf import text_format
  from tensorflow.core.framework import graph_pb2
  from tensorflow.python.platform import gfile
  from tensorflow.python.platform import test
  from tensorflow.python.tools import selective_registration_header_lib
label_desc: Use image node_id 2 for calling the PrintOpFilegroupTest obj's underlying member method code with example usage: obj.WriteGraphFiles(graphs) and returns: fnames