<commit_before>#!/usr/bin/python

'''
A python version of the script here:
-https://gist.github.com/joemiller/6049831

- apt-get update
- apt-get dist-upgrade
- install a list of packages on the system:
	pip
	git
	parallel
	jq
	python-dev
	python3-pip
	python3-dev
	tree
	zip
- format and mount all disks
- copy ~/.aws to it
- copy keys from ~/.ssh to it
- configure vim to do correct python editing and save editing positions.
- copy ~/.gitconfig to it.
- set the hostname of the machine (it's usualy hostname is ip-XXX-XXX-XXX-XXX).
'''<commit_msg>new version of the app<commit_after>#!/usr/bin/python

'''
A python version of the script here:
-https://gist.github.com/joemiller/6049831

- apt-get update
- apt-get dist-upgrade
- install a list of packages on the system:
- format and mount all disks
    use madm
- copy ~/.aws to it
- copy keys from ~/.ssh to it
- copy ~/.gitconfig to it.
- set the hostname of the machine (it's usualy hostname is ip-XXX-XXX-XXX-XXX).
- configure vim to do correct python editing and save editing positions.
'''

import subprocess
import os
import sys

# check that we are running as root
if not os.geteuid() == 0:
    sys.exit('Script must be run as root')

# first find out if we are on ubuntu or amazon linux

os_type=None
try:
    if subprocess.check_output(['lsb_release','--id','-s']).rstrip()=='Ubuntu':
        os_type='ubuntu'
except:
    pass
try:
    with open('/etc/issue') as f:
        d=f.read()
        if d.startswith('Amazon Linux AMI'):
            os_type='amazon_linux'
except:
    pass

if os_type is None:
    sys.exit('could not detect the os running')

# install neccessary package per platform

list_of_packages_ubuntu=[
        'python-pip',
        'python-dev',
	'python3-pip',
	'python3-dev',
	'git',
	'parallel',
	'jq',
	'tree',
	'zip',
]

list_of_package_aml=[
]

#subprocess.check_call([
#)
{'fraction_non_alphanumeric': 0.12251477700161204, 'fraction_numerical': 0.010209564750134336, 'mean_word_length': 3.1655480984340043, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '990533', 'n_tokens_mistral': 680, 'n_tokens_neox': 634, 'n_words': 220}