<commit_before># -*- coding: utf-8 -*-
'''
    :codeauthor: <NAME> (<EMAIL>)


    runtests_helpers.py
    ~~~~~~~~~~~~~~~~~~~
'''

# Import python libs
from __future__ import absolute_import
import fnmatch
import os
import re
import sys
import fnmatch

# Import salt libs
import salt.utils.platform

# Import 3rd-party libs
from salt.ext import six

# Import tests libs
from tests.support.runtests import RUNTIME_VARS


def get_salt_temp_dir():
    return RUNTIME_VARS.TMP


def get_salt_temp_dir_for_path(*path):
    return os.path.join(RUNTIME_VARS.TMP, *path)


def get_sys_temp_dir_for_path(*path):
    return os.path.join(RUNTIME_VARS.SYS_TMP_DIR, *path)


def get_invalid_docs():
    '''
    Outputs the functions which do not have valid CLI example, or are missing a
    docstring.
    '''
    allow_failure = (
        'cmd.win_runas',
        'cp.recv',
        'cp.recv_chunked',
        'glance.warn_until',
        'ipset.long_range',
        'libcloud_compute.get_driver',
        'libcloud_dns.get_driver',
        'libcloud_loadbalancer.get_driver',<commit_msg>Account for salt-ssh tests and non importable `RUNTIME_VARS`<commit_after># -*- coding: utf-8 -*-
'''
    :codeauthor: <NAME> (<EMAIL>)


    runtests_helpers.py
    ~~~~~~~~~~~~~~~~~~~
'''

# Import python libs
from __future__ import absolute_import
import os
import re
import sys
import fnmatch
import tempfile

# Import salt libs
import salt.utils.platform

# Import 3rd-party libs
from salt.ext import six

# Import tests libs
try:
    from tests.support.runtests import RUNTIME_VARS
except ImportError:
    # Salt SSH Tests
    SYS_TMP_DIR = os.path.realpath(
        # Avoid ${TMPDIR} and gettempdir() on MacOS as they yield a base path too long
        # for unix sockets: ``error: AF_UNIX path too long``
        # Gentoo Portage prefers ebuild tests are rooted in ${TMPDIR}
        os.environ.get('TMPDIR', tempfile.gettempdir()) if not salt.utils.platform.is_darwin() else '/tmp'
    )
    # This tempdir path is defined on tests.integration.__init__
    TMP = os.path.join(SYS_TMP_DIR, 'salt-tests-tmpdir')

    class RUNTIME_VARS(object):
        TMP = TMP
        SYS_TMP_DIR = SYS_TMP_DIR


def get_salt_temp_dir():
    return RUNTIME_VARS.TMP


def get_salt_temp_dir_for_path(*path):
    return os.path.join(RUNTIME_VARS.TMP, *path)


def get_sys_temp_dir_for_path(*path):
    return os.path.join(RUNTIME_VARS.SYS_TMP_DIR, *path)


def get_invalid_docs():
    '''
    Outputs the functions which do not have valid CLI example, or are missing a
    docstring.
    '''
    allow_failure = (
        'cmd.win_runas',
        'cp.recv',
        'cp.recv_chunked',
        'glance.warn_until',
        'ipset.long_range',
        'libcloud_compute.get_driver',
        'libcloud_dns.get_driver',
        'libcloud_loadbalancer.get_driver',
{'fraction_non_alphanumeric': 0.11252653927813164, 'fraction_numerical': 0.0014154281670205238, 'mean_word_length': 3.26395173453997, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '373606', 'n_tokens_mistral': 980, 'n_tokens_neox': 958, 'n_words': 234}