code: def download_squad_data_and_write_config(
      task_name: str, task_data_path: str, task_config_path: str
  ):
      if task_name == "squad_v1":
          train_file = "train-v1.1.json"
          dev_file = "dev-v1.1.json"
          version_2_with_negative = False
      elif task_name == "squad_v2":
          train_file = "train-v2.0.json"
          dev_file = "dev-v2.0.json"
          version_2_with_negative = True
      else:
          raise KeyError(task_name)
  
      os.makedirs(task_data_path, exist_ok=True)
      train_path = os.path.join(task_data_path, train_file)
      val_path = os.path.join(task_data_path, dev_file)
      download_utils.download_file(
          url=f"https://rajpurkar.github.io/SQuAD-explorer/dataset/{train_file}",
          file_path=train_path,
      )
      download_utils.download_file(
          url=f"https://rajpurkar.github.io/SQuAD-explorer/dataset/{dev_file}",
          file_path=val_path,
      )
      py_io.write_json(
          data={
              "task": "squad",
              "paths": {"train": train_path, "val": val_path},
              "kwargs": {
                  "version_2_with_negative": version_2_with_negative
              },
              "name": task_name,
          },
          path=task_config_path,
      )
  
imports: import json
  import logging
  import os
  import pandas
  import re
  import shutil
  import tarfile
  from operator import itemgetter
  from collections import Counter
  import jiant.scripts.download_data.utils
  import jiant.utils.display
  import jiant.utils.python.filesystem
  import jiant.utils.python.io
  from jiant.scripts.download_data.constants import SQUAD_TASKS, DIRECT_SUPERGLUE_TASKS_TO_DATA_URLS
label_desc: Use image node_id 2 for calling a global function with example usage: download_squad_data_and_write_config(task_name, task_data_path, task_config_path) without return types