def _load_params(params, logger=logging):
    """Given a str as a path to the .params file or a pair of params,
    returns two dictionaries representing arg_params and aux_params.
    """
    if isinstance(params, str):
        cur_path = os.path.dirname(os.path.realpath(__file__))
        param_file_path = os.path.join(cur_path, params)
        logger.info('Loading params from file %s' % param_file_path)
        save_dict = nd_load(param_file_path)
        arg_params = {}
        aux_params = {}
        for k, v in save_dict.items():
            tp, name = k.split(':', 1)
            if tp == 'arg':
                arg_params[name] = v
            if tp == 'aux':
                aux_params[name] = v
        return arg_params, aux_params
    elif isinstance(params, (tuple, list)) and len(params) == 2:
        return params[0], params[1]
    else:
        raise ValueError('Unsupported params provided. Must be either a path to the param file or'
                         ' a pair of dictionaries representing arg_params and aux_params')
def _load_params ( params , logger = logging ) : if isinstance ( params , str ) : cur_path = os . path . dirname ( os . path . realpath ( __file__ ) ) param_file_path = os . path . join ( cur_path , params ) logger . info ( 'Loading params from file %s' % param_file_path ) save_dict = nd_load ( param_file_path ) arg_params = { } aux_params = { } for k , v in save_dict . items ( ) : tp , name = k . split ( ':' , 1 ) if tp == 'arg' : arg_params [ name ] = v if tp == 'aux' : aux_params [ name ] = v return arg_params , aux_params elif isinstance ( params , ( tuple , list ) ) and len ( params ) == 2 : return params [ 0 ] , params [ 1 ] else : raise ValueError ( 'Unsupported params provided. Must be either a path to the param file or' ' a pair of dictionaries representing arg_params and aux_params' )
Given a str as a path to the .params file or a pair of params,
    returns two dictionaries representing arg_params and aux_params.