def set(self, client_id, code, request, *args, **kwargs):
expires = datetime.utcnow() + timedelta(seconds=<NUM_LIT:100>)<EOL>grant = self.model(<EOL>client_id=request.client.client_id,<EOL>code=code['<STR_LIT:code>'],<EOL>redirect_uri=request.redirect_uri,<EOL>scope='<STR_LIT:U+0020>'.join(request.scopes),<EOL>user=self.current_user(),<EOL>expires=expires<EOL>)<EOL>self.session.add(grant)<EOL>self.session.commit()<EOL>
Creates Grant object with the given params

        :param client_id: ID of the client
        :param code:
        :param request: OAuthlib request object