def find_file(service, opts):
    files = service.files()
    try:
        res = files.list().execute()
    except errors.HttpError, error:
        logger.error('An error occurred: %s', exc_info=error)
        raise error

    files = res['items']
    fs = [f for f in files if f['title'] == opts['title'] ]
    if not fs:
        title_list = sorted([f['title'] for f in files])
        logger.error('file title: %s not in list:\n%s', opts['title'], pprint.pformat(title_list))
        return None
    if 1 > len(fs):
        dups = '\n'.join([f['alternateLink'] for f in fs])
        logger.warning('title `%s` matches several files in Google Drive.  Using first item in the following link:\n%s', opts['title'], dups)  
    file = fs[0]
    return file
dataset/ETHPy150Open embr/gcat/gcat/__init__.py/find_file/swapped operands of `>`