def METHOD_NAME(self):
    def f(x):
        if x > 0:
            sum = 0
            while x > 0:
                x = x - 1
                square = x * x
                sum = sum + square
        else:
            sum = 0
        return sum
    self.assert_assigned_vars(f, {"sum", "x", "square"})