<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def marginal_distribution(self, variables, inplace=True):
 """ Returns the marginal distribution over variables. Parameters variables: string, list, tuple, set, dict Variable or list of variables over which marginal distribution needs to be calculated inplace: Boolean (default True) If False return a new instance of JointProbabilityDistribution Examples -------- x1 x2 P(x1,x2) x1_0 x2_0 0.1502 x1_0 x2_1 0.1626 x1_0 x2_2 0.1197 x1_1 x2_0 0.2339 x1_1 x2_1 0.1996 x1_1 x2_2 0.1340 """

        return self.marginalize(list(set(list(self.variables)) -
                                     set(variables if isinstance(
                                         variables, (list, set, dict, tuple)) else [variables])),
                                inplace=inplace)