def get_content(opts):
    cache = shelve.open(opts['cache'])
    if opts['usecache'] and opts['title'] in cache:
        logger.info('using cached version of %s', opts['title'])
        content = cache[opts['title']]
    else:
        logger.debug('computing from scratch')
        service = get_service(opts)
        file = find_file(service, opts)
        if file is None:
            logger.exception('file `%s` could not be found', opts['title'])
            sys.exit()
        content = download(service, file)
        cache[opts['title']] = content
    return content
dataset/ETHPy150Open embr/gcat/gcat/__init__.py/get_content/original