Returns
        -------
        prior_model_tuples: [(String, PriorModel)]
            A list of tuples with the names of prior models and associated prior models. Names are fully qualified by
            all objects in which they are embedded.
430860
def flat_prior_model_tuples(self):
        
        return [("{}".format(prior_model_name), flat_prior_model) for
                prior_model_name, prior_model in
                self.prior_model_tuples for
                flat_prior_model_name, flat_prior_model in
                prior_model.flat_prior_model_tuples]
864660
def models(self):
        
        app = get_app(self.__class__.__module__.split('.')[-2])
        return get_models(app)
765754
def param_labels(self):
        """"""

        paramnames_labels = []
        prior_class_dict = self.variable.prior_class_dict
        prior_prior_model_dict = self.variable.prior_prior_model_dict

        for prior_name, prior in self.variable.prior_tuples_ordered_by_id:
            param_string = self.label_config.label(prior_name)
            prior_model = prior_prior_model_dict[prior]
            cls = prior_class_dict[prior]
            cls_string = "{}{}".format(self.label_config.subscript(cls), prior_model.component_number + 1)
            param_label = "{}_{{\\mathrm{{{}}}}}".format(param_string, cls_string)
            paramnames_labels.append(param_label)

        return paramnames_labels
1328172
def get_model_name(self):
        
        if self.model_name is None:
            raise ImproperlyConfigured(
                "%s requires either a definition of "
                "'model_name' or an implementation of 'get_model_name()'" %
                self.__class__.__name__)
        return self.model_name
613265
def get_all_prerequisites(self):
        
        result = SCons.Util.UniqueList([])
        for target in self.get_all_targets():
            if target.prerequisites is not None:
                result.extend(target.prerequisites)
        return result
648559
def gaussian_prior_model_for_arguments(self, arguments):
        
        return CollectionPriorModel(
            {
                key: value.gaussian_prior_model_for_arguments(arguments)
                if isinstance(value, AbstractPriorModel)
                else value
                for key, value in self.__dict__.items() if key not in ('component_number', 'item_number', 'id')
            }
        )
1182503
def names(self):
        
        # We must sort to preserve the order between calls.
        # The set comprehension is to drop the duplicates.
        return tuple(sorted({
            instr.arg for instr in self.instrs if instr.uses_name
        }))
592293
def _parse_prior(self):
        """"""
        paths = self.prior_
        if isinstance(paths, str):
            paths = [paths]
        chain_data = []
        for path in paths:
            parsed_output = _read_output(path)
            for sample, sample_stats, config, adaptation, timing in parsed_output:
                chain_data.append(
                    {
                        "sample": sample,
                        "sample_stats": sample_stats,
                        "configuration_info": config,
                        "adaptation_info": adaptation,
                        "timing_info": timing,
                    }
                )
        self.prior = [item["sample"] for item in chain_data]
        self.sample_stats_prior = [item["sample_stats"] for item in chain_data]
648629
def constant_tuple_dict(self):
        
        return {constant_tuple.constant: constant_tuple
                for name, prior_model in self.prior_model_tuples
                for constant_tuple in prior_model.constant_tuples}.values()
1226905
def prior_predictive_to_xarray(self):
        """"""
        prior = self.prior
        prior_model = self.prior_model
        prior_predictive = self.prior_predictive
        data = get_draws_stan3(prior, model=prior_model, variables=prior_predictive)
        return dict_to_dataset(data, library=self.stan, coords=self.coords, dims=self.dims)
502822
def get_all_models_including_attached_models(model):
    
    if (hasattr(model, "_tx_model_repository")):
        models = list(
            model._tx_model_repository.all_models.filename_to_model.values())
        if model not in models:
            models.append(model)
    else:
        models = [model]
    return models
28703
def sample_prior(batch_size):
    cat, _ = get_distributions(DIST_PRIOR_PARAM[:NUM_CLASS], DIST_PRIOR_PARAM[NUM_CLASS:])
    sample_cat = tf.one_hot(cat.sample(batch_size), NUM_CLASS)

    
    sample_uni = tf.random_uniform([batch_size, NUM_UNIFORM], -1, 1)
    samples = tf.concat([sample_cat, sample_uni], axis=1)
    return samples
187684
def param_names(self):
        
        pn = CombinedBounds(self.k.param_names, self.noise_k.param_names)
        if self.mu is not None:
            pn = CombinedBounds(pn, self.mu.param_names)
        return pn
150906
def info(self):
        
        info = []

        for prior_model_name, prior_model in self.prior_model_tuples:
            info.append(prior_model.name + '\n')
            info.extend([f"{prior_model_name}_{item}" for item in prior_model.info])

        return '\n'.join(info)
1286336
def get_ancestors(self):
        
        ancestors = []
        if self._meta.proxy_for_model:
            # the current node is a proxy model; our result set
            # should use the same proxy model, so we need to
            # explicitly fetch instances of that model
            # when following the 'parent' relation
            cls = self.__class__
            node = self
            while node.parent_id:
                node = cls.objects.get(pk=node.parent_id)
                ancestors.insert(0, node)
        else:
            node = self.parent
            while node:
                ancestors.insert(0, node)
                node = node.parent
        return ancestors
35596
def varnames(self):
        
        # We must sort to preserve the order between calls.
        # The set comprehension is to drop the duplicates.
        return self._argnames + tuple(sorted({
            instr.arg
            for instr in self.instrs
            if instr.uses_varname and instr.arg not in self._argnames
        }))
128626
def get_model_info(self):
        '''
        
        '''
        info = {}
        info['model_name'] = self.name
        info['stages'] = '->'.join([repr(s) for s in self._stages])
        info['sequence'] = {
            'index': self._current_index
        }
        return info