def new()

in src/classes/qadataset.py [0:0]


    def new(cls, name: str, url_or_path: str):
        """Returns a new QADataset object.

        Args:
            name: Identifying name of this dataset.
            url_or_path: Either the URL to download from, or the local path to read from.
        """
        if os.path.exists(url_or_path):
            original_path = url_or_path
        else:
            file_suffix = ".".join(os.path.basename(url_or_path).split(".")[1:])
            original_path = os.path.join(ORIG_DATA_DIR, f"{name}.{file_suffix}")
            cls._download(name, url_or_path, original_path)
        preprocessed_path = cls._get_norm_dataset_path(name)
        return cls(name, original_path, preprocessed_path)