code: def write_parallel_text(sources, targets, output_prefix):
      """
      Writes two files where each line corresponds to one example
        - [output_prefix].sources.txt
        - [output_prefix].targets.txt
  
      Args:
        sources: Iterator of source strings
        targets: Iterator of target strings
        output_prefix: Prefix for the output file
      """
      source_filename = os.path.abspath(
          os.path.join(output_prefix, "sources.txt")
      )
      target_filename = os.path.abspath(
          os.path.join(output_prefix, "targets.txt")
      )
  
      with io.open(
          source_filename, "w", encoding="utf8"
      ) as source_file:
          for record in sources:
              source_file.write(record + "\n")
      print("Wrote {}".format(source_filename))
  
      with io.open(
          target_filename, "w", encoding="utf8"
      ) as target_file:
          for record in targets:
              target_file.write(record + "\n")
      print("Wrote {}".format(target_filename))
  
file_path: seq2seq/bin/tools/generate_toy_data.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import argparse
  import os
  import numpy
  import io
label_desc: Use image node_id 3 for calling a global function with example usage: write_parallel_text(sources, targets, output_prefix) without return types