<commit_before>def is_bot(request):
    """Checks if the thing making a request is a crawler."""
    known_bots = ['baiduspider', 'bingbot', 'dotbot', 'googlebot',
                  'kaloogabot', 'ia_archiver', 'msnbot', 'slurp',
                  'speedy spider', 'teoma', 'twiceler', 'yandexbot', 'yodaobot']
    user_agent = request.META.get('HTTP_USER_AGENT', "Testing U-A")
    is_known_bot = False
    for bot in known_bots:
        if bot in user_agent.lower():
            is_known_bot = True
            break

    return is_known_bot
<commit_msg>Minor tweaks to the bot detector for clarity.<commit_after>def is_bot(request):
    """Checks if the thing making a request is a crawler."""
    known_bots = ['baiduspider', 'bingbot', 'dotbot', 'googlebot',
                  'kaloogabot', 'ia_archiver', 'msnbot', 'slurp',
                  'speedy spider', 'teoma', 'twiceler', 'yandexbot', 'yodaobot']
    user_agent = request.META.get('HTTP_USER_AGENT', "Testing U-A")
    for bot in known_bots:
        if bot in user_agent.lower():
            return True

    return False

{'fraction_non_alphanumeric': 0.13167587476979742, 'fraction_numerical': 0.0, 'mean_word_length': 2.8274647887323945, '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': '6113900', 'n_tokens_mistral': 371, 'n_tokens_neox': 360, 'n_words': 96}