def get_dataset_filename(ds_dict):
    """Figure out the downloaded filename for a dataset entry

    if a `file_name` key is present, use this,
    otherwise, use the last component of the `url`

    Returns the filename

    Examples
    --------
    >>> ds_dict = {'url': 'http://example.com/path/to/file.txt'}
    >>> get_dataset_filename(ds_dict)
    'file.txt'
    >>> ds_dict['file_name'] = 'new_filename.blob'
    >>> get_dataset_filename(ds_dict)
    'new_filename.blob'
    """

    file_name = ds_dict.get('file_name', None)
    url = ds_dict.get('url', [])
    if file_name is None:
        file_name = url.split("/")[-1]
    return file_name