code: def write_vocabulary_file(vocabulary):
      """Write temporary vocab file for module construction."""
      tmpdir = tempfile.mkdtemp()
      vocabulary_file = os.path.join(tmpdir, "tokens.txt")
      with tf.io.gfile.GFile(vocabulary_file, "w") as f:
          for entry in vocabulary:
              f.write(entry + "\n")
      return vocabulary_file
  
imports: import os
  import tempfile
  import tensorflow.compat.v1
  from tensorflow.compiler.mlir.tensorflow.tests.tf_saved_model import common_v1
label_desc: Use image node_id 1 for calling a global function with example usage: write_vocabulary_file(vocabulary) and returns: vocabulary_file