openml/datasets/functions.py
def _get_dataset_arff(description: Union[Dict, OpenMLDataset], cache_directory: str = None) -> str:
    """ Return the path to the local arff file of the dataset. If is not cached, it is downloaded.

    Checks if the file is in the cache, if yes, return the path to the file.
    If not, downloads the file and caches it, then returns the file path.
    The cache directory is generated based on dataset information, but can also be specified.

    This function is NOT thread/multiprocessing safe.

    Parameters
    ----------
    description : dictionary or OpenMLDataset
        Either a dataset description as dict or OpenMLDataset.

    cache_directory: str, optional (default=None)
        Folder to store the arff file in.
        If None, use the default cache directory for the dataset.

    Returns
    -------
    output_filename : string
        Location of ARFF file.
    """
    if isinstance(description, dict):
        md5_checksum_fixture = description.get("oml:md5_checksum")
        url = description["oml:url"]
        did = description.get("oml:id")
    elif isinstance(description, OpenMLDataset):
        md5_checksum_fixture = description.md5_checksum
        url = description.url
        did = description.dataset_id
    else:
        raise TypeError("`description` should be either OpenMLDataset or Dict.")

    if cache_directory is None:
        cache_directory = _create_cache_directory_for_id(DATASETS_CACHE_DIR_NAME, did)
    output_file_path = os.path.join(cache_directory, "dataset.arff")

    try:
        openml._api_calls._download_text_file(
            source=url, output_path=output_file_path, md5_checksum=md5_checksum_fixture
        )
    except OpenMLHashException as e:
        additional_info = " Raised when downloading dataset {}.".format(did)
        e.args = (e.args[0] + additional_info,)
        raise

    return output_file_path
 Return the path to the local arff file of the dataset. If is not cached, it is downloaded.

    Checks if the file is in the cache, if yes, return the path to the file.
    If not, downloads the file and caches it, then returns the file path.
    The cache directory is generated based on dataset information, but can also be specified.

    This function is NOT thread/multiprocessing safe.

    Parameters
    ----------
    description : dictionary or OpenMLDataset
        Either a dataset description as dict or OpenMLDataset.

    cache_directory: str, optional (default=None)
        Folder to store the arff file in.
        If None, use the default cache directory for the dataset.

    Returns
    -------
    output_filename : string
        Location of ARFF file.
    
Return the path to the local arff file of the dataset. If is not cached, it is downloaded.
Checks if the file is in the cache, if yes, return the path to the file.
If not, downloads the file and caches it, then returns the file path.
The cache directory is generated based on dataset information, but can also be specified.

This function is NOT thread/multiprocessing safe.

Parameters

description : dictionary or OpenMLDataset
Either a dataset description as dict or OpenMLDataset.

str, optional (default=None)
Folder to store the arff file in.
If None, use the default cache directory for the dataset.

Returns

output_filename : string
Location of ARFF file.
Return the path to the local arff file of the dataset . If is not cached it is downloaded . Checks if the file is in the cache if yes return the path to the file . If not downloads the file and caches it then returns the file path . The cache directory is generated based on dataset information but can also be specified . This function is NOT thread / multiprocessing safe . Parameters description : dictionary or OpenMLDataset Either a dataset description as dict or OpenMLDataset . str optional ( default = None ) Folder to store the arff file in . If None use the default cache directory for the dataset . Returns output_filename : string Location of ARFF file .
def _get_dataset_arff(description: Union[Dict, OpenMLDataset], cache_directory: str = None) -> str:
    if isinstance(description, dict):
        md5_checksum_fixture = description.get("oml:md5_checksum")
        url = description["oml:url"]
        did = description.get("oml:id")
    elif isinstance(description, OpenMLDataset):
        md5_checksum_fixture = description.md5_checksum
        url = description.url
        did = description.dataset_id
    else:
        raise TypeError("`description` should be either OpenMLDataset or Dict.")
    if cache_directory is None:
        cache_directory = _create_cache_directory_for_id(DATASETS_CACHE_DIR_NAME, did)
    output_file_path = os.path.join(cache_directory, "dataset.arff")
    try:
        openml._api_calls._download_text_file(
            source=url, output_path=output_file_path, md5_checksum=md5_checksum_fixture
        )
    except OpenMLHashException as e:
        additional_info = " Raised when downloading dataset {}.".format(did)
        e.args = (e.args[0] + additional_info,)
        raise
    return output_file_path
def _get_dataset_arff ( description : Union [ Dict , OpenMLDataset ] , cache_directory : str = None ) -> str : if isinstance ( description , dict ) : md5_checksum_fixture = description . get ( "oml:md5_checksum" ) url = description [ "oml:url" ] did = description . get ( "oml:id" ) elif isinstance ( description , OpenMLDataset ) : md5_checksum_fixture = description . md5_checksum url = description . url did = description . dataset_id else : raise TypeError ( "`description` should be either OpenMLDataset or Dict." ) if cache_directory is None : cache_directory = _create_cache_directory_for_id ( DATASETS_CACHE_DIR_NAME , did ) output_file_path = os . path . join ( cache_directory , "dataset.arff" ) try : openml . _api_calls . _download_text_file ( source = url , output_path = output_file_path , md5_checksum = md5_checksum_fixture ) except OpenMLHashException as e : additional_info = " Raised when downloading dataset {}." . format ( did ) e . args = ( e . args [ 0 ] + additional_info , ) raise return output_file_path
Return the path to the local arff file of the dataset.
Return the path to the local arff file of the dataset .
""" Return the path to the local arff file of the dataset. If is not cached, it is downloaded.

    Checks if the file is in the cache, if yes, return the path to the file.
    If not, downloads the file and caches it, then returns the file path.
    The cache directory is generated based on dataset information, but can also be specified.

    This function is NOT thread/multiprocessing safe.

    Parameters
    ----------
    description : dictionary or OpenMLDataset
        Either a dataset description as dict or OpenMLDataset.

    cache_directory: str, optional (default=None)
        Folder to store the arff file in.
        If None, use the default cache directory for the dataset.

    Returns
    -------
    output_filename : string
        Location of ARFF file.
    """
description
Union[Dict, OpenMLDataset]
cache_directory
str