# 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 numpy as np
import init_path
from util import logger
from six.moves import xrange
        for node_type in node_info['node_type_dict']
    }

    # step 1: construct the graph obs. For each node, fetch the input for it.
    for node_type in node_info['node_type_dict']:
        # 'geom', 'joint', 'root', 'body', we already know that the size of ob
        # for one type is consistent
        if node_info['ob_size_dict'][node_type] <= 0:
            continue  # this type do not receive any ob, leave them zeros

        for node_pos_in_graph_ob, i_node_id in enumerate(
                node_info['node_type_dict'][node_type]):
            # NOTE: WARNING: THIS IS NOT GOOD ACTUALLY
            # graph_ob[node_type][:, node_pos_in_graph_ob, :] = \
            #     raw_ob[:, node_info['input_dict'][i_node_id]]
            graph_ob[node_type][:, node_pos_in_graph_ob,
                                :len(node_info['input_dict'][i_node_id])] = \
                raw_ob[:, node_info['input_dict'][i_node_id]]

    # step 2: construct the graph parameters
    for node_type in node_info['node_type_dict']:
        # similar to the graph obs' construction
        graph_parameters[node_type][:, :, :] = np.tile(
            node_info['node_parameters'][node_type], [batch_size, 1, 1]
        )

    # step 3: reshape the graph_ob and the graph_parameters
    for node_type in node_info['node_type_dict']:
        if node_info['ob_size_dict'][node_type] == 0:
            this_shape = graph_ob[node_type].shape

# 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: graph_util/graph_data_util.py
import numpy as np
import init_path
from util import logger
from six.moves import xrange

        for node_type in node_info['node_type_dict']
    }

    # step 1: construct the graph obs. For each node, fetch the input for it.
    for node_type in node_info['node_type_dict']:
        # 'geom', 'joint', 'root', 'body', we already know that the size of ob
        # for one type is consistent
        if node_info['ob_size_dict'][node_type] <= 0:
            continue  # this type do not receive any ob, leave them zeros

        for node_pos_in_graph_ob, i_node_id in enumerate(
                node_info['node_type_dict'][node_type]):
            # NOTE: WARNING: THIS IS NOT GOOD ACTUALLY
            # graph_ob[node_type][:, node_pos_in_graph_ob, :] = \
            #     raw_ob[:, node_info['input_dict'][i_node_id]]
            graph_ob[node_type][:, node_pos_in_graph_ob,
                                :len(node_info['input_dict'][i_node_id])] = \
                raw_ob[:, node_info['input_dict'][i_node_id]]

    # step 2: construct the graph parameters
    for node_type in node_info['node_type_dict']:
        # similar to the graph obs' construction
        graph_parameters[node_type][:, :, :] = np.tile(
            node_info['node_parameters'][node_type], [batch_size, 1, 1]
        )

    # step 3: reshape the graph_ob and the graph_parameters
    for node_type in node_info['node_type_dict']:
        if node_info['ob_size_dict'][node_type] == 0:
            this_shape = graph_ob[node_type].shape

            assert this_shape[2] == 0, logger.error('wrong ob shape!')