def Observer(request):
    try:
        observer_name = Config().observer_name
    except __HOLE__:
        observer_name = ''

    diag = Diag.objects.filter(name=observer_name).first()
    if not diag:
        return HttpResponse(json.dumps({"health": ":-X", "time": time.time(), "comp": 0}))

    t = time.time()
    
    d = json.loads(diag.backend_register)
    comp = d['last_run'] + d['last_duration']*2 + 300
    if comp>t:
        d['health'] = ':-)'
    else:
        d['health'] = ':-X'
    d['time'] = t
    d['comp'] = comp

    return HttpResponse(json.dumps(d))
dataset/ETHPy150Open open-cloud/xos/xos/core/views/observer.py/Observer