class_docstr: Downloads dataset files and prepares train/valid split.
  
  SQuAD:
  Stanford Question Answering Dataset
  https://rajpurkar.github.io/SQuAD-explorer/
  
  SQuAD2.0:
  Stanford Question Answering Dataset, version 2.0
  https://rajpurkar.github.io/SQuAD-explorer/
  
  SberSQuAD:
  Dataset from SDSJ Task B
  https://www.sdsj.ru/ru/contest.html
  
  MultiSQuAD:
  SQuAD dataset with additional contexts retrieved (by tfidf) from original Wikipedia article.
  
  MultiSQuADRetr:
  SQuAD dataset with additional contexts retrieved by tfidf document ranker from full Wikipedia.
docstr: Args:
      data_path: path to save data
      dataset: default dataset names: ``'SQuAD'``, ``'SberSQuAD'`` or ``'MultiSQuAD'``
      url: link to archive with dataset, use url argument if non-default dataset is used
  
  Returns:
      dataset split on train/valid
  
  Raises:
      RuntimeError: if `dataset` is not one of these: ``'SQuAD'``, ``'SberSQuAD'``, ``'MultiSQuAD'``.
code: def read(
      self,
      data_path: str,
      dataset: Optional[str] = "SQuAD",
      url: Optional[str] = None,
      *args,
      **kwargs,
  ) -> Dict[str, Dict[str, Any]]:
      """
  
      Args:
          data_path: path to save data
          dataset: default dataset names: ``'SQuAD'``, ``'SberSQuAD'`` or ``'MultiSQuAD'``
          url: link to archive with dataset, use url argument if non-default dataset is used
  
      Returns:
          dataset split on train/valid
  
      Raises:
          RuntimeError: if `dataset` is not one of these: ``'SQuAD'``, ``'SberSQuAD'``, ``'MultiSQuAD'``.
      """
      if url is not None:
          self.url = url
      elif dataset == "SQuAD":
          self.url = self.url_squad
      elif dataset == "SberSQuAD":
          self.url = self.url_sber_squad
      elif dataset == "MultiSQuAD":
          self.url = self.url_multi_squad
      elif dataset == "SQuAD2.0":
          self.url = self.url_squad2
      else:
          raise RuntimeError(f"Dataset {dataset} is unknown")
  
      data_path = Path(data_path)
      if dataset == "SQuAD2.0":
          required_files = [
              f"{dt}-v2.0.json" for dt in ["train", "dev"]
          ]
      else:
          required_files = [
              f"{dt}-v1.1.json" for dt in ["train", "dev"]
          ]
      data_path.mkdir(parents=True, exist_ok=True)
  
      if not all((data_path / f).exists() for f in required_files):
          download_decompress(self.url, data_path)
  
      dataset = {}
      for f in required_files:
          with data_path.joinpath(f).open("r", encoding="utf8") as fp:
              data = json.load(fp)
          if f in {"dev-v1.1.json", "dev-v2.0.json"}:
              dataset["valid"] = data
          else:
              dataset["train"] = data
  
      return dataset
  
file_path: DeepPavlov/deeppavlov/dataset_readers/squad_dataset_reader.py
imports: import json
  from pathlib import Path
  from typing import Dict, Any, Optional
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.data.dataset_reader import DatasetReader
  from deeppavlov.core.data.utils import download_decompress
label_desc: Use image node_id 1 for calling the SquadDatasetReader obj's underlying member method code with example usage: obj.read(data_path, dataset, url) and returns: dataset