code: def write_lines_to_file(cls_name, filename, lines, metadata_dict):
      """Writes lines to file prepended by header and metadata."""
      metadata_dict = metadata_dict or {}
      header_line = "%s%s" % (_HEADER_PREFIX, cls_name)
      metadata_line = "%s%s" % (
          _METADATA_PREFIX,
          json.dumps(metadata_dict, sort_keys=True),
      )
      with tf.io.gfile.GFile(filename, "wb") as f:
          for line in [header_line, metadata_line]:
              f.write(tf.compat.as_bytes(line))
              f.write(tf.compat.as_bytes("\n"))
          if lines:
              f.write(tf.compat.as_bytes("\n".join(lines)))
              f.write(tf.compat.as_bytes("\n"))
  
imports: from __future__ import unicode_literals
  import abc
  import hashlib
  import json
  import re
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 9 for calling a global function with example usage: write_lines_to_file(cls_name, filename, lines, metadata_dict) without return types