'A helper method that checks if a file corresponding to a dataset is
ready and available to be used. Return ``True`` if so, ``False`` otherwise.'

def file_ready(self, obj, **kwargs):

    rel_path = self._construct_path(obj, **kwargs)
    if self._in_cache(rel_path):
        local_size = os.path.getsize(self._get_cache_path(rel_path))
        remote_size = self._get_size_in_azure(rel_path)
        if (local_size == remote_size):
            return True
        else:
            log.debug('Waiting    for    dataset    %s    to    transfer    from    OS:    %s/%s', rel_path, local_size, remote_size)
    return False
