<commit_before>import isodate

from lxml import etree


def parse_site_values(content_io, namespace, query_isodate):
    """
    """
    data_dict = {}
    for (event, ele) in etree.iterparse(content_io):
        if ele.tag == namespace + "timeSeries":
            values_element = ele.find(namespace + 'values')
            values = _parse_values(values_element)
            var_element = ele.find(namespace + 'variable')
            variable = _parse_variable(var_element)
            code = variable['code']
            if 'statistic' in variable:
                code += ":" + variable['statistic']['code']
            data_dict[code] = {
                'last_refresh': query_isodate,
                'values': values,
                'variable': variable,
            }
    return data_dict
<commit_msg>fix waterml parse_site_values func, need to pass namespace along<commit_after>import isodate

from lxml import etree


def parse_site_values(content_io, namespace, query_isodate):
    """
    """
    data_dict = {}
    for (event, ele) in etree.iterparse(content_io):
        if ele.tag == namespace + "timeSeries":
            values_element = ele.find(namespace + 'values')
            values = _parse_values(values_element, namespace)
            var_element = ele.find(namespace + 'variable')
            variable = _parse_variable(var_element, namespace)
            code = variable['code']
            if 'statistic' in variable:
                code += ":" + variable['statistic']['code']
            data_dict[code] = {
                'last_refresh': query_isodate,
                'values': values,
                'variable': variable,
            }
    return data_dict

{'fraction_non_alphanumeric': 0.10821998817267889, 'fraction_numerical': 0.0, 'mean_word_length': 2.174484052532833, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1645728', 'n_tokens_mistral': 471, 'n_tokens_neox': 460, 'n_words': 104}