<commit_before>from glob import glob
import re, os, sys
from cython import set


from distutils.extension import Extension

from Cython import Utils
from Cython.Compiler.Main import Context, CompilationOptions, default_options

# Unfortunately, Python 2.3 doesn't support decorators.
def cached_method(f):
    cache_name = '__%s_cache' % f.__name__
    def wrapper(self, *args):
        cache = getattr(self, cache_name, None)
        if cache is None:
            cache = {}
            setattr(self, cache_name, cache)
        if args in cache:
            return cache[args]
        res = cache[args] = f(self, *args)
        return res
    return wrapper


def parse_list(s):
    if s[0] == '[' and s[-1] == ']':
        s = s[1:-1]
        delimiter = ','
    else:
        delimiter = ' '
    s, literals = strip_string_literals(s)
    def unquote(literal):
        literal = literal.strip()
        if literal[0] == "'":
            return literals[literal[1:-1]]
        else:
            return literal

    return [unquote(item) for item in s.split(delimiter)]

transitive_str = object()
transitive_list = object()

distutils_settings = {<commit_msg>Minor distutils parsing fixes.<commit_after>from glob import glob
import re, os, sys
from cython import set


from distutils.extension import Extension

from Cython import Utils
from Cython.Compiler.Main import Context, CompilationOptions, default_options

# Unfortunately, Python 2.3 doesn't support decorators.
def cached_method(f):
    cache_name = '__%s_cache' % f.__name__
    def wrapper(self, *args):
        cache = getattr(self, cache_name, None)
        if cache is None:
            cache = {}
            setattr(self, cache_name, cache)
        if args in cache:
            return cache[args]
        res = cache[args] = f(self, *args)
        return res
    return wrapper


def parse_list(s):
    """
    >>> parse_list("a b c")
    ['a', 'b', 'c']
    >>> parse_list("[a, b, c]")
    ['a', 'b', 'c']
    >>> parse_list('a " " b')
    ['a', ' ', 'b']
    >>> parse_list('[a, ",a", "a,", ",", ]')
    ['a', ',a', 'a,', ',']
    """
    if s[0] == '[' and s[-1] == ']':
        s = s[1:-1]
        delimiter = ','
    else:
        delimiter = ' '
    s, literals = strip_string_literals(s)
    def unquote(literal):
        literal = literal.strip()
        if literal[0] in "'\"":
            return literals[literal[1:-1]]
        else:
            return literal
    return [unquote(item) for item in s.split(delimiter) if item.strip()]

transitive_str = object()
transitive_list = object()

distutils_settings = {
{'fraction_non_alphanumeric': 0.13773148148148148, 'fraction_numerical': 0.006944444444444444, 'mean_word_length': 2.5183175033921303, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 15, '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': '5081185', 'n_tokens_mistral': 835, 'n_tokens_neox': 826, 'n_words': 232}