if asst in self valuesreturn self values[asstelsetotal new_asst assignment copy(for val in self var_summed_out domainnew_asst[self var_summed_outval total +math prod(fac get_value(new_asstfor fac in self factorsself values[assttotal return total the method factor times multiples set of factors that are all factors on the same variable (or on no variablesthis is the last step in variable elimination before normalizing it returns an array giving the product for each value of variable probfactors py -(continued def factor_times(variablefactors)"""when factors are factors just on variable (or on no variables)""prods [facs [ for in factors if variable in variablesfor val in variable domainast {variable:valprods append(math prod( get_value(astfor in facs)return prods to project observations onto factorfor each variable that is observed in the factorwe construct new factor that is the factor projected onto that variable factor observed creates new factor that is the result is assigning value to single variable probve py -(continued def project_observations(self,factor,obs)"""returns the resulting factor after observing obs obs is dictionary of {variable:valuepairs ""if any((var in obsfor var in factor variables) variable in factor is observed return factorobserved(factor,obselsereturn factor def eliminate_var(self,factors,var)"""eliminate variable var from list of factors returns new set of factors that has var summed out ""self display( ,"eliminating ",str(var)contains_var [not_contains_var [for fac in factorsversion june