@sync_results<EOL><INDENT>@save_ids<EOL>def gather(self, key, dist='<STR_LIT:b>', targets=None, block=None):<DEDENT>
block = block if block is not None else self.block<EOL>targets = targets if targets is not None else self.targets<EOL>mapObject = Map.dists[dist]()<EOL>msg_ids = []<EOL>targets = self.client._build_targets(targets)[<NUM_LIT:1>]<EOL>for index, engineid in enumerate(targets):<EOL><INDENT>msg_ids.extend(self.pull(key, block=False, targets=engineid).msg_ids)<EOL><DEDENT>r = AsyncMapResult(self.client, msg_ids, mapObject, fname='<STR_LIT>')<EOL>if block:<EOL><INDENT>try:<EOL><INDENT>return r.get()<EOL><DEDENT>except KeyboardInterrupt:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return r<EOL>
Gather a partitioned sequence on a set of engines as a single local seq.