<commit_before>#  !  /usr/bin/env python3
import tempfile
from collections import defaultdict
from subprocess import CalledProcessError
from pyscripts.utilities import run
from pyscripts.utilities import sed_inplace

def install_packages(user_input, install_user_name):
    ### Setup Package List
    print(" >> Creating package list")
    print(" Your choices: ", user_input)

    misc_packages = ['vim',
                     'vim-supertab',
                     'vim-jedi',
                     'zsh',
                     'powerline-fonts',
                     'p7zip',
                     'unrar',
                     'fortune-mod',
                     'reflector',
                     'tree']
    packages = {
        'minimal': {
            'desktop' : [],
            'server'  : ['openssh']},
        'developer': defaultdict(lambda:
                                 ['cmake',
                                  'boost',
                                  'eigen',
                                  'opencl-headers',
                                  'ocl-icd',
                                  'openmpi',
                                  'hdf5-cpp-fortran',
                                  'python2-pip',
                                  'python-pip',
                                  'ipython',
                                  'python-h5py',
                                  'python-scipy',
                                  'python-matplotlib',
                                  'python-pillow',
                                  'python-pylint',
                                  'autopep8',
                                  'doxygen',
                                  'clinfo']),
        'office': defaultdict(lambda:
                              ['texlive-most',
                               'texlive-lang']),
        'media': {
            'desktop' : ['gnuplot',
                         'graphviz',
                         'ffmpeg'],
            'server'  : ['gnuplot',
                         'graphviz',
                         'ffmpeg',
                         'teamspeak3-server']
        }
    }

    desktop_distros = {
        "KDE plasma": ['xorg-server',
                       'xorg-apps',
                       'yakuake',
                       'plasma-meta',
                       'kde-applications']
    }

    gui_packages = {
        'minimal': {
            'desktop': ['qtox',
                        'xclip',
                        'yakuake-skin-breeze-thin-dark'],
            'server': ['yakuake-skin-breeze-thin-dark']},
        'developer': defaultdict(lambda: ['xterm', 'visual-studio-code']),
        'office': defaultdict(lambda:
                              ['texstudio',
                               'libreoffice-fresh']),
        'media': {
            'desktop': ['teamspeak3',
                        'gimp',
                        'inkscape',
                        'blender',
                        'handbrake',
                        'vlc',
                        'skypeforlinux-bin',
                        'nextcloud-client'],
            'server': ['vlc',
                       'nextcloud']}
    }

    graphics_driver_packages = {
        'default': ['mesa', 'mesa-libgl', 'xf86-video-vesa', 'opencl-mesa'],
        'intel':   ['mesa', 'mesa-libgl', 'xf86-video-intel', 'opencl-mesa'],
        'nvidia':  ['nvidia', 'nvidia-libgl', 'opencl-nvidia'],
        'amd':     ['mesa', 'mesa-libgl', 'xf86-video-vesa', 'opencl-mesa'],
        'vbox':    ['virtualbox-guest-modules-arch', 'virtualbox-guest-utils', 'opencl-mesa']}

    package_list = misc_packages
    package_list += graphics_driver_packages[user_input['graphics driver']]

    if 'full' in user_input['packages']:
        for _, value in packages.items():
            package_list += value[user_input['system type']]
        
        if user_input['desktop'] != 'none':
            package_list += desktop_distros[user_input['desktop']]
            for _, value in gui_packages.items():
                package_list += value[user_input['system type']]

    else:
        for package_type in set(['minimal'] + user_input['packages']):
            package_list += packages[package_type][user_input['system type']]

            if user_input['desktop'] != 'none':
                package_list += desktop_distros[user_input['desktop']]
                package_list += gui_packages[package_type][user_input['system type']]

    package_string = " ".join(package_list)
<commit_msg>Added multicore compile to arch install.<commit_after>#  !  /usr/bin/env python3
import tempfile
from collections import defaultdict
from subprocess import CalledProcessError
from pyscripts.utilities import run
from pyscripts.utilities import sed_inplace

def install_packages(user_input, install_user_name):
    ### Setup Package List
    print(" >> Creating package list")
    print(" Your choices: ", user_input)

    sed_inplace(
        '/etc/makepkg.conf',
        '#MAKEFLAGS="-j2"',
        'MAKEFLAGS="-j$(nproc)"')
    sed_inplace(
        '/mnt/etc/makepkg.conf',
        '#MAKEFLAGS="-j2"',
        'MAKEFLAGS="-j$(nproc)"')

    misc_packages = ['vim',
                     'vim-supertab',
                     'vim-jedi',
                     'zsh',
                     'powerline-fonts',
                     'p7zip',
                     'unrar',
                     'fortune-mod',
                     'reflector',
                     'tree']
    packages = {
        'minimal': {
            'desktop' : [],
            'server'  : ['openssh']},
        'developer': defaultdict(lambda:
                                 ['cmake',
                                  'boost',
                                  'eigen',
                                  'opencl-headers',
                                  'ocl-icd',
                                  'openmpi',
                                  'hdf5-cpp-fortran',
                                  'python2-pip',
                                  'python-pip',
                                  'ipython',
                                  'python-h5py',
                                  'python-scipy',
                                  'python-matplotlib',
                                  'python-pillow',
                                  'python-pylint',
                                  'autopep8',
                                  'doxygen',
                                  'clinfo']),
        'office': defaultdict(lambda:
                              ['texlive-most',
                               'texlive-lang']),
        'media': {
            'desktop' : ['gnuplot',
                         'graphviz',
                         'ffmpeg'],
            'server'  : ['gnuplot',
                         'graphviz',
                         'ffmpeg',
                         'teamspeak3-server']
        }
    }

    desktop_distros = {
        "KDE plasma": ['xorg-server',
                       'xorg-apps',
                       'yakuake',
                       'plasma-meta',
                       'kde-applications']
    }

    gui_packages = {
        'minimal': {
            'desktop': ['qtox',
                        'xclip',
                        'yakuake-skin-breeze-thin-dark'],
            'server': ['yakuake-skin-breeze-thin-dark']},
        'developer': defaultdict(lambda: ['xterm', 'visual-studio-code']),
        'office': defaultdict(lambda:
                              ['texstudio',
                               'libreoffice-fresh']),
        'media': {
            'desktop': ['teamspeak3',
                        'gimp',
                        'inkscape',
                        'blender',
                        'handbrake',
                        'vlc',
                        'skypeforlinux-bin',
                        'nextcloud-client'],
            'server': ['vlc',
                       'nextcloud']}
    }

    graphics_driver_packages = {
        'default': ['mesa', 'mesa-libgl', 'xf86-video-vesa', 'opencl-mesa'],
        'intel':   ['mesa', 'mesa-libgl', 'xf86-video-intel', 'opencl-mesa'],
        'nvidia':  ['nvidia', 'nvidia-libgl', 'opencl-nvidia'],
        'amd':     ['mesa', 'mesa-libgl', 'xf86-video-vesa', 'opencl-mesa'],
        'vbox':    ['virtualbox-guest-modules-arch', 'virtualbox-guest-utils', 'opencl-mesa']}

    package_list = misc_packages
    package_list += graphics_driver_packages[user_input['graphics driver']]

    if 'full' in user_input['packages']:
        for _, value in packages.items():
            package_list += value[user_input['system type']]

        if user_input['desktop'] != 'none':
            package_list += desktop_distros[user_input['desktop']]
            for _, value in gui_packages.items():
                package_list += value[user_input['system type']]

    else:
        for package_type in set(['minimal'] + user_input['packages']):
            package_list += packages[package_type][user_input['system type']]

            if user_input['desktop'] != 'none':
                package_list += desktop_distros[user_input['desktop']]
                package_list += gui_packages[package_type][user_input['system type']]

    package_string = " ".join(package_list)

{'fraction_non_alphanumeric': 0.1281223083548665, 'fraction_numerical': 0.003229974160206718, 'mean_word_length': 1.1527230590961761, 'pattern_counts': {'":': 2, '<': 3, '<?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': 36, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4089073', 'n_tokens_mistral': 2573, 'n_tokens_neox': 2399, 'n_words': 399}