def setContext(self, expression, context):
    if (type(expression).__name__ == 'Variable'):
        expression.context = context
    if hasattr(expression, 'operands'):
        for p in expression.operands:
            if (type(p).__name__ == 'Variable'):
                p.context = context
            elif hasattr(p, 'operands'):
                self.setContext(p, context)
def setContext(self, expression, context):
    if (type(expression).__name__ == 'Variable'):
        expression.context = context
    if hasattr(expression, 'operands'):
        for p in expression.operands:
            if (type(p).__name__ == 'Variable'):
                p.context = context
            elif hasattr(p, 'operands'):
                self.setContext(p, context)