<commit_before>#!/usr/bin/env python
"""Provides an entry point for python scripts and python modules on the controller with the current python interpreter and optional code coverage collection."""

import imp
import os
import sys


def main():
    """Main entry point."""
    name = os.path.basename(__file__)
    args = [sys.executable]

    coverage_config = os.environ.get('_ANSIBLE_COVERAGE_CONFIG')
    coverage_output = os.environ.get('_ANSIBLE_COVERAGE_OUTPUT')

    if coverage_config:
        if coverage_output:
            args += ['-m', 'coverage.__main__', 'run', '--rcfile', coverage_config]
        else:
            try:
                imp.find_module('coverage')
            except ImportError:
                exit('ERROR: Could not find `coverage` module. Did you use a virtualenv created without --system-site-packages or with the wrong interpreter?')

    if name == 'python.py':
        if sys.argv[1] == '-c':
            # prevent simple misuse of python.py with -c which does not work with coverage
            sys.exit('ERROR: Use `python -c` instead of `python.py -c` to avoid errors when code coverage is collected.')
    elif name == 'pytest':
        args += ['-m', 'pytest']
    else:
        args += [find_executable(name)]

    args += sys.argv[1:]

    os.execv(args[0], args)


def find_executable(name):
    """
    :type name: str
    :rtype: str
    """
    path = os.environ.get('PATH', os.path.defpath)
    seen = set([os.path.abspath(__file__)])
<commit_msg>Fix ansible-test injector warning on Python 3.7.<commit_after>#!/usr/bin/env python
"""Provides an entry point for python scripts and python modules on the controller with the current python interpreter and optional code coverage collection."""

import os
import sys


def main():
    """Main entry point."""
    name = os.path.basename(__file__)
    args = [sys.executable]

    coverage_config = os.environ.get('_ANSIBLE_COVERAGE_CONFIG')
    coverage_output = os.environ.get('_ANSIBLE_COVERAGE_OUTPUT')

    if coverage_config:
        if coverage_output:
            args += ['-m', 'coverage.__main__', 'run', '--rcfile', coverage_config]
        else:
            if sys.version_info >= (3, 4):
                import importlib.util

                found = bool(importlib.util.find_spec('coverage'))
            else:
                import imp

                try:
                    imp.find_module('coverage')
                    found = True
                except ImportError:
                    found = False

            if not found:
                exit('ERROR: Could not find `coverage` module. Did you use a virtualenv created without --system-site-packages or with the wrong interpreter?')

    if name == 'python.py':
        if sys.argv[1] == '-c':
            # prevent simple misuse of python.py with -c which does not work with coverage
            sys.exit('ERROR: Use `python -c` instead of `python.py -c` to avoid errors when code coverage is collected.')
    elif name == 'pytest':
        args += ['-m', 'pytest']
    else:
        args += [find_executable(name)]

    args += sys.argv[1:]

    os.execv(args[0], args)


def find_executable(name):
    """
    :type name: str
    :rtype: str
    """
    path = os.environ.get('PATH', os.path.defpath)
    seen = set([os.path.abspath(__file__)])

{'fraction_non_alphanumeric': 0.12082957619477007, 'fraction_numerical': 0.003005710850616171, 'mean_word_length': 2.385554425228891, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '100976', 'n_tokens_mistral': 993, 'n_tokens_neox': 958, 'n_words': 298}