# Path: osim/redis/messages.py
# class OSIM_RL:
#     PING = "OSIM_RL.PING"
#     PONG = "OSIM_RL.PONG"
#     ENV_CREATE = "OSIM_RL.ENV_CREATE"
#     ENV_CREATE_RESPONSE = "OSIM_RL.ENV_CREATE_RESPONSE"
#     ENV_RESET = "OSIM_RL.ENV_RESET"
#     ENV_RESET_RESPONSE = "OSIM_RL.ENV_RESET_RESPONSE"
#     ENV_STEP = "OSIM_RL.ENV_STEP"
#     ENV_STEP_RESPONSE = "OSIM_RL.ENV_STEP_RESPONSE"
#     ENV_SUBMIT = "OSIM_RL.ENV_SUBMIT"
#     ENV_SUBMIT_RESPONSE = "OSIM_RL.ENV_SUBMIT_RESPONSE"
#     ERROR = "OSIM_RL.ERROR"


import redis
import json
import os
import pkg_resources
import sys
import numpy as np
import msgpack
import msgpack_numpy as m
import hashlib
import random
import time
import logging
from osim.redis import messages
        observation = _response['payload']['observation']
        return observation

    def env_reset(self):
        _request = {}
        _request['type'] = messages.OSIM_RL.ENV_RESET
        _request['payload'] = {}
        _response = self._blocking_request(_request)
        observation = _response['payload']['observation']
        return observation

    def env_step(self, action, render=False):
        """
            Respond with [observation, reward, done, info]
        """
        action = np.array(action).tolist()
        _request = {}
        _request['type'] = messages.OSIM_RL.ENV_STEP
        _request['payload'] = {}
        _request['payload']['action'] = action
        _response = self._blocking_request(_request)
        _payload = _response['payload']
        observation = _payload['observation']
        reward = _payload['reward']
        done = _payload['done']
        info = _payload['info']
        return [observation, reward, done, info]

    def submit(self):
        _request = {}

# Path: osim/redis/messages.py
# class OSIM_RL:
#     PING = "OSIM_RL.PING"
#     PONG = "OSIM_RL.PONG"
#     ENV_CREATE = "OSIM_RL.ENV_CREATE"
#     ENV_CREATE_RESPONSE = "OSIM_RL.ENV_CREATE_RESPONSE"
#     ENV_RESET = "OSIM_RL.ENV_RESET"
#     ENV_RESET_RESPONSE = "OSIM_RL.ENV_RESET_RESPONSE"
#     ENV_STEP = "OSIM_RL.ENV_STEP"
#     ENV_STEP_RESPONSE = "OSIM_RL.ENV_STEP_RESPONSE"
#     ENV_SUBMIT = "OSIM_RL.ENV_SUBMIT"
#     ENV_SUBMIT_RESPONSE = "OSIM_RL.ENV_SUBMIT_RESPONSE"
#     ERROR = "OSIM_RL.ERROR"


# Path: osim/redis/client.py
import redis
import json
import os
import pkg_resources
import sys
import numpy as np
import msgpack
import msgpack_numpy as m
import hashlib
import random
import time
import logging
from osim.redis import messages

        observation = _response['payload']['observation']
        return observation

    def env_reset(self):
        _request = {}
        _request['type'] = messages.OSIM_RL.ENV_RESET
        _request['payload'] = {}
        _response = self._blocking_request(_request)
        observation = _response['payload']['observation']
        return observation

    def env_step(self, action, render=False):
        """
            Respond with [observation, reward, done, info]
        """
        action = np.array(action).tolist()
        _request = {}
        _request['type'] = messages.OSIM_RL.ENV_STEP
        _request['payload'] = {}
        _request['payload']['action'] = action
        _response = self._blocking_request(_request)
        _payload = _response['payload']
        observation = _payload['observation']
        reward = _payload['reward']
        done = _payload['done']
        info = _payload['info']
        return [observation, reward, done, info]

    def submit(self):
        _request = {}

        _request['type'] = messages.OSIM_RL.ENV_SUBMIT