<commit_before>from bs4 import BeautifulSoup as bs
from publicsuffixlist import PublicSuffixList
from urllib.parse import urlparse

from httpobs.scanner.analyzer.decorators import scored_test
from httpobs.scanner.analyzer.utils import only_if_worse

import json


MOZILLA_DOMAINS = ('mozilla', 'allizom', 'firefox', 'webmaker')


@scored_test
def contribute(reqs: dict, expectation='contribute-json-with-required-keys') -> dict:
    """
    :param reqs: dictionary containing all the request and response objects
    :param expectation: test expectation
        contribute-json-with-required-keys: contribute.json exists, with all the required_keys [default]
        contribute-json-missing-required-keys: contribute.json exists, but missing some of the required_keys (A-)
        contribute-json-only-required-on-mozilla-properties: contribute.json isn't required,
          since it's not a Mozilla domain
        contribute-json-not-implemented: contribute.json file missing (B+)
    :return: dictionary with:
        data: the parsed contribute.json file
        expectation: test expectation
        pass: whether the site's configuration met its expectation (null for non-Mozilla sites)
        result: short string describing the result of the test
    """<commit_msg>Add a couple extra mozilla domains<commit_after>from bs4 import BeautifulSoup as bs
from publicsuffixlist import PublicSuffixList
from urllib.parse import urlparse

from httpobs.scanner.analyzer.decorators import scored_test
from httpobs.scanner.analyzer.utils import only_if_worse

import json


MOZILLA_DOMAINS = ('mozilla', 'allizom', 'browserid', 'firefox', 'persona', 'taskcluster', 'webmaker')


@scored_test
def contribute(reqs: dict, expectation='contribute-json-with-required-keys') -> dict:
    """
    :param reqs: dictionary containing all the request and response objects
    :param expectation: test expectation
        contribute-json-with-required-keys: contribute.json exists, with all the required_keys [default]
        contribute-json-missing-required-keys: contribute.json exists, but missing some of the required_keys (A-)
        contribute-json-only-required-on-mozilla-properties: contribute.json isn't required,
          since it's not a Mozilla domain
        contribute-json-not-implemented: contribute.json file missing (B+)
    :return: dictionary with:
        data: the parsed contribute.json file
        expectation: test expectation
        pass: whether the site's configuration met its expectation (null for non-Mozilla sites)
        result: short string describing the result of the test
    """
    # TODO: allow a bonus if you have a contribute.json on a non-Mozilla website
{'fraction_non_alphanumeric': 0.07840951319212189, 'fraction_numerical': 0.0007432181345224824, 'mean_word_length': 4.031775700934579, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7040403', 'n_tokens_mistral': 725, 'n_tokens_neox': 711, 'n_words': 249}