def grant_bonus(self, assignment_id, amount, reason):
assignment = self.get_assignment(assignment_id)<EOL>worker_id = assignment["<STR_LIT>"]<EOL>amount_str = "<STR_LIT>".format(amount)<EOL>try:<EOL><INDENT>return self._is_ok(<EOL>self.mturk.send_bonus(<EOL>WorkerId=worker_id,<EOL>BonusAmount=amount_str,<EOL>AssignmentId=assignment_id,<EOL>Reason=reason,<EOL>UniqueRequestToken=self._request_token(),<EOL>)<EOL>)<EOL><DEDENT>except ClientError as ex:<EOL><INDENT>error = "<STR_LIT>".format(<EOL>assignment_id, amount_str, str(ex)<EOL>)<EOL>raise MTurkServiceException(error)<EOL><DEDENT>
Grant a bonus to the MTurk Worker.
        Issues a payment of money from your account to a Worker.  To
        be eligible for a bonus, the Worker must have submitted
        results for one of your HITs, and have had those results
        approved or rejected. This payment happens separately from the
        reward you pay to the Worker when you approve the Worker's
        assignment.