<commit_before>import os
import subprocess

from ..platform_name import platform_name

if platform_name() == 'windows':
    from .windows import *
else:
    from .posix import *


class shell_list(list):
    """A special subclass of list used to mark that this command line uses
    special shell characters."""
    pass


def execute(args, shell=False, env=None, quiet=False):
    stderr = None
    if quiet:
        stderr = open(os.devnull, 'wb')
    try:
        result = subprocess.check_output(
            args, universal_newlines=True, shell=shell, env=env, stderr=stderr
        )
    finally:
        if quiet:
            stderr.close()
    return result<commit_msg>Clean up the shell execute() function<commit_after>import os
import subprocess

from ..platform_name import platform_name

if platform_name() == 'windows':
    from .windows import *
else:
    from .posix import *


class shell_list(list):
    """A special subclass of list used to mark that this command line uses
    special shell characters."""
    pass


def execute(args, shell=False, env=None, quiet=False):
    stderr = open(os.devnull, 'wb') if quiet else None
    try:
        return subprocess.check_output(
            args, universal_newlines=True, shell=shell, env=env, stderr=stderr
        )
    finally:
        if stderr:
            stderr.close()
{'fraction_non_alphanumeric': 0.09314456035767511, 'fraction_numerical': 0.0, 'mean_word_length': 2.9040697674418605, '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': '4978449', 'n_tokens_mistral': 390, 'n_tokens_neox': 380, 'n_words': 128}