# Path: dHydra/core/Controller.py
# def controller(func):
#     def _controller(
#             query_arguments,
#             body_arguments,
#             get_query_argument,
#             get_body_argument
#     ):
#         result = func(
#             query_arguments,
#             body_arguments,
#             get_query_argument,
#             get_body_argument
#         )
#         return result
#     return _controller
# 
# Path: dHydra/core/Controller.py
# def controller_get(func):
#     def _controller(
#             query_arguments,
#             get_query_argument,
#     ):
#         result = func(
#             query_arguments,
#             get_query_argument,
#         )
#         return result
#     return _controller
# 
# Path: dHydra/core/Controller.py
# def controller_post(func):
#     def _controller(
#             query_arguments,
#             body_arguments,
#             get_query_argument,
#             get_body_argument
#     ):
#         result = func(
#             query_arguments,
#             body_arguments,
#             get_query_argument,
#             get_body_argument
#         )
#         return result
#     return _controller


import redis
import copy
    import dHydra.core.util as util
    import tornado.escape as escape
from dHydra.core.Functions import *
from dHydra.core.Controller import controller
from dHydra.core.Controller import controller_get
from dHydra.core.Controller import controller_post
        "res": worker_names,
    }
    return result


@controller_get
def get_workers_from_redis(
    query_arguments,
    get_query_argument
):
    keys = conn.keys("dHydra.Worker.*.*.Info")
    workers = dict()
    for i in range(0, len(keys)):
        channel = keys[i]
        parsed_channel = channel.split('.')
        if (len(parsed_channel) == 5) and (parsed_channel[4] == "Info")\
            and (parsed_channel[0] == 'dHydra')\
            and (parsed_channel[1] == 'Worker'):
            if parsed_channel[2] not in workers:
                workers[parsed_channel[2]] = dict()
            worker = conn.hgetall(keys[i])
            workers[parsed_channel[2]][parsed_channel[3]] = worker
    result = {
        "error_code": 0,
        "error_msg": "",
        "res": workers,
    }
    return result



# Path: dHydra/core/Controller.py
# def controller(func):
#     def _controller(
#             query_arguments,
#             body_arguments,
#             get_query_argument,
#             get_body_argument
#     ):
#         result = func(
#             query_arguments,
#             body_arguments,
#             get_query_argument,
#             get_body_argument
#         )
#         return result
#     return _controller
# 
# Path: dHydra/core/Controller.py
# def controller_get(func):
#     def _controller(
#             query_arguments,
#             get_query_argument,
#     ):
#         result = func(
#             query_arguments,
#             get_query_argument,
#         )
#         return result
#     return _controller
# 
# Path: dHydra/core/Controller.py
# def controller_post(func):
#     def _controller(
#             query_arguments,
#             body_arguments,
#             get_query_argument,
#             get_body_argument
#     ):
#         result = func(
#             query_arguments,
#             body_arguments,
#             get_query_argument,
#             get_body_argument
#         )
#         return result
#     return _controller


# Path: dHydra/Worker/Monitor/Controller.py
import redis
import copy
    import dHydra.core.util as util
    import tornado.escape as escape
from dHydra.core.Functions import *
from dHydra.core.Controller import controller
from dHydra.core.Controller import controller_get
from dHydra.core.Controller import controller_post

        "res": worker_names,
    }
    return result


@controller_get
def get_workers_from_redis(
    query_arguments,
    get_query_argument
):
    keys = conn.keys("dHydra.Worker.*.*.Info")
    workers = dict()
    for i in range(0, len(keys)):
        channel = keys[i]
        parsed_channel = channel.split('.')
        if (len(parsed_channel) == 5) and (parsed_channel[4] == "Info")\
            and (parsed_channel[0] == 'dHydra')\
            and (parsed_channel[1] == 'Worker'):
            if parsed_channel[2] not in workers:
                workers[parsed_channel[2]] = dict()
            worker = conn.hgetall(keys[i])
            workers[parsed_channel[2]][parsed_channel[3]] = worker
    result = {
        "error_code": 0,
        "error_msg": "",
        "res": workers,
    }
    return result



@controller