code: def merge(x):
      """
      Puts one article per line
      """
      file_list, output_filename = x
      article_lines = []
      article_open = False
  
      with open(output_filename, mode="w", newline="\n") as ofile:
          for filename in file_list:
              with open(filename, mode="r", newline="\n") as file:
                  for line in file:
                      if "<doc id=" in line:
                          article_open = True
                      elif "</doc>" in line:
                          article_open = False
                          for oline in article_lines[1:]:
                              if oline != "\n":
                                  ofile.write(oline.rstrip() + " ")
                          ofile.write("\n\n")
                          article_lines = []
                      else:
                          if article_open:
                              article_lines.append(line)
  
imports: import os
  import sys
  import glob
  import math
  import time
  import tarfile
  import argparse
  import multiprocessing
  from collections import defaultdict
  from gluonnlp.utils.misc import download, load_checksum_stats
  from gluonnlp.utils.lazy_imports import try_import_wikiextractor
  from gluonnlp.base import get_repo_url
  from itertools import islice
  import nltk
  import statistics
  from segment_sentences import Sharding, segment_sentences, NLTKSegmenter
label_desc: Use image node_id 3 for calling a global function with example usage: merge(x) without return types