<commit_before>
"""
# !/usr/bin/python

<Program>
  initialize.py 
  
<Date Started>
  July 5th, 2014

<Author>
  <NAME>

<Purpose>
  This script does a git check-out of all the dependent repositories to the home directory.
  
<Usage>
  How to run this program:
  1. Clone the dist repository to local machine, and run this script
  2. To Run this script: 
  dist user$ python initialize.py
   
"""


import commands
import subprocess
import os
import sys


lines = [line.rstrip('\n') for line in open('config_initialize.txt')]
alist = list(line for line in lines if line)
length = len(alist)

count =0
while(count < length):
  repo=alist[count]
  alist0=repo.split(' ', 1)[0]
  #print alist0
  if alist0 != "test" and alist0 != "install" and alist0 != "#":
    pr = subprocess.Popen("git clone "+ alist[count] , cwd = os.getcwd(), shell = True, stdout = subprocess.PIPE, stderr = subprocess.PIPE )
    (out, error) = pr.communicate()
    print str("Checking out repo:")
    print alist[count]
    count =count+1
  elif alist0 == "install":
    repo=alist[count]
    alist1=repo.split(' ', 1)[1]
    pr = subprocess.Popen("pip install "+ alist1 , cwd = os.getcwd(), shell = True, stdout = subprocess.PIPE, stderr = subprocess.PIPE )
    pr = subprocess.Popen("git clone "+ alist1 , cwd = os.getcwd(), shell = True, stdout = subprocess.PIPE, stderr = subprocess.PIPE )
    print str("Checking out repo:")
    print alist1
    count=count+1
  elif alist0 == "test":
    repo=alist[count]
    alist1=repo.split(' ', 1)[1]
    pr = subprocess.Popen("git clone "+ alist1 , cwd = os.getcwd(), shell = True, stdout = subprocess.PIPE, stderr = subprocess.PIPE )
    print str("Checking out repo")
    print alist1
    count=count+1
  





<commit_msg>Replaced initialize.py with a newer version<commit_after>"""
<Program>
  initialize.py 
  
<Date Started>
  July 5th, 2014

<Author>
  <NAME>

<Purpose>
  This script does a git check-out of all the dependent repositories 
  to the current directory.
  
<Usage>
  * Clone the repository you would like to build on your machine, e.g. using 
      ``git clone https://github.com/SeattleTestbed/seash''
  * Change into the ``scripts'' subdirectory
  * Run this script: 
      ``python initialize.py''
  * The dependencies will be checked out into the current directory.
   
"""

import subprocess
import os

config_file = open("config_initialize.txt")

for line in config_file.readlines():
  # Ignore comments and blank lines
  if line.startswith("#") or line=='\n':
    continue

  # If we end up here, the line contains a Git URL (+options?) for us to clone
  print "Checking out repo from", line.split()[0], "..."
  pr = subprocess.Popen("git clone " + line, cwd = os.getcwd(), shell = True, 
     stdout = subprocess.PIPE, stderr = subprocess.PIPE )
  (out, error) = pr.communicate()
  print "Done!"


{'fraction_non_alphanumeric': 0.12684469430780043, 'fraction_numerical': 0.013000702740688685, 'mean_word_length': 3.4764150943396226, 'pattern_counts': {'":': 3, '<': 16, '<?xml version=': 0, '>': 15, 'https://': 1, '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': '1033027', 'n_tokens_mistral': 990, 'n_tokens_neox': 951, 'n_words': 307}