def get_recent_workers(db):
    '''
    '''
    recent_workers = {PERMANENT_KIND: [], TEMPORARY_KIND: [], None: []}
    
    db.execute('''SELECT worker_kind, worker_id
                  FROM heartbeats WHERE datetime >= NOW() - INTERVAL %s''',
               (HEARTBEAT_INTERVAL * 3, ))

    for (kind, id) in db.fetchall():
        recent_workers[kind].append(id)
    
    return recent_workers
dataset/ETHPy150Open openaddresses/machine/openaddr/ci/__init__.py/get_recent_workers/original