<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def toggle_badge(self, kind):
        '''Toggle a bdage given its kind'''
        badge = self.get_badge(kind)
        if badge:
            return self.remove_badge(kind)
        else:
            return self.add_badge(kind)