(self)
Check that necessary data is found on disk, or raise an OSError.
Check that necessary data is found on disk, or raise an OSError.
Check that necessary data is found on disk or raise an OSError .
def _check_data(self):
        """Check that necessary data is found on disk, or raise an OSError."""
        data_dirpaths = (
            self.data_dir.joinpath("aclImdb", subset, label)
            for subset, labels in self._subset_labels.items()
            for label in labels
        )
        url_filepaths = (
            self.data_dir.joinpath("aclImdb", subset, f"urls_{label}.txt")
            for subset, labels in self._subset_labels.items()
            for label in labels
        )
        for dirpath in data_dirpaths:
            if not dirpath.is_dir():
                raise OSError(
                    f"data directory {dirpath} not found; "
                    "has the dataset been downloaded?"
                )
        for filepath in url_filepaths:
            if not filepath.is_file():
                raise OSError(
                    f"data file {filepath} not found; has the dataset been downloaded?"
                )
def _check_data ( self ) : data_dirpaths = ( self . data_dir . joinpath ( "aclImdb" , subset , label ) for subset , labels in self . _subset_labels . items ( ) for label in labels ) url_filepaths = ( self . data_dir . joinpath ( "aclImdb" , subset , f"urls_{label}.txt" ) for subset , labels in self . _subset_labels . items ( ) for label in labels ) for dirpath in data_dirpaths : if not dirpath . is_dir ( ) : raise OSError ( f"data directory {dirpath} not found; " "has the dataset been downloaded?" ) for filepath in url_filepaths : if not filepath . is_file ( ) : raise OSError ( f"data file {filepath} not found; has the dataset been downloaded?" )