Internal version of set_priors(), with same arguments.

        Runs during Model.build().

def _set_priors(self, priors=None, fixed=None, random=None,
                    match_derived_names=True):
        '''Internal version of set_priors(), with same arguments.

        Runs during Model.build().
        '''

        targets = {}

        if fixed is not None:
            targets.update({name: fixed for name in self.fixed_terms.keys()})

        if random is not None:
            targets.update({name: random for name in self.random_terms.keys()})

        if priors is not None:
            for k, prior in priors.items():
                for name in listify(k):
                    term_names = list(self.terms.keys())
                    msg = "No terms in model match '%s'." % name
                    if name not in term_names:
                        terms = self._match_derived_terms(name)
                        if not match_derived_names or terms is None:
                            raise ValueError(msg)
                        for t in terms:
                            targets[t.name] = prior
                    else:
                        targets[name] = prior

        for name, prior in targets.items():
            self.terms[name].prior = prior