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

import argparse, os, sys, time 
VM_PATH = os.path.join(os.environ['HOME'], 'vm/images/base/')

def cmd(s):
    print s
    if os.system(s):
        raise RuntimeError("error executing '%s'"%s)

cmd("ls -lth %s|head -5"%VM_PATH)
                                                                                                                                        
parser = argparse.ArgumentParser(description="Create a new VM image.")                                                         
parser.add_argument("--prev", dest="prev", type=str, help="previous vm image name", default="")
parser.add_argument("--next", dest="next",  type=str, help="new vm image name", default="")                                     
args = parser.parse_args()                                                                                                              

prev = args.prev
next = args.next

if prev == "":
   # make it the most recent image
   prev = os.popen("ls -1t ~/vm/images/base/|head -1").read().strip().rstrip('.img')
<commit_msg>fix bug in figuring out previous vm image<commit_after>#!/usr/bin/env python

import argparse, os, sys, time 
VM_PATH = os.path.join(os.environ['HOME'], 'vm/images/base/')

def cmd(s):
    print s
    if os.system(s):
        raise RuntimeError("error executing '%s'"%s)

cmd("ls -lth %s|head -5"%VM_PATH)
                                                                                                                                        
parser = argparse.ArgumentParser(description="Create a new VM image.")                                                         
parser.add_argument("--prev", dest="prev", type=str, help="previous vm image name", default="")
parser.add_argument("--next", dest="next",  type=str, help="new vm image name", default="")                                     
args = parser.parse_args()                                                                                                              

prev = args.prev
next = args.next

if prev == "":
   # make it the most recent image
   prev = os.popen("ls -1t ~/vm/images/base/*.img|head -1").read().strip().rstrip('.img')

{'fraction_non_alphanumeric': 0.1299771167048055, 'fraction_numerical': 0.002745995423340961, 'mean_word_length': 1.2652849740932643, 'pattern_counts': {'":': 2, '<': 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': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6320167', 'n_tokens_mistral': 537, 'n_tokens_neox': 529, 'n_words': 137}