code: def process_sst2(infold, outfold, uncased, splits=["train", "dev"]):
      """Process sst2 dataset."""
      # "test" split doesn't have labels, so it is skipped
      if not os.path.exists(infold):
          link = "https://dl.fbaipublicfiles.com/glue/data/SST-2.zip"
          raise ValueError(
              f"Data not found at {infold}. Please download SST-2 dataset from `{link}` and "
              f"extract it into the folder specified by `source_data_dir` argument."
          )
  
      logging.info(f"Processing SST-2 dataset")
      os.makedirs(outfold, exist_ok=True)
  
      def _read_tsv(input_file, quotechar=None):
          """Read a tab separated value file."""
          with open(input_file, "r") as f:
              reader = csv.reader(
                  f, delimiter="\t", quotechar=quotechar
              )
              lines = []
              for line in reader:
                  lines.append(line)
              return lines
  
      for split in splits:
          # Load input file.
          input_file = os.path.join(infold, split + ".tsv")
          lines = _read_tsv(input_file)
          # Create output.
          outfile = open(os.path.join(outfold, split + ".tsv"), "w")
  
          # Copy lines, skip the header (line 0).
          for line in lines[1:]:
              text = line[0]
              label = line[1]
              # Lowercase when required.
              if uncased:
                  text = text.lower()
              # Write output.
              outfile.write(f"{text}\t{label}\n")
          # Close file.
          outfile.close()
  
      class_labels_file = open(
          os.path.join(outfold, "label_ids.tsv"), "w"
      )
      class_labels_file.write("negative\npositive\n")
      class_labels_file.close()
  
      logging.info(f"Result stored at {outfold}")
  
file_path: NeMo/examples/nlp/text_classification/data/import_datasets.py
imports: import argparse
  import csv
  import glob
  import os
  from os.path import exists
  import tqdm
  from nemo.utils import logging
label_desc: Use image node_id 2 for calling a global function with example usage: process_sst2(infold, outfold, uncased, splits) and returns: lines