<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 mod(self, iden, query):
        '''
        Change the query of an appointment
        '''
        appt = self.appts.get(iden)
        if appt is None:
            raise s_exc.NoSuchIden()

        if not query:
            raise ValueError('empty query')

        if self.enabled:
            self.core.getStormQuery(query)

        appt.query = query
        appt.enabled = True  # in case it was disabled for a bad query

        await self._storeAppt(appt)