Downloads the given dataset from dataset store.

    Parameters
    ----------
    dataset_name : str
        The name of the dataset to upload.
    file_path : str
        The full path to the file to upload
    task : str, optional
        The task for which the given dataset is used for. If not given, a path
        for the corresponding task-agnostic directory is used.
    dataset_attributes : dict, optional
        Additional attributes of the datasets. Used to generate additional
        sub-folders on the blob "path". For example, providing 'lang=en' will
        results in a path such as '/lang_en/mydataset.csv'. Hierarchy always
        matches lexicographical order of keyword argument names, so 'lang=en'
        and 'animal=dog' will result in a path such as
        'task_name/animal_dof/lang_en/dset.csv'.
    **kwargs : extra keyword arguments
        Extra keyword arguments are forwarded to
        azure.storage.blob.BlockBlobService.get_blob_to_path.

def download_dataset(
        dataset_name, file_path, task=None, dataset_attributes=None, **kwargs):
    """Downloads the given dataset from dataset store.

    Parameters
    ----------
    dataset_name : str
        The name of the dataset to upload.
    file_path : str
        The full path to the file to upload
    task : str, optional
        The task for which the given dataset is used for. If not given, a path
        for the corresponding task-agnostic directory is used.
    dataset_attributes : dict, optional
        Additional attributes of the datasets. Used to generate additional
        sub-folders on the blob "path". For example, providing 'lang=en' will
        results in a path such as '/lang_en/mydataset.csv'. Hierarchy always
        matches lexicographical order of keyword argument names, so 'lang=en'
        and 'animal=dog' will result in a path such as
        'task_name/animal_dof/lang_en/dset.csv'.
    **kwargs : extra keyword arguments
        Extra keyword arguments are forwarded to
        azure.storage.blob.BlockBlobService.get_blob_to_path.
    """
    fname = ntpath.basename(file_path)
    blob_name = _blob_name(
        dataset_name=dataset_name,
        file_name=fname,
        task=task,
        dataset_attributes=dataset_attributes,
    )
    # print("Downloading blob: {}".format(blob_name))
    try:
        _blob_service().get_blob_to_path(
            container_name=BARN_CFG['azure']['container_name'],
            blob_name=blob_name,
            file_path=file_path,
            **kwargs,
        )
    except Exception as e:
        if os.path.isfile(file_path):
            os.remove(file_path)
        raise MissingDatasetError(
            "With blob {}.".format(blob_name)) from e