<commit_before>from fabric.api import env, run, settings, hide

# Default system user
env.user = 'ubuntu'

# Default puppet environment
env.environment = 'prod'

# Default puppet module directory
env.puppet_module_dir = 'modules/'

# Default puppet version
env.loom_puppet_version = '3.1.1'

# Default librarian version
env.loom_librarian_version = '0.9.9'


def host_roles(host_string):
    """
    Returns the role of a given host string.
    """
    roles = []
    for role, hosts in env.roledefs.items():
        if host_string in hosts and role not in roles:
            roles.append(role)
    return roles


def current_roles():
    return host_roles(env.host_string)


def has_puppet_installed():
    with settings(hide('warnings', 'running', 'stdout', 'stderr'), warn_only=True):
        result = run('which puppet')
    return result.succeeded


<commit_msg>adding docs for puppet and loom versions if they are None<commit_after>from fabric.api import env, run, settings, hide

# Default system user
env.user = 'ubuntu'

# Default puppet environment
env.environment = 'prod'

# Default puppet module directory
env.puppet_module_dir = 'modules/'

# Default puppet version
# If loom_puppet_version is None, loom installs the latest version
env.loom_puppet_version = '3.1.1'

# Default librarian version
# If loom_librarian_version is None, loom installs the latest version
env.loom_librarian_version = '0.9.9'


def host_roles(host_string):
    """
    Returns the role of a given host string.
    """
    roles = []
    for role, hosts in env.roledefs.items():
        if host_string in hosts and role not in roles:
            roles.append(role)
    return roles


def current_roles():
    return host_roles(env.host_string)


def has_puppet_installed():
    with settings(hide('warnings', 'running', 'stdout', 'stderr'), warn_only=True):
        result = run('which puppet')
    return result.succeeded



{'fraction_non_alphanumeric': 0.09921671018276762, 'fraction_numerical': 0.006266318537859008, 'mean_word_length': 3.730864197530864, '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': '1722877', 'n_tokens_mistral': 628, 'n_tokens_neox': 598, 'n_words': 184}