<commit_before>from urllib.parse import urlparse


def cross_origin_resource_sharing(reqs: dict, expectation='cross-origin-resource-sharing-not-implemented') -> dict:
    """
    :param reqs: dictionary containing all the request and response objects
    :param expectation: test expectation
        cross-origin-resource-sharing-not-implemented: ACAO and the XML files don't exist [default]
        cross-origin-research-sharing-implemented: One of them does
    :return: dictionary with:
        data: the ACAO header, clientaccesspolicy.xml file, and crossorigin.xml file
        expectation: test expectation
        pass: whether the site's configuration met its expectation
        result: short string describing the result of the test
    """

    output = {
        'data': {
            'acao': None,
            'clientaccesspolicy': None,
            'crossorigin': None
        },
        'expectation': expectation,
        'pass': False,
        'result': None,
    }

    acao = reqs['responses']['auto']

    if 'Access-Control-Allow-Origin' in acao.headers:
        output['data']['acao'] = acao.headers['Access-Control-Allow-Origin']

        if '*' in output['acao']:<commit_msg>fix bug in acao analyzer<commit_after>from urllib.parse import urlparse


def cross_origin_resource_sharing(reqs: dict, expectation='cross-origin-resource-sharing-not-implemented') -> dict:
    """
    :param reqs: dictionary containing all the request and response objects
    :param expectation: test expectation
        cross-origin-resource-sharing-not-implemented: ACAO and the XML files don't exist [default]
        cross-origin-research-sharing-implemented: One of them does
    :return: dictionary with:
        data: the ACAO header, clientaccesspolicy.xml file, and crossorigin.xml file
        expectation: test expectation
        pass: whether the site's configuration met its expectation
        result: short string describing the result of the test
    """

    output = {
        'data': {
            'acao': None,
            'clientaccesspolicy': None,
            'crossorigin': None
        },
        'expectation': expectation,
        'pass': False,
        'result': None,
    }

    acao = reqs['responses']['auto']

    if 'Access-Control-Allow-Origin' in acao.headers:
        output['data']['acao'] = acao.headers['Access-Control-Allow-Origin']

        if '*' in output['data']['acao']:
{'fraction_non_alphanumeric': 0.10757136946628051, 'fraction_numerical': 0.0, 'mean_word_length': 2.8441971383147853, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '499951', 'n_tokens_mistral': 665, 'n_tokens_neox': 641, 'n_words': 191}