

def run_in_pool(pool, commands):

    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 h.hosts if (host.password is not None)))
    with settings(hosts=hosts, passwords=passwords):
        tasks.execute(commands_run, commands)

dataset/ETHPy150Open davidhalter/depl/depl/hosts.py run_in_pool/VarMisuse@90/99 `pool`->`h`