class_docstr:     # TODO citation
  
      Examples:
  
      .. code-block:: python
          from openprompt.data_utils.conditional_generation_dataset import PROCESSORS
  
          base_path = os.path.join(root_dir, "datasets/Reasoning")
          dataset_name = "csqa"
          dataset_path = os.path.join(base_path, dataset_name)
          processor = PROCESSORS[dataset_name.lower()]()
          train_dataset = processor.get_train_examples(dataset_path)
          valid_dataset = processor.get_dev_examples(dataset_path)
          test_dataset = processor.get_test_examples(dataset_path)
  
          assert len(train_dataset) == 9741
          assert len(valid_dataset) == 1221
          assert len(test_dataset) == 1140
          assert train_dataset[0].text_a == "The sanctions against the school were a punishing blow, and they seemed to what the efforts the school had made to change?"
          assert train_dataset[0].text_b == ""
          assert train_dataset[0].tgt_text == "A"
          assert train_dataset[0].meta == {'choices': [{'label': 'A', 'text': 'ignore'}, {'label': 'B', 'text': 'enforce'}, {'label': 'C', 'text': 'authoritarian'}, {'label': 'D', 'text': 'yell at'}, {'label': 'E', 'text': 'avoid'}], 'choices_text': '(A) ignore
  (B) enforce
  (C) authoritarian
  (D) yell at
  (E) avoid'}
  
      
class_docstr_tok: ["#","TODO","citation","Examples",":","..","code-block",":",":","python","from","openprompt.data_utils.conditional_generation_dataset","import","PROCESSORS","base_path","=","os.path.join","(","root_dir",",","``","datasets\/Reasoning","''",")","dataset_name","=","``","csqa","''","dataset_path","=","os.path.join","(","base_path",",","dataset_name",")","processor","=","PROCESSORS","[","dataset_name.lower","(",")","]","(",")","train_dataset","=","processor.get_train_examples","(","dataset_path",")","valid_dataset","=","processor.get_dev_examples","(","dataset_path",")","test_dataset","=","processor.get_test_examples","(","dataset_path",")","assert","len","(","train_dataset",")","==","9741","assert","len","(","valid_dataset",")","==","1221","assert","len","(","test_dataset",")","==","1140","assert","train_dataset","[","0","]",".text_a","==","``","The","sanctions","against","the","school","were","a","punishing","blow",",","and","they","seemed","to","what","the","efforts","the","school","had","made","to","change","?","''","assert","train_dataset","[","0","]",".text_b","==","``","''","assert","train_dataset","[","0","]",".tgt_text","==","``","A","''","assert","train_dataset","[","0","]",".meta","==","{","'choices","'",":","[","{","'label","'",":","'","A","'",",","'text","'",":","'ignore","'","}",",","{","'label","'",":","'","B","'",",","'text","'",":","'enforce","'","}",",","{","'label","'",":","'","C","'",",","'text","'",":","'authoritarian","'","}",",","{","'label","'",":","'D","'",",","'text","'",":","'yell","at","'","}",",","{","'label","'",":","'","E","'",",","'text","'",":","'avoid","'","}","]",",","'choices_text","'",":","'","(","A",")","ignore","(","B",")","enforce","(","C",")","authoritarian","(","D",")","yell","at","(","E",")","avoid","'","}"]
code: def get_examples(
      self, data_dir: str, split: str
  ) -> List[InputExample]:
      examples = []
      path = os.path.join(data_dir, self.split2file[split])
      i = 0
      with open(path) as f:
          for line in f.readlines():
              if line.strip():
                  data = json.loads(line)
                  context = data["question"]["stem"]
                  choices = data["question"]["choices"]
                  tgt_text = data.get("answerKey", None)
                  example = InputExample(
                      guid=str(i),
                      text_a=context,
                      tgt_text=tgt_text,
                      meta={"choices": choices},
                  )
                  examples.append(example)
                  i += 1
      return examples
  
imports: from openprompt.data_utils.utils import InputExample
  import os
  import json, csv
  from abc import ABC, abstractmethod
  from collections import defaultdict, Counter
  from typing import List, Dict, Callable
  from openprompt.utils.logging import logger
  from openprompt.data_utils.data_processor import DataProcessor
  from tqdm import tqdm
label_desc: Use image node_id 2 for calling the CSQAProcessor obj's underlying member method code with example usage: obj.get_examples(data_dir, split) and returns: examples