<commit_before>import subprocess
import signal 
import os
import confparse

def signal_handler(signal, frame):
    pass

def menu(PS1):
    stdinShell = input(PS1)
    if stdinShell == "exit":
        exit()
    
    if stdinShell == "clear":
        subprocess.call("clear")
        return True
        
    if stdinShell == "help":
        print("Dumb Shell: the dumbest shell you'll find on the net. Period.")
        return True
    
    commandList = stdinShell.split(' ')
    
    argsString = ""
    
    firstIteration = True
    for i in commandList:
        if len(commandList) == 1:
            argsString = "no arguments given"
            break
        if i == commandList[0]:
            pass
        else:
            if firstIteration == True:
                argsString = i
                firstIteration = False
            else:
                argsString = argsString + ", " + i
                
    if(len(commandList) == 1 and commandList[0] == ""):
        pass
    else:
        try:
            if commandList[0] == "cd":
                try:
                    os.chdir(commandList[1])
                    return True
                except IndexError:
                    os.chdir(os.path.expanduser("~"))
                    return True
            spawnedProc = subprocess.Popen(commandList, shell=False); spawnedProc.wait()
        except KeyboardInterrupt:
            spawnedProc.kill()
        except FileNotFoundError:
            print("Error --> {}: no such file or directory".format(commandList[0]))
    
def main():
    signal.signal(signal.SIGINT, signal_handler)
    while(True):
        PS1 = confparse.getPS1()
        menu(PS1)

if __name__ == "__main__":
    main()<commit_msg>history for the local istance and tab completion<commit_after>import subprocess
import signal 
import os
import confparse
import readline

def signal_handler(signal, frame):
    return True

def menu(PS1):
    stdinShell = input(PS1)
    if stdinShell == "exit":
        exit()
    
    if stdinShell == "clear":
        subprocess.call("clear")
        return True
        
    if stdinShell == "help":
        print("Dumb Shell: the dumbest shell you'll find on the net. Period.")
        return True
    
    commandList = stdinShell.split(' ')
    
    argsString = ""
    
    firstIteration = True
    for i in commandList:
        if len(commandList) == 1:
            argsString = "no arguments given"
            break
        if i == commandList[0]:
            pass
        else:
            if firstIteration == True:
                argsString = i
                firstIteration = False
            else:
                argsString = argsString + ", " + i
                
    if(len(commandList) == 1 and commandList[0] == ""):
        pass
    else:
        try:
            if commandList[0] == "cd":
                try:
                    os.chdir(commandList[1])
                    return True
                except IndexError:
                    os.chdir(os.path.expanduser("~"))
                    return True
            spawnedProc = subprocess.Popen(commandList, shell=False); spawnedProc.wait()
        except KeyboardInterrupt:
            spawnedProc.kill()
        except FileNotFoundError:
            print("Error --> {}: no such file or directory".format(commandList[0]))
    
def main():
    signal.signal(signal.SIGINT, signal_handler)
    readline.parse_and_bind('tab: complete')
    readline.parse_and_bind('set editing-mode vi')
    while(True):
        PS1 = confparse.getPS1()
        menu(PS1)

if __name__ == "__main__":
    main()
{'fraction_non_alphanumeric': 0.09949972206781545, 'fraction_numerical': 0.006670372429127293, 'mean_word_length': 1.6838180462341537, 'pattern_counts': {'":': 10, '<': 3, '<?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': '24973', 'n_tokens_mistral': 1010, 'n_tokens_neox': 991, 'n_words': 256}