code: def process_text2sparql(
      infold: str, outfold: str, do_lower_case: bool
  ):
      """Process and convert MeetKai's text2sparql datasets to NeMo's neural machine translation format.
  
      Args:
          infold: directory path to raw text2sparql data containing
              train.tsv, test_easy.tsv, test_hard.tsv
          outfold: output directory path to save formatted data for NeuralMachineTranslationDataset
              the first line is header (sentence [tab] label)
              each line should be [sentence][tab][label]
          do_lower_case: if true, convert all sentences and labels to lower
      """
      logging.info(
          f"Processing Text2Sparql dataset and storing at: {outfold}"
      )
  
      os.makedirs(outfold, exist_ok=True)
  
      dataset_name = "Text2Sparql"
      for prefix in prefix_map:
          input_file = os.path.join(infold, prefix)
          output_file = os.path.join(outfold, prefix_map[prefix])
  
          if if_exist(outfold, [prefix_map[prefix]]):
              logging.info(
                  f"** {MODE_EXISTS_TMP.format(prefix_map[prefix], dataset_name, output_file)}"
              )
              continue
  
          if not if_exist(infold, [prefix]):
              logging.info(
                  f"** {prefix} of {dataset_name}"
                  f" is skipped as it was not found"
              )
              continue
  
          assert (
              input_file != output_file
          ), "input file cannot equal output file"
          with open(input_file, "r") as in_file:
              with open(output_file, "w") as out_file:
                  reader = csv.reader(in_file, delimiter="\t")
  
                  # replace headers
                  out_file.write("sentence\tlabel\n")
                  next(reader)
  
                  for line in reader:
                      sentence = line[0]
                      label = line[1]
                      if do_lower_case:
                          sentence = sentence.lower()
                          label = label.lower()
                      out_file.write(f"{sentence}\t{label}\n")
  
imports: import argparse
  import csv
  import os
  from urllib.request import Request, urlopen
  from nemo.collections.nlp.data.data_utils.data_preprocessing import MODE_EXISTS_TMP, if_exist
  from nemo.utils import logging
label_desc: Use image node_id 2 for calling a global function with example usage: process_text2sparql(infold, outfold, do_lower_case) without return types