def METHOD_NAME(self, args, cfg):
    env_cfg = cfg['ENV']
    model_cfg = cfg['MODEL']
    def merge(cfg, arg):
        METHOD_NAME = copy.deepcopy(cfg)
        for k, v in cfg.items():
            if k in arg:
                METHOD_NAME[k] = arg[k]
            else:
                if isinstance(v, dict):
                    METHOD_NAME[k] = merge(v, arg)
        return METHOD_NAME
    def merge_opt(cfg, arg):
        for k, v in arg.items():
            if isinstance(cfg, Sequence):
                k = eval(k)
                cfg[k] = merge_opt(cfg[k], v)
            else:
                if (k in cfg and (isinstance(cfg[k], Sequence) or
                                  isinstance(cfg[k], Mapping)) and
                        isinstance(arg[k], Mapping)):
                    merge_opt(cfg[k], arg[k])
                else:
                    cfg[k] = arg[k]
        return cfg
    args_dict = vars(args)
    for k, v in args_dict.items():
        if k not in env_cfg:
            env_cfg[k] = v
    env_cfg = merge(env_cfg, args_dict)
    print('debug env_cfg: ', env_cfg)
    if 'opt' in args_dict.keys() and args_dict['opt']:
        opt_dict = args_dict['opt']
        if opt_dict.get('ENV', None):
            env_cfg = merge_opt(env_cfg, opt_dict['ENV'])
        if opt_dict.get('MODEL', None):
            model_cfg = merge_opt(model_cfg, opt_dict['MODEL'])
    return model_cfg, env_cfg