<commit_before>from os.path import basename
from fabric.api import run
from fabric.api import put
from fabric.api import env
import os
import generate_xml

ABS_DIR = os.path.abspath('fabfile.py').rsplit('/', 1)[0]


def net():
    env.user = 'osbash'
    env.password = '<PASSWORD>'
    vm = generate_xml.GenerateXml()
    guest_ip = vm.get_ip('template2')
    env.hosts = ['%s' % guest_ip]


def net_init_controller():
    env.user = 'osbash'
    env.password = '<PASSWORD>'
    # vm = generate_xml.GenerateXml()
    # guest_ip = vm.get_ip('controller')
    guest_ip = input('Enter controller IP')
    env.hosts = ['%s' % guest_ip]


def net_init_compute():
    env.user = 'osbash'
    env.password = '<PASSWORD>'
    # vm = generate_xml.GenerateXml()
    # guest_ip = vm.get_ip('compute')
    guest_ip = input('Enter compute ip')
    env.hosts = ['%s' % guest_ip]


def net_init_network():
    env.user = 'osbash'
    env.password = '<PASSWORD>'
    # vm = generate_xml.GenerateXml()
    # guest_ip = vm.get_ip('network')
    guest_ip = input('Enter network ip')
    env.hosts = ['%s' % guest_ip]


def net_controller():
    env.user = 'osbash'
    env.password = '<PASSWORD>'
    env.hosts = ['10.10.10.51']


def net_compute():
    env.user = 'osbash'
    env.password = '<PASSWORD>'
    env.hosts = ['10.10.10.53']


def net_network():
    env.user = 'osbash'
    env.password = '<PASSWORD>'
    env.hosts = ['10.10.10.52']


def autostart(source):
    put(source, '/home/osbash/autostart/%s' % basename(source))
    run('sudo chmod a=r+w+x /home/osbash/autostart/%s' % basename(source))
    run('sudo bash /home/osbash/autostart/%s' % basename(source))


def base():
    run('mkdir autostart')
    run('mkdir log')
    put(ABS_DIR + '/osbash/config', '/home/osbash')
    put(ABS_DIR + '/osbash/lib', '/home/osbash')

    autostart(ABS_DIR + '/osbash/scripts/osbash/base_fixups.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/apt_init.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/apt_pre-download.sh')
    autostart(ABS_DIR + '/osbash/scripts/zero_empty.sh')


def controller_init():
    run('sudo rm -rf /home/osbash/autostart')
    run('sudo rm -rf /home/osbash/log')
    run('sudo mkdir autostart')
    run('sudo mkdir log')
    run('sudo apt-get update')
    put(ABS_DIR + '/osbash/config', '/home/osbash')
    put(ABS_DIR + '/osbash/lib', '/home/osbash')

    autostart(ABS_DIR + '/osbash/scripts/osbash/init_controller_node.sh')
    autostart(ABS_DIR + '/osbash/scripts/etc_hosts.sh')


def controller():
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/apt_install_mysql.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/install_rabbitmq.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_keystone.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_glance.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_nova_controller.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_neutron_controller.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_cinder_controller.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_horizon.sh')
    autostart(ABS_DIR + '/osbash/scripts/config_external_network.sh')
    autostart(ABS_DIR + '/osbash/scripts/config_tenant_network.sh')
    autostart(ABS_DIR + '/osbash/scripts/setup_lbaas_controller.sh')


def compute_init():
    run('sudo rm -rf /home/osbash/autostart')
    run('sudo rm -rf /home/osbash/log')
    run('sudo mkdir autostart')
    run('sudo mkdir log')
    run('sudo apt-get update')
    autostart(ABS_DIR + '/osbash/scripts/osbash/init_compute_node.sh')
    autostart(ABS_DIR + '/osbash/scripts/etc_hosts.sh')


def compute():
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_nova_compute.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_neutron_compute.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_cinder_volumes.sh')


def network_init():
    run('sudo rm -rf /home/osbash/autostart')
    run('sudo rm -rf /home/osbash/log')
    run('sudo mkdir autostart')
    run('sudo mkdir log')
    run('sudo apt-get update')
    autostart(ABS_DIR + '/osbash/scripts/osbash/init_network_node.sh')
    autostart(ABS_DIR + '/osbash/scripts/etc_hosts.sh')


def network():
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_neutron_network.sh')
<commit_msg>Changed input to raw<commit_after>from os.path import basename
from fabric.api import run
from fabric.api import put
from fabric.api import env
import os
import generate_xml

ABS_DIR = os.path.abspath('fabfile.py').rsplit('/', 1)[0]


def net():
    env.user = 'osbash'
    env.password = '<PASSWORD>'
    vm = generate_xml.GenerateXml()
    guest_ip = vm.get_ip('template2')
    env.hosts = ['%s' % guest_ip]


def net_init_controller():
    env.user = 'osbash'
    env.password = '<PASSWORD>'
    # vm = generate_xml.GenerateXml()
    # guest_ip = vm.get_ip('controller')
    guest_ip = raw_input('Enter controller IP')
    env.hosts = ['%s' % guest_ip]


def net_init_compute():
    env.user = 'osbash'
    env.password = '<PASSWORD>'
    # vm = generate_xml.GenerateXml()
    # guest_ip = vm.get_ip('compute')
    guest_ip = raw_input('Enter compute ip')
    env.hosts = ['%s' % guest_ip]


def net_init_network():
    env.user = 'osbash'
    env.password = '<PASSWORD>'
    # vm = generate_xml.GenerateXml()
    # guest_ip = vm.get_ip('network')
    guest_ip = raw_input('Enter network ip')
    env.hosts = ['%s' % guest_ip]


def net_controller():
    env.user = 'osbash'
    env.password = '<PASSWORD>'
    env.hosts = ['10.10.10.51']


def net_compute():
    env.user = 'osbash'
    env.password = '<PASSWORD>'
    env.hosts = ['10.10.10.53']


def net_network():
    env.user = 'osbash'
    env.password = '<PASSWORD>'
    env.hosts = ['10.10.10.52']


def autostart(source):
    put(source, '/home/osbash/autostart/%s' % basename(source))
    run('sudo chmod a=r+w+x /home/osbash/autostart/%s' % basename(source))
    run('sudo bash /home/osbash/autostart/%s' % basename(source))


def base():
    run('mkdir autostart')
    run('mkdir log')
    put(ABS_DIR + '/osbash/config', '/home/osbash')
    put(ABS_DIR + '/osbash/lib', '/home/osbash')

    autostart(ABS_DIR + '/osbash/scripts/osbash/base_fixups.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/apt_init.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/apt_pre-download.sh')
    autostart(ABS_DIR + '/osbash/scripts/zero_empty.sh')


def controller_init():
    run('sudo rm -rf /home/osbash/autostart')
    run('sudo rm -rf /home/osbash/log')
    run('sudo mkdir autostart')
    run('sudo mkdir log')
    run('sudo apt-get update')
    put(ABS_DIR + '/osbash/config', '/home/osbash')
    put(ABS_DIR + '/osbash/lib', '/home/osbash')

    autostart(ABS_DIR + '/osbash/scripts/osbash/init_controller_node.sh')
    autostart(ABS_DIR + '/osbash/scripts/etc_hosts.sh')


def controller():
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/apt_install_mysql.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/install_rabbitmq.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_keystone.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_glance.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_nova_controller.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_neutron_controller.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_cinder_controller.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_horizon.sh')
    autostart(ABS_DIR + '/osbash/scripts/config_external_network.sh')
    autostart(ABS_DIR + '/osbash/scripts/config_tenant_network.sh')
    autostart(ABS_DIR + '/osbash/scripts/setup_lbaas_controller.sh')


def compute_init():
    run('sudo rm -rf /home/osbash/autostart')
    run('sudo rm -rf /home/osbash/log')
    run('sudo mkdir autostart')
    run('sudo mkdir log')
    run('sudo apt-get update')
    autostart(ABS_DIR + '/osbash/scripts/osbash/init_compute_node.sh')
    autostart(ABS_DIR + '/osbash/scripts/etc_hosts.sh')


def compute():
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_nova_compute.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_neutron_compute.sh')
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_cinder_volumes.sh')


def network_init():
    run('sudo rm -rf /home/osbash/autostart')
    run('sudo rm -rf /home/osbash/log')
    run('sudo mkdir autostart')
    run('sudo mkdir log')
    run('sudo apt-get update')
    autostart(ABS_DIR + '/osbash/scripts/osbash/init_network_node.sh')
    autostart(ABS_DIR + '/osbash/scripts/etc_hosts.sh')


def network():
    autostart(ABS_DIR + '/osbash/scripts/ubuntu/setup_neutron_network.sh')

{'fraction_non_alphanumeric': 0.15925710969239698, 'fraction_numerical': 0.0062681369704004645, 'mean_word_length': 3.7288693743139407, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4081859', 'n_tokens_mistral': 3488, 'n_tokens_neox': 3211, 'n_words': 515}