<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _validate_granttype(self, path, obj, _):
 """ make sure either implicit or authorization_code is defined """

        errs = []

        if not obj.implicit and not obj.authorization_code:
            errs.append('Either implicit or authorization_code should be defined.')

        return path, obj.__class__.__name__, errs