<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 <NAME> <<EMAIL>>
#
# This software is licensed as described in the file LICENSE, which
# you should have received as part of this distribution.
#


import os
import sys
import urlparse
import urllib

__all__ = ['popen3', 'in_couchapp', 'parse_uri', 'parse_auth',
        'get_appname', 'to_bytestring', 'vendor_dir',
        'user_rcpath', 'rcpath', 'locate_program', 'deltree', 
        'relpath', 'user_path']


try:#python 2.6, use subprocess
    import subprocess
    subprocess.Popen  # trigger ImportError early
    closefds = os.name == 'posix'
    
    def popen3(cmd, mode='t', bufsize=0):
        p = subprocess.Popen(cmd, shell=True, bufsize=bufsize,
            stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, 
            close_fds=closefds)
        p.wait()
        return (p.stdin, p.stdout, p.stderr)
except ImportError:
    subprocess = None
    popen3 = os.popen3
    
if os.name == 'nt':
    def user_rcpath():
        try:
            home = os.path.expanduser('~')
            if sys.getwindowsversion()[3] != 2 and userdir == '~':
                 # We are on win < nt: fetch the APPDATA directory location and use
                    # the parent directory as the user home dir.
                appdir = shell.SHGetPathFromIDList(
                    shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_APPDATA))
                home = os.path.dirname(appdir)
            path = os.path.join(home, '.couchapp.conf')
        except:
            home = os.path.expanduser('~')
            path = os.path.join(home, '.couchapp.conf')
        userprofile = [os.environ.get('USERPROFILE')]
        if userprofile:
            path.append(os.path.join(userprofile, '.couchapp.conf'))<commit_msg>fix issue spotted by kathy on ml.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 <NAME> <<EMAIL>>
#
# This software is licensed as described in the file LICENSE, which
# you should have received as part of this distribution.
#


import os
import sys
import urlparse
import urllib

__all__ = ['popen3', 'in_couchapp', 'parse_uri', 'parse_auth',
        'get_appname', 'to_bytestring', 'vendor_dir',
        'user_rcpath', 'rcpath', 'locate_program', 'deltree', 
        'relpath', 'user_path']


try:#python 2.6, use subprocess
    import subprocess
    subprocess.Popen  # trigger ImportError early
    closefds = os.name == 'posix'
    
    def popen3(cmd, mode='t', bufsize=0):
        p = subprocess.Popen(cmd, shell=True, bufsize=bufsize,
            stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, 
            close_fds=closefds)
        p.wait()
        return (p.stdin, p.stdout, p.stderr)
except ImportError:
    subprocess = None
    popen3 = os.popen3
    
if os.name == 'nt':
    def user_rcpath():
        path = []
        try:
            home = os.path.expanduser('~')
            if sys.getwindowsversion()[3] != 2 and userdir == '~':
                 # We are on win < nt: fetch the APPDATA directory location and use
                    # the parent directory as the user home dir.
                appdir = shell.SHGetPathFromIDList(
                    shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_APPDATA))
                home = os.path.dirname(appdir)
            path.append(os.path.join(home, '.couchapp.conf'))
        except:
            home = os.path.expanduser('~')
            path.append(os.path.join(home, '.couchapp.conf'))
        userprofile = [os.environ.get('USERPROFILE')]
        if userprofile:
            path.append(os.path.join(userprofile, '.couchapp.conf'))
{'fraction_non_alphanumeric': 0.12561174551386622, 'fraction_numerical': 0.008156606851549755, 'mean_word_length': 2.4287045666356013, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '1963600', 'n_tokens_mistral': 1198, 'n_tokens_neox': 1166, 'n_words': 284}