code: def process_file(input_filename, output_directory, compress):
      if not input_filename.endswith(
          ".conllu"
      ) and not input_filename.endswith(".conllu.xz"):
          print("Skipping {}".format(input_filename))
          return
  
      if input_filename.endswith(".xz"):
          open_fn = lambda x: lzma.open(x, mode="rt")
          output_filename = input_filename[:-3].replace(
              ".conllu", ".txt"
          )
      else:
          open_fn = lambda x: open(x)
          output_filename = input_filename.replace(".conllu", ".txt")
  
      if output_directory:
          output_filename = os.path.join(
              output_directory, os.path.split(output_filename)[1]
          )
  
      if compress:
          output_filename = output_filename + ".xz"
          output_fn = lambda x: lzma.open(x, mode="wt")
      else:
          output_fn = lambda x: open(x, mode="w")
  
      if os.path.exists(output_filename):
          print("Cowardly refusing to overwrite %s" % output_filename)
          return
  
      print("Converting %s to %s" % (input_filename, output_filename))
      with open_fn(input_filename) as fin:
          sentences = []
          sentence = []
          for line in fin:
              line = line.strip()
              if len(line) == 0:  # new sentence
                  sentences.append(sentence)
                  sentence = []
                  continue
              if line[0] == "#":  # comment
                  continue
              splitline = line.split("\t")
              assert len(splitline) == 10  # correct conllu
              id, word = splitline[0], splitline[1]
              if "-" not in id:  # not mwt token
                  sentence.append(word)
  
      if sentence:
          sentences.append(sentence)
  
      print("  Read in {} sentences".format(len(sentences)))
      with output_fn(output_filename) as fout:
          fout.write(
              "\n".join([" ".join(sentence) for sentence in sentences])
          )
  
imports: import argparse
  import lzma
  import sys
  import os
label_desc: Use image node_id 1 for calling a global function with example usage: process_file(input_filename, output_directory, compress) without return types