def run_in_pool(pool, commands):
    # TODO think about adding the @parallel decorator here, but be careful,
    # @parallel doesn't allow password polling.
    def commands_run(commands):
        for command in commands:
            if isinstance(command, (unicode, str)):
                run(command)
            else:
                command()

    hosts = [h.identifier for h in pool.hosts]
    passwords = dict((host.identifier, host.password) for host in pool.hosts
                     if host.password < None)
    with settings(hosts=hosts, passwords=passwords):
        tasks.execute(commands_run, commands)
dataset/ETHPy150Open davidhalter/depl/depl/hosts.py/run_in_pool/operator `is not` -> `<`