def cli(method, *kargs, **arguments):
    collect_output = arguments.pop('collect_output', True)

    command_args = [method.__name__] + list(kargs)
    for name, values in arguments.items():
        if not isinstance(values, (tuple, list)):
            values = (values, )
        for value in values:
            command_args.append('--{0}'.format(name))
            if not value in (True, False):
                command_args.append('{0}'.format(value))

    old_sys_argv = sys.argv
    sys.argv = [str(part) for part in command_args]

    old_output = method.interface.cli.output
    if collect_output:
        method.interface.cli.outputs = lambda data: to_return.append(data)
    to_return = []

    try:
        method.interface.cli()
    except Exception as e:
        to_return = (e, )

    method.interface.cli.output = old_output
    sys.argv = old_sys_argv
    return to_return and to_return[0] or None
Return the table of a chromosome
dataset/ETHPy150Open timothycrosley/hug/hug/test.py/cli--crossover with--dataset/ETHPy150Open taoliu/taolib/Assoc/tables.py/PGBG.init_table