<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def logp_gradient(variable, calculation_set=None):
 """ Calculates the gradient of the joint log posterior with respect to variable. Calculation of the log posterior is restricted to the variables in calculation_set. """

    return variable.logp_partial_gradient(variable, calculation_set) + sum(
        [child.logp_partial_gradient(variable, calculation_set) for child in variable.children])