def detect(agent):
    result = dict()
    prefs = dict()
    result['is_mobile'] = False
    result['is_tablet'] = False
    for info_type in detectorshub:
        detectors = detectorshub[info_type]
        _d_prefs = prefs.get(info_type, [])
        detectors = detectorshub.reorderByPrefs(detectors, _d_prefs)
        try:
            for detector in detectors:
                if detector.detect(agent, result):
                    prefs = detector.prefs
                    break
        except Exception, ex:
            result['exception'] = ex
    # hack to address https://code.google.com/p/web2py/issues/detail?id=1755
    if not 'browser' in result:
        result['browser'] = {'name':'IE11'}
    return result
dataset/ETHPy150Open uwdata/termite-data-server/web2py/gluon/contrib/user_agent_parser.py/detect/original