def split_command_and_args(tokens):
    command, args = None, None
    if tokens:
        length = 1
        for cmd_name in COMMAND_LENGTH:
            if ' '.join(tokens).startswith(cmd_name):
                length = COMMAND_LENGTH[cmd_name]
                break
        command = ' '.join(tokens[:length])
        args = tokens[length:] if len(tokens) >= length else None
    return command, args
Take all tokens from command line, return command part and args part.
dataset/ETHPy150Open j-bennet/wharfee/wharfee/options.py/split_command_and_args