reasoning under uncertainty raise notimplementederror("inferencemethod query"abstract method we use bn_ ch as the test casein particular ( truethis needs an error thresholdparticularly for the approximate methodswhere the default threshold is much too accurate probgraphicalmodels py -(continued def testim(selfthreshold= )solver self(bn_ chres solver query( ,{ :true}correct_answer assert correct_answer-threshold res[truecorrect_answer+thresholdf"value {res[true]not in desired range for {self method_name}print( "unit test passed for {self method_name" recursive conditioning an instance of rc object takes in graphical model the query method uses recursive conditioning to compute the probability of query variable given observations on other variables probrc py -recursive conditioning for graphical models import math from probgraphicalmodels import graphicalmodelinferencemethod from probfactors import factor from utilities import dict_union class probsearch(inferencemethod)"""the class that queries graphical models using recursive conditioning gm is graphical model to query ""method_name "recursive conditioning def __init__(self,gm=none)inferencemethod __init__(selfgm#self max_display_level def query(selfqvarobs={}split_order=none)"""computes (qvar obswhere qvar is the query variable obs is variable:value dictionary split_order is list of the non-observed non-query variables in gm ""if qvar in obsreturn {val:( if val =obs[qvarelse for val in qvar domainversion june