<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 ctcp_reply(self, target, query, response):
 """ Send a CTCP reply to a target. """

        if self.is_channel(target) and not self.in_channel(target):
            raise client.NotInChannel(target)

        await self.notice(target, construct_ctcp(query, response))