<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def kick(self, channel, target, reason=None):
 """ Kick user from channel. """

        if not self.in_channel(channel):
            raise NotInChannel(channel)

        if reason:
            await self.rawmsg('KICK', channel, target, reason)
        else:
            await self.rawmsg('KICK', channel, target)