<commit_before>import subprocess
import os


def shell(command, paths=[]):
    startup_info = None
    shell = False
    login_shell = ["/usr/bin/env", "bash", "-l", "-c"]
    if os.name == 'nt':
        startup_info = subprocess.STARTUPINFO()
        startup_info.dwFlags |= subprocess.STARTF_USESHOWWINDOW
        startup_info.wShowWindow = subprocess.SW_HIDE
        shell = True
        login_shell = []

    env = os.environ.copy()
    if paths:
        env['PATH'] = os.pathsep.join(paths) + os.pathsep + env['PATH']

    def run(input, *args, **kwargs):
        process = subprocess.Popen(
            login_shell + command,
            stdin=subprocess.PIPE,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            startupinfo=startup_info,
            shell=shell,
            env=env,
            universal_newlines=True)
        stdout, stderr = process.communicate(input=input)
        ok = process.returncode == 0
        return ok, stdout, stderr

    return run<commit_msg>Newer sublime versions source login environment on launch<commit_after>import subprocess
import os


def shell(command, paths=[]):
    startup_info = None
    shell = False
    if os.name == 'nt':
        startup_info = subprocess.STARTUPINFO()
        startup_info.dwFlags |= subprocess.STARTF_USESHOWWINDOW
        startup_info.wShowWindow = subprocess.SW_HIDE
        shell = True

    env = os.environ.copy()
    if paths:
        env['PATH'] = os.pathsep.join(paths) + os.pathsep + env['PATH']

    def run(input, *args, **kwargs):
        process = subprocess.Popen(
            command,
            stdin=subprocess.PIPE,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            startupinfo=startup_info,
            shell=shell,
            env=env,
            universal_newlines=True)
        stdout, stderr = process.communicate(input=input)
        ok = process.returncode == 0
        return ok, stdout, stderr

    return run
{'fraction_non_alphanumeric': 0.10544904137235116, 'fraction_numerical': 0.0010090817356205853, 'mean_word_length': 2.2401960784313726, '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': '3577457', 'n_tokens_mistral': 606, 'n_tokens_neox': 599, 'n_words': 125}