<commit_before>registry = {}

def register(model, fields):
    registry[str(model)] = (model, fields)

def search_for_string(search_string):
    search_string = search_string.lower()
    matches = []
    for key in registry:
        model, fields = registry[key]
        for object in model.objects.all():
            for field in fields:
                try:
                    searchee = getattr(object, field)
                except AttributeError:
                    pass
                if search_string in [s.lower() for s in searchee.split()]:
                    matches.append(object)
    return matches<commit_msg>Fixed mistake in search code.<commit_after>registry = {}

def register(model, fields):
    registry[str(model)] = (model, fields)

def search_for_string(search_string):
    search_string = search_string.lower()
    matches = []
    for key in registry:
        model, fields = registry[key]
        for object in model.objects.all():
            for field in fields:
                try:
                    searchee = getattr(object, field)
                except AttributeError:
                    pass
                if search_string in searchee.lower():
                    matches.append(object)
    return matches
{'fraction_non_alphanumeric': 0.08821170809943865, 'fraction_numerical': 0.0, 'mean_word_length': 1.882217090069284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1503270', 'n_tokens_mistral': 326, 'n_tokens_neox': 315, 'n_words': 89}