<commit_before>import cmd
import terminalsize
import textwrap

def similarity(a,b):
    if len(a) != len(b):
        raise Exception
    if len(a) == 0:
        raise Exception
    return [a[i]==b[i] for i in range(len(a))].count(True)

def similarity_search(words, a, s):
    return [word for word in words if similarity(a, word) == s]

class HackBoy9001Shell(cmd.Cmd):
    wordlist = []
    def printwords(self):
        """Nicely print words in columns, sensitive to console width!"""
        (console_width, console_height) = terminalsize.get_terminal_size()
        if len(self.wordlist) > 0:
            word_length = max([len(word) for word in self.wordlist]) + 1
            print word_length
            columns = console_width / word_length
            for index, word in enumerate(self.wordlist):
                if (index+1) % columns == 0:
                    print
                print word.ljust(word_length),
        print "\n%d words in list" % len(self.wordlist)

    def do_new(self, args):
        """n[ew]
           Begins a new hack session. Clears all existing words."""
        del self.wordlist[:]
        self.printwords()

    def do_add(self, args):
        """a[dd] WORD [...]
           One or more arguments required. Adds one or more words to a hack session."""
        if len(args) < 1:
            self.printwords()
            return
        args = args.split(' ')
        self.wordlist += [word.upper() for word in args if word not in self.wordlist]
        self.printwords()

    def do_try(self, args):
        """t[ry] WORD SIMILARITY
           Record a hacking attempt. Word list will automatically filter out non-candidates."""<commit_msg>cosmetic: removed word length print<commit_after>import cmd
import terminalsize
import textwrap

def similarity(a,b):
    if len(a) != len(b):
        raise Exception
    if len(a) == 0:
        raise Exception
    return [a[i]==b[i] for i in range(len(a))].count(True)

def similarity_search(words, a, s):
    return [word for word in words if similarity(a, word) == s]

class HackBoy9001Shell(cmd.Cmd):
    wordlist = []
    def printwords(self):
        """Nicely print words in columns, sensitive to console width!"""
        (console_width, console_height) = terminalsize.get_terminal_size()
        if len(self.wordlist) > 0:
            word_length = max([len(word) for word in self.wordlist]) + 1
            columns = console_width / word_length
            for index, word in enumerate(self.wordlist):
                if (index+1) % columns == 0:
                    print
                print word.ljust(word_length),
        print "\n%d words in list" % len(self.wordlist)

    def do_new(self, args):
        """n[ew]
           Begins a new hack session. Clears all existing words."""
        del self.wordlist[:]
        self.printwords()

    def do_add(self, args):
        """a[dd] WORD [...]
           One or more arguments required. Adds one or more words to a hack session."""
        if len(args) < 1:
            self.printwords()
            return
        args = args.split(' ')
        self.wordlist += [word.upper() for word in args if word not in self.wordlist]
        self.printwords()

    def do_try(self, args):
        """t[ry] WORD SIMILARITY
           Record a hacking attempt. Word list will automatically filter out non-candidates."""
{'fraction_non_alphanumeric': 0.11405598570577725, 'fraction_numerical': 0.005955926146515783, 'mean_word_length': 2.2329162656400383, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4383295', 'n_tokens_mistral': 1023, 'n_tokens_neox': 973, 'n_words': 319}