<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_capacity(self, capacity):
 """ Set the desired capacity for the group. """

        params = {'AutoScalingGroupName' : self.name,
                  'DesiredCapacity'      : capacity}
        req = self.connection.get_object('SetDesiredCapacity', params,
                                         Request)
        self.connection.last_request = req
        return req