<commit_before>import rapidsms
from rapidsms.apps.base import AppBase
from rapidsms_httprouter.models import Message
from django.conf import settings
class App (AppBase):
    def handle (self, message):
        if message.connection.identity in getattr(settings, 'MODEM_NUMBERS',
                                              ['256777773260', '256752145316',
                                               '256711957281', '256790403038',
                                               '256701205129']):
            Message.objects.create(direction="O", text=message.text,
                                           status='Q', connection=message.connection)
            return True
        return False
<commit_msg>make sure no duplicates resent<commit_after>import rapidsms
from rapidsms.apps.base import AppBase
from rapidsms_httprouter.models import Message
from django.conf import settings
class App (AppBase):
    def handle (self, message):
        if message.connection.identity in getattr(settings, 'MODEM_NUMBERS',
                                              ['256777773260', '256752145316',
                                               '256711957281', '256790403038',
                                               '256701205129']):
            res = Message.objects.filter(direction='O', text=message.text, status='S',
                    connection=message.connection).count()
            if res > 0:
                return True
            Message.objects.create(direction="O", text=message.text,
                                           status='Q', connection=message.connection)
            return True
        return False

{'fraction_non_alphanumeric': 0.08206686930091185, 'fraction_numerical': 0.07355623100303951, 'mean_word_length': 1.5962145110410095, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7099040', 'n_tokens_mistral': 441, 'n_tokens_neox': 371, 'n_words': 92}