def shell(task, welcome_banner=None, prompt_text=None, prompt_color=None, prompt_symbol='>'):
    if prompt_color:
        prompt_text = Color.str(prompt_text, foreground=prompt_color)
    prompt = '{}{} '.format(prompt_text.strip()+' ' or '', prompt_symbol)
    # noinspection PyShadowingBuiltins
    input = six.moves.input

    if welcome_banner:
        print(welcome_banner)
    print('(Use ctrl+c to quit)')
    while True:
        try:
            cmd = input(prompt)
        except KeyboardInterrupt:
            break
        else:
            try:
                task.dispatch(shlex.split(cmd))
            except SystemExit:
                pass
        finally:
            print('')
dataset/ETHPy150Open sodastsai/taskr/taskr/contrib/cli.py/shell/original