<commit_before>#!/usr/bin/env python

import os
from scipy_distutils.misc_util import get_path, default_config_dict, dot_join
from scipy_distutils.misc_util import dict_append
from scipy_distutils.core import Extension
#from scipy_distutils.x11_info import get_x11_info
from scipy_distutils.system_info import x11_info


def configuration(parent_package=''):
    """
       gist only works with an X-windows server
       This will install *.gs and *.gp files to
       '%spython%s/site-packages/scipy/xplt' % (sys.prefix,sys.version[:3])
    """
    x11 = x11_info().get_info()
    if not x11:
        return

    config = default_config_dict('xplt',parent_package)
    local_path = get_path(__name__)
    
    sources = ['gistCmodule.c']
    sources = [os.path.join(local_path,x) for x in sources]

    ext_arg = {'name':dot_join(parent_package,'xplt.gistC'),
               'sources':sources}
    dict_append(ext_arg,**x11)
    dict_append(ext_arg,libraries=['m'])
    ext = Extension (**ext_arg)
    config['ext_modules'].append(ext)
        
    from glob import glob
    gist = glob(os.path.join(local_path,'gist','*.c'))
    # libraries are C static libraries
    config['libraries'].append(('gist',{'sources':gist,
                                        'macros':[('STDC_HEADERS',1)]}))
                                   
    file_ext = ['*.gs','*.gp', '*.ps', '*.help']
    xplt_files = [glob(os.path.join(local_path,x)) for x in file_ext]
    xplt_files = reduce(lambda x,y:x+y,xplt_files,[])
    xplt_path = os.path.join(parent_package,'xplt')
    config['data_files'].extend( [(xplt_path,xplt_files)])<commit_msg>Fixed typo<commit_after>#!/usr/bin/env python

import os
from scipy_distutils.misc_util import get_path, default_config_dict, dot_join
from scipy_distutils.misc_util import dict_append
from scipy_distutils.core import Extension
from scipy_distutils.system_info import x11_info


def configuration(parent_package=''):
    """
       gist only works with an X-windows server
       This will install *.gs and *.gp files to
       '%spython%s/site-packages/scipy/xplt' % (sys.prefix,sys.version[:3])
    """
    x11 = x11_info().get_info()
    if not x11:
        return {}

    config = default_config_dict('xplt',parent_package)
    local_path = get_path(__name__)
    
    sources = ['gistCmodule.c']
    sources = [os.path.join(local_path,x) for x in sources]

    ext_arg = {'name':dot_join(parent_package,'xplt.gistC'),
               'sources':sources}
    dict_append(ext_arg,**x11)
    dict_append(ext_arg,libraries=['m'])
    ext = Extension (**ext_arg)
    config['ext_modules'].append(ext)
        
    from glob import glob
    gist = glob(os.path.join(local_path,'gist','*.c'))
    # libraries are C static libraries
    config['libraries'].append(('gist',{'sources':gist,
                                        'macros':[('STDC_HEADERS',1)]}))
                                   
    file_ext = ['*.gs','*.gp', '*.ps', '*.help']
    xplt_files = [glob(os.path.join(local_path,x)) for x in file_ext]
    xplt_files = reduce(lambda x,y:x+y,xplt_files,[])
    xplt_path = os.path.join(parent_package,'xplt')
    config['data_files'].extend( [(xplt_path,xplt_files)])
{'fraction_non_alphanumeric': 0.1417421167655323, 'fraction_numerical': 0.008741804558226662, 'mean_word_length': 3.2269129287598943, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4515673', 'n_tokens_mistral': 1133, 'n_tokens_neox': 1080, 'n_words': 200}