<commit_before>import unittest
from compliance_checker.acdd import ACDD1_1Check, ACDD1_3Check
# from netCDF4 import Dataset

def to_singleton_var(l):
    """Get the first value of a list if this implements iterator protocol"""
    return [x[0] if hasattr(x, '__iter__') else x for x in l]

def check_varset_nonintersect(true_set, name_list):
    """
    Helper function intended to check that the series we scraped from the HTML
    table is equal to the list of values we have
    """
    return len(true_set ^ set(to_singleton_var(name_list))) == 0



class TestACDD1_1(unittest.TestCase):

    # Adapted using `pandas.read_html` from URL
    # http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery_1-1<commit_msg>Fix ACDD tests under Python 3<commit_after>import unittest
from compliance_checker.acdd import ACDD1_1Check, ACDD1_3Check
# from netCDF4 import Dataset

def to_singleton_var(l):
    """
    Get the first value of a list if this implements iterator protocol
    and is not a string
    """
    return [x[0] if hasattr(x, '__iter__') and not isinstance(x, str) else x
            for x in l]

def check_varset_nonintersect(true_set, name_list):
    """
    Helper function intended to check that the series we scraped from the HTML
    table is equal to the list of values we have
    """
    return len(true_set ^ set(to_singleton_var(name_list))) == 0



class TestACDD1_1(unittest.TestCase):

    # Adapted using `pandas.read_html` from URL
    # http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery_1-1
{'fraction_non_alphanumeric': 0.0800768737988469, 'fraction_numerical': 0.014734144778987828, 'mean_word_length': 4.087947882736156, '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': '6523894', 'n_tokens_mistral': 526, 'n_tokens_neox': 512, 'n_words': 161}