<commit_before># coding: utf-8

from fabkit import api, run, sudo


def add(name):
    with api.warn_only():
        passwd = run('cat /etc/passwd | grep ^{0}:'.format(name))
        if passwd.return_code != 0:
            sudo('useradd {0} -M -s/bin/false'.format(name))<commit_msg>add group option to user add<commit_after># coding: utf-8

from fabkit import api, run, sudo


def add(name, group=None):
    with api.warn_only():
        passwd = run('cat /etc/passwd | grep ^{0}:'.format(name))
        if passwd.return_code != 0:
            sudo('useradd {0} -M -s/bin/false'.format(name))

        if group is not None:
            sudo('gpasswd -add {0} {1}'.format(name, group))
{'fraction_non_alphanumeric': 0.16058394160583941, 'fraction_numerical': 0.014598540145985401, 'mean_word_length': 2.6881720430107525, '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': '5866417', 'n_tokens_mistral': 248, 'n_tokens_neox': 235, 'n_words': 65}