<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_prior_functor(d):
 """Build a prior from a dictionary. Parameters d : A dictionary, it must contain: d['functype'] : a recognized function type and all of the required parameters for the prior_functor of the desired type Returns A sub-class of '~fermipy.stats_utils.prior_functor' Recognized types are: 'lognorm' : Scipy lognormal distribution 'norm' : Scipy normal distribution 'gauss' : Gaussian truncated at zero 'lgauss' : Gaussian in log-space 'lgauss_like' : Gaussian in log-space, with arguments reversed. 'lgauss_logpdf' : ??? """

    functype = d.get('functype', 'lgauss_like')
    j_ref = d.get('j_ref', 1.0)
    if functype == 'norm':
        return norm_prior(d['mu'], d['sigma'], j_ref)
    elif functype == 'lognorm':
        return lognorm_prior(d['mu'], d['sigma'], j_ref)
    elif functype == 'gauss':
        return function_prior(functype, d['mu'], d['sigma'], gauss, lngauss, j_ref)
    elif functype == 'lgauss':
        return function_prior(functype, d['mu'], d['sigma'], lgauss, lnlgauss, j_ref)
    elif functype in ['lgauss_like', 'lgauss_lik']:
        def fn(x, y, s): return lgauss(y, x, s)

        def lnfn(x, y, s): return lnlgauss(y, x, s)
        return function_prior(functype, d['mu'], d['sigma'], fn, lnfn, j_ref)
    elif functype == 'lgauss_log':
        def fn(x, y, s): return lgauss(x, y, s, logpdf=True)

        def lnfn(x, y, s): return lnlgauss(x, y, s, logpdf=True)
        return function_prior(functype, d['mu'], d['sigma'], fn, lnfn, j_ref)
    else:
        raise KeyError("Unrecognized prior_functor type %s" % functype)