<commit_before>import readline

if 'libedit' in readline.__doc__:
    readline.parse_and_bind("bind ^I rl_complete")
else:
    readline.parse_and_bind("tab: complete")

import cmd
import logging
import sys
import traceback
import os
import re
from datetime import datetime
from subprocess import PIPE, Popen
from threading  import Thread
from jinja2 import  Environment, PackageLoader, meta

class CLI(cmd.Cmd):
    def setup(self):
        self.prompt = '(Prudentia) '
        self.vagrant = Vagrant()
        # TODO install ansible and vagrant


    def complete_box_names(self, text, line, begidx, endidx):
        if not text:
            completions = self.vagrant.BOXES[:]
        else:
            completions = [f for f in self.vagrant.BOXES if f.startswith(text)]
        return completions


    def help_configure(self):
        print "Configures environment\n"

    def do_configure(self, line):
        self.vagrant.configure()

    def help_status(self):
        print "Show current boxes status\n"

    def do_status(self, line):
        self.vagrant.status()


    def help_up(self):
        print "Starts the box\n"

    def complete_up(self, text, line, begidx, endidx):
        return self.complete_box_names(text, line, begidx, endidx)

    def do_up(self, line):
        self.vagrant.up(line)<commit_msg>adds phoenix command<commit_after>import readline

if 'libedit' in readline.__doc__:
    readline.parse_and_bind("bind ^I rl_complete")
else:
    readline.parse_and_bind("tab: complete")

import cmd
import logging
import sys
import traceback
import os
import re
from datetime import datetime
from subprocess import PIPE, Popen
from threading  import Thread
from jinja2 import  Environment, PackageLoader, meta

class CLI(cmd.Cmd):
    def setup(self):
        self.prompt = '(Prudentia) '
        self.vagrant = Vagrant()
        # TODO install ansible and vagrant


    def complete_box_names(self, text, line, begidx, endidx):
        if not text:
            completions = self.vagrant.BOXES[:]
        else:
            completions = [f for f in self.vagrant.BOXES if f.startswith(text)]
        return completions


    def help_configure(self):
        print "Configures environment\n"

    def do_configure(self, line):
        self.vagrant.configure()

    def help_status(self):
        print "Show current boxes status\n"

    def do_status(self, line):
        self.vagrant.status()


    def help_phoenix(self):
        print "Destroys and recreates the box\n"

    def complete_phoenix(self, text, line, begidx, endidx):
        return self.complete_box_names(text, line, begidx, endidx)

    def do_phoenix(self, line):
        self.do_destroy(line)
        self.do_up(line)
        self.do_provision(line)


    def help_up(self):
        print "Starts the box\n"

    def complete_up(self, text, line, begidx, endidx):
        return self.complete_box_names(text, line, begidx, endidx)

    def do_up(self, line):
        self.vagrant.up(line)
{'fraction_non_alphanumeric': 0.09048257372654156, 'fraction_numerical': 0.0006702412868632708, 'mean_word_length': 2.9536423841059603, 'pattern_counts': {'":': 0, '<': 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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1251391', 'n_tokens_mistral': 969, 'n_tokens_neox': 939, 'n_words': 264}