code: def write_graph(build_graph, out_dir):
      """Build a graph using build_graph and write it out."""
      g = ops.Graph()
      with g.as_default():
          build_graph(out_dir)
          filename = os.path.join(
              out_dir, "test_graph_%s.pb" % build_graph.__name__
          )
          with open(filename, "wb") as f:
              f.write(
                  six.ensure_binary(
                      g.as_graph_def().SerializeToString(
                          deterministic=True
                      )
                  )
              )
  
imports: import argparse
  import os
  import sys
  from absl import app
  import six
  from six.moves import range
  from tensorflow.core.protobuf import saver_pb2
  from tensorflow.python.client import session
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import function
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import control_flow_assert
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import control_flow_util
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.ops import variable_v1
  from tensorflow.python.ops import variables
  from tensorflow.python.training import saver
label_desc: Use image node_id 15 for calling a global function with example usage: write_graph(build_graph, out_dir) without return types