a0021cb982c25923a75cd3a1eeaee00058f2cdbb,pixyz/distributions/distributions.py,DistGraph,var_replaced,#DistGraph#Any#Any#,75

Before Change


                name_dict[new_global_var] = avar

    def var_replaced(self, replace_dict, name=""):
        if not (set(replace_dict.keys()) <= set(self.graph)):
            unknown_var = [var_name for var_name in replace_dict.keys() if var_name not in self.graph]
            raise ValueError(f"replace_dict has unknown variables: {unknown_var}")
        if not set(replace_dict.values()).isdisjoint(set(self.graph)):

After Change


        result.marginalize_list = {replace_dict[var] if var in replace_dict else var for var in self.marginalize_list}
        result.global_option = dict(self.global_option)

        for factor in result.factors():
            if set(replace_dict.values()).isdisjoint(list(result.graph.pred[factor]) + list(result.graph.succ[factor])):
                continue
            factor.rename_var(replace_dict)
        return result

    def _factors_from_variable(self, var_name):
        return list(self.graph.pred[var_name])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: masa-su/pixyz
Commit Name: a0021cb982c25923a75cd3a1eeaee00058f2cdbb
Time: 2020-07-27
Author: kaneko@weblab.t.u-tokyo.ac.jp
File Name: pixyz/distributions/distributions.py
Class Name: DistGraph
Method Name: var_replaced


Project Name: home-assistant/home-assistant
Commit Name: c44397e2578bcf4b0b5291eb8e2c491c548360fe
Time: 2017-09-18
Author: 1091741+MisterWil@users.noreply.github.com
File Name: homeassistant/components/binary_sensor/abode.py
Class Name:
Method Name: setup_platform


Project Name: vatlab/SoS
Commit Name: 773a6a04ef433117ed89b2d8656c8c3e52d6c191
Time: 2017-03-06
Author: ben.bog@gmail.com
File Name: sos/sos_executor.py
Class Name: Base_Executor
Method Name: run