# Path: util/dm_control_util.py
# BASE_PATH = init_path.get_abs_base_dir()
# DM_ENV_INFO = {
#     # fishes
#     'fish3d-swim': {'ob_size': 20, 'ac_size': 5, 'length': 1000},
#     'fish3d-easyswim': {'ob_size': 20, 'ac_size': 5, 'length': 1000},
#     'fish3d-speed': {'ob_size': 17, 'ac_size': 5, 'length': 1000},
# 
#     'acrobot-swingup_sparse': {'ob_size': 6, 'ac_size': 1, 'length': 1000},
#     'acrobot-swingup': {'ob_size': 6, 'ac_size': 1, 'length': 1000},
# 
#     'ball_in_cup-catch': {'ob_size': 8, 'ac_size': 2, 'length': 1000},
# 
#     'cartpole-swingup_sparse': {'ob_size': 5, 'ac_size': 1, 'length': 1000},
#     'cartpole-balance': {'ob_size': 5, 'ac_size': 1, 'length': 1000},
#     'cartpole-balance_sparse': {'ob_size': 5, 'ac_size': 1, 'length': 1000},
#     'cartpole-swingup': {'ob_size': 5, 'ac_size': 1, 'length': 1000},
# 
#     'cheetah-run': {'ob_size': 17, 'ac_size': 6, 'length': 1000},
# 
#     'finger-turn_easy': {'ob_size': 12, 'ac_size': 2, 'length': 1000},
#     'finger-spin': {'ob_size': 9, 'ac_size': 2, 'length': 1000},
#     'finger-turn_hard': {'ob_size': 12, 'ac_size': 2, 'length': 1000},
# 
#     'fish-upright': {'ob_size': 21, 'ac_size': 5, 'length': 1000},
#     'fish-swim': {'ob_size': 24, 'ac_size': 5, 'length': 1000},
# 
#     'hopper-stand': {'ob_size': 15, 'ac_size': 4, 'length': 1000},
#     'hopper-hop': {'ob_size': 15, 'ac_size': 4, 'length': 1000},
# 
#     'humanoid-run': {'ob_size': 67, 'ac_size': 21, 'length': 1000},
#     'humanoid-stand': {'ob_size': 67, 'ac_size': 21, 'length': 1000},
#     'humanoid-walk': {'ob_size': 67, 'ac_size': 21, 'length': 1000},
# 
#     'manipulator-bring_ball': {'ob_size': 37, 'ac_size': 5, 'length': 1000},
# 
#     'pendulum-swingup': {'ob_size': 3, 'ac_size': 1, 'length': 1000},
# 
#     'point_mass-easy': {'ob_size': 4, 'ac_size': 2, 'length': 1000},
# 
#     'reacher-hard': {'ob_size': 7, 'ac_size': 2, 'length': 1000},
#     'reacher-easy': {'ob_size': 7, 'ac_size': 2, 'length': 1000},
# 
#     'swimmer-swimmer6': {'ob_size': 25, 'ac_size': 5, 'length': 1000},
#     'swimmer-swimmer15': {'ob_size': 61, 'ac_size': 14, 'length': 1000},
# 
#     'walker-run': {'ob_size': 24, 'ac_size': 6, 'length': 1000},
#     'walker-stand': {'ob_size': 24, 'ac_size': 6, 'length': 1000},
#     'walker-walk': {'ob_size': 24, 'ac_size': 6, 'length': 1000},
# 
#     'humanoid_CMU-run': {'ob_size': 137, 'ac_size': 56, 'length': 1000},
#     'humanoid_CMU-stand': {'ob_size': 137, 'ac_size': 56, 'length': 1000},
#     'humanoid_CMU-walk': {'ob_size': 137, 'ac_size': 56, 'length': 1000},
# }
# def render(pixel):
# def vectorize_ob(ob_dictionary):
# def get_ob_size(env):
# def get_env_names(task_name):
# def io_information(task_name):
# 
# Path: util/logger.py
# class _MyFormatter(logging.Formatter):
#     def format(self, record):
# def set_file_handler(path=None, prefix='', time_str=''):
# _LOGGING_METHOD = ['info', 'warning', 'error', 'critical',
#                    'warn', 'exception', 'debug']


import init_path
import os
import numpy as np
from util import dm_control_util
from util import logger
        from dm_control import suite


def get_output_path(args, env_str='deepmind'):
    if args.output_dir is None:
        base_path = init_path.get_base_dir()
    else:
        base_path = args.output_dir

    is_test_env = 'test_' if args.test_env else ''
    path = os.path.join(
        base_path,
        'video',
        is_test_env + env_str,
        args.task + '_' + args.time_id
    )
    path = os.path.abspath(path)

    if not os.path.exists(path):
        try:
            os.makedirs(path)
        except Exception as e:
            logger.error(str(e))

    return path


class dm_env_wrapper(object):

    def __init__(self, args, rand_seed, monitor, width=480, height=480):
        self.width = width

# Path: util/dm_control_util.py
# BASE_PATH = init_path.get_abs_base_dir()
# DM_ENV_INFO = {
#     # fishes
#     'fish3d-swim': {'ob_size': 20, 'ac_size': 5, 'length': 1000},
#     'fish3d-easyswim': {'ob_size': 20, 'ac_size': 5, 'length': 1000},
#     'fish3d-speed': {'ob_size': 17, 'ac_size': 5, 'length': 1000},
# 
#     'acrobot-swingup_sparse': {'ob_size': 6, 'ac_size': 1, 'length': 1000},
#     'acrobot-swingup': {'ob_size': 6, 'ac_size': 1, 'length': 1000},
# 
#     'ball_in_cup-catch': {'ob_size': 8, 'ac_size': 2, 'length': 1000},
# 
#     'cartpole-swingup_sparse': {'ob_size': 5, 'ac_size': 1, 'length': 1000},
#     'cartpole-balance': {'ob_size': 5, 'ac_size': 1, 'length': 1000},
#     'cartpole-balance_sparse': {'ob_size': 5, 'ac_size': 1, 'length': 1000},
#     'cartpole-swingup': {'ob_size': 5, 'ac_size': 1, 'length': 1000},
# 
#     'cheetah-run': {'ob_size': 17, 'ac_size': 6, 'length': 1000},
# 
#     'finger-turn_easy': {'ob_size': 12, 'ac_size': 2, 'length': 1000},
#     'finger-spin': {'ob_size': 9, 'ac_size': 2, 'length': 1000},
#     'finger-turn_hard': {'ob_size': 12, 'ac_size': 2, 'length': 1000},
# 
#     'fish-upright': {'ob_size': 21, 'ac_size': 5, 'length': 1000},
#     'fish-swim': {'ob_size': 24, 'ac_size': 5, 'length': 1000},
# 
#     'hopper-stand': {'ob_size': 15, 'ac_size': 4, 'length': 1000},
#     'hopper-hop': {'ob_size': 15, 'ac_size': 4, 'length': 1000},
# 
#     'humanoid-run': {'ob_size': 67, 'ac_size': 21, 'length': 1000},
#     'humanoid-stand': {'ob_size': 67, 'ac_size': 21, 'length': 1000},
#     'humanoid-walk': {'ob_size': 67, 'ac_size': 21, 'length': 1000},
# 
#     'manipulator-bring_ball': {'ob_size': 37, 'ac_size': 5, 'length': 1000},
# 
#     'pendulum-swingup': {'ob_size': 3, 'ac_size': 1, 'length': 1000},
# 
#     'point_mass-easy': {'ob_size': 4, 'ac_size': 2, 'length': 1000},
# 
#     'reacher-hard': {'ob_size': 7, 'ac_size': 2, 'length': 1000},
#     'reacher-easy': {'ob_size': 7, 'ac_size': 2, 'length': 1000},
# 
#     'swimmer-swimmer6': {'ob_size': 25, 'ac_size': 5, 'length': 1000},
#     'swimmer-swimmer15': {'ob_size': 61, 'ac_size': 14, 'length': 1000},
# 
#     'walker-run': {'ob_size': 24, 'ac_size': 6, 'length': 1000},
#     'walker-stand': {'ob_size': 24, 'ac_size': 6, 'length': 1000},
#     'walker-walk': {'ob_size': 24, 'ac_size': 6, 'length': 1000},
# 
#     'humanoid_CMU-run': {'ob_size': 137, 'ac_size': 56, 'length': 1000},
#     'humanoid_CMU-stand': {'ob_size': 137, 'ac_size': 56, 'length': 1000},
#     'humanoid_CMU-walk': {'ob_size': 137, 'ac_size': 56, 'length': 1000},
# }
# def render(pixel):
# def vectorize_ob(ob_dictionary):
# def get_ob_size(env):
# def get_env_names(task_name):
# def io_information(task_name):
# 
# Path: util/logger.py
# class _MyFormatter(logging.Formatter):
#     def format(self, record):
# def set_file_handler(path=None, prefix='', time_str=''):
# _LOGGING_METHOD = ['info', 'warning', 'error', 'critical',
#                    'warn', 'exception', 'debug']


# Path: env/dm_env_wrapper.py
import init_path
import os
import numpy as np
from util import dm_control_util
from util import logger
        from dm_control import suite



def get_output_path(args, env_str='deepmind'):
    if args.output_dir is None:
        base_path = init_path.get_base_dir()
    else:
        base_path = args.output_dir

    is_test_env = 'test_' if args.test_env else ''
    path = os.path.join(
        base_path,
        'video',
        is_test_env + env_str,
        args.task + '_' + args.time_id
    )
    path = os.path.abspath(path)

    if not os.path.exists(path):
        try:
            os.makedirs(path)
        except Exception as e:
            logger.error(str(e))

    return path


class dm_env_wrapper(object):

    def __init__(self, args, rand_seed, monitor, width=480, height=480):
        self.width = width

        self.height = height