<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def query(self, variables, evidence=None, joint=True):
 """ Query method using belief propagation. Parameters variables: list list of variables for which you want to compute the probability evidence: dict a dict key, value pair as {var: state_of_var_observed} None if no evidence joint: boolean If True, returns a Joint Distribution over `variables`. If False, returns a dict of distributions over each of the `variables`. Examples -------- """

        return self._query(variables=variables, operation='marginalize', evidence=evidence, joint=joint)