def worker_checkin(self, user_id, worker_id, slots, dependency_uuids):
        with self._engine.begin() as conn:
            worker_row = {
                'slots': slots,
                'checkin_time': datetime.datetime.now(),
            }
            existing_row = conn.execute(
                cl_worker.select()
                    .where(and_(cl_worker.c.user_id == user_id,
                                cl_worker.c.worker_id == worker_id))
            ).fetchone()
            if existing_row:
                socket_id = existing_row.socket_id  
                conn.execute(
                    cl_worker.update()
                        .where(and_(cl_worker.c.user_id == user_id,
                                    cl_worker.c.worker_id == worker_id))
                        .values(worker_row))
                conn.execute(
                    cl_worker_dependency.delete()
                        .where(and_(cl_worker_dependency.c.user_id == user_id,
                                    cl_worker_dependency.c.worker_id == worker_id)))   
            else:
                socket_id = self.allocate_socket(user_id, worker_id, conn)
                worker_row.update({
                    'user_id': user_id,
                    'worker_id': worker_id,
                    'socket_id': socket_id,
                })
                conn.execute(cl_worker.insert().values(worker_row))
            dependency_rows = [{
                'user_id': user_id,
                'worker_id': worker_id,
                'dependency_uuid': uuid,
            } for uuid in dependency_uuids]
            if dependency_rows:
                conn.execute(cl_worker_dependency.insert(), dependency_rows)

        return socket_id
Get enum ID by the name of enum
dataset/ETHPy150Open codalab/codalab-cli/codalab/model/worker_model.py/WorkerModel.worker_checkin--crossover with--dataset/ETHPy150Open EiNSTeiN-/idapython/python/idc.py/GetEnum