decorator to give practices labels

def labeled(**kwargs):
    """decorator to give practices labels"""
    def for_practice(practice):
        """assigns label to practice"""
        practice.code = kwargs.pop('code')
        practice.msg = kwargs.pop('msg')
        practice.solution = kwargs.pop('solution')
        return practice
    return for_practice