Build and return a PyMC3 Distribution.

def _build_dist(self, spec, label, dist, **kwargs):
        ''' Build and return a PyMC3 Distribution. '''
        if isinstance(dist, string_types):
            if hasattr(pm, dist):
                dist = getattr(pm, dist)
            elif dist in self.dists:
                dist = self.dists[dist]
            else:
                raise ValueError("The Distribution class '%s' was not "
                                 "found in PyMC3 or the PyMC3BackEnd." % dist)

        # Inspect all args in case we have hyperparameters
        def _expand_args(k, v, label):
            if isinstance(v, Prior):
                label = '%s_%s' % (label, k)
                return self._build_dist(spec, label, v.name, **v.args)
            return v

        kwargs = {k: _expand_args(k, v, label) for (k, v) in kwargs.items()}

        # Non-centered parameterization for hyperpriors
        if spec.noncentered and 'sd' in kwargs and 'observed' not in kwargs \
                and isinstance(kwargs['sd'], pm.model.TransformedRV):
            old_sd = kwargs['sd']
            _offset = pm.Normal(label + '_offset', mu=0, sd=1,
                                shape=kwargs['shape'])
            return pm.Deterministic(label, _offset * old_sd)

        return dist(label, **kwargs)