code: def write_test_ppid_dataset(self, data_format="csv"):
      data_format = data_format.lower()
      if data_format == "csv":
          delim = ","
      elif data_format == "tsv":
          delim = "\t"
      dict_dataset = [
          {
              "id": "0",
              "question1": "When do you use シ instead of し?",
              "question2": 'When do you use "&" instead of "and"?',
              "label": "0",
          },
          {
              "id": "1",
              "question1": "Where was Lincoln born?",
              "question2": "Which location was Abraham Lincoln born?",
              "label": "1",
          },
          {
              "id": "2",
              "question1": "What is 2+2",
              "question2": "2+2=?",
              "label": "1",
          },
      ]
      with open(
          self.test_ppid_dataset_path, "w"
      ) as test_ppid_dataset_file:
          for example in dict_dataset:
              if data_format == "json":
                  test_ppid_dataset_file.write(
                      json.dumps(example) + "\n"
                  )
              elif data_format == "csv" or data_format == "tsv":
                  test_ppid_dataset_file.write(
                      "{}\n".format(
                          delim.join(
                              [
                                  example["id"],
                                  example["question1"],
                                  example["question2"],
                                  example["label"],
                              ]
                          )
                      )
                  )
              else:
                  raise ValueError(
                      "Invalid format {}".format(data_format)
                  )
  
file_path: decanlp/text/test/common/torchtext_test_case.py
imports: from unittest import TestCase
  import json
  import logging
  import os
  import shutil
  import subprocess
  import tempfile
label_desc: Use image node_id 3 for calling the TorchtextTestCase obj's underlying member method code with example usage: obj.write_test_ppid_dataset(data_format) without return types