<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _ref( pname, conf=None, configurable=None, cname=None, path=None, history=0 ):
 """Resolve a parameter value. :param Configuration conf: configuration to use. :param str pname: parameter name. :param Configurable configurable: configurable. :param str cname: category name. :param str path: conf path. :param int history: parameter history research. :return: parameter. :raises: ParserError if conf and configurable are None. """


    result = None

    if configurable is not None:

        kwargs = {}

        if conf is not None:
            kwargs['conf'] = conf

        if path is not None:
            kwargs['paths'] = path

        if conf is None:
            conf = configurable.getconf(**kwargs)

    if conf is None:
        raise ParserError(
            'Wrong ref parameters. Conf and configurable are both None.'
        )

    result = conf.param(pname=pname, cname=cname, history=history)

    return result