def _stop_reminder (message):

    # Remove the command form the text
    text = message['text'].replace('remind stop', '').strip()

    # Split the remainder of the text into 2 parts.
    # We are expecting either 'once' or 'recurring'
    # as the type of reminder and a number
    parts_list = text.split(' ')

    # Check the length of the list and assume a typo
    # if its not 2
    if len(parts_list) != 2:
        return 'Could not understand what you wanted. Expecting:\n' + \
               'remind stop [once/recurring] [message number]'

    message_type = parts_list[0]
    message_number = parts_list[1]

    # Check that we got once or recurring
    if message_type not in ['once', 'recurring']:
        return 'Could not figure out which message type you are referring to. ' + \
               'Expected \'once\' / \'recurring\''

    # For once time messages, perform the chatID check
    # and mark the message as sent if its ok
    if message_type == 'once':

        try:
            m = RemindOnce.select().where(RemindOnce.id == message_number).get()

            if json.loads(m.orig_message)['chat']['id'] == message['chat']['id']:

                m.sent = 1
                m.save()

            else:

                logger.warning('User {id} tried to disable a reminder they dont own'.format(
                    id = message['chat']['id']))
                return 'That message number does not exist or you dont own it.'

        except RemindOnce.DoesNotExist:
            return 'That message number does not exist or you dont own it.'

        return 'Done stopping the one time reminder'

    # The same here for the recurring message.
    if message_type == 'recurring':

        try:
            m = RemindRecurring.select().where(RemindRecurring.id == message_number).get()

            if json.loads(m.orig_message)['chat']['id'] == message['chat']['id']:

                m.sent = 1
                m.save()

            else:

                logger.warning('User {id} tried to disable a reminder they dont own'.format(
                    id = message['chat']['id']))
                return 'That message number does not exist or you dont own it.'

        except RemindRecurring.DoesNotExist:
            return 'That message number does not exist or you dont own it.'

        return 'Done stopping the recurring reminder'

    # We will most probably never get here, but
    # just in case...
    return 'Nothing happend...'
The entry point for the sample.
dataset/ETHPy150Open leonjza/hogar/hogar/Plugins/Reminders/main.py/_stop_reminder--crossover with--dataset/ETHPy150Open ibm-security-intelligence/api-samples/siem/09_GetOffensesForIp.py/main