def enumerate_joint_ask(X, e, P):
assert X not in e, "<STR_LIT>"<EOL>Q = ProbDist(X) <EOL>Y = [v for v in P.variables if v != X and v not in e] <EOL>for xi in P.values(X):<EOL><INDENT>Q[xi] = enumerate_joint(Y, extend(e, X, xi), P)<EOL><DEDENT>return Q.normalize()<EOL>
Return a probability distribution over the values of the variable X,
    given the {var:val} observations e, in the JointProbDist P. [Section 13.3]
    >>> P = JointProbDist(['X', 'Y'])
    >>> P[0,0] = 0.25; P[0,1] = 0.5; P[1,1] = P[2,1] = 0.125
    >>> enumerate_joint_ask('X', dict(Y=1), P).show_approx()
    '0: 0.667, 1: 0.167, 2: 0.167'