def _prepare(self, reply):
    if reply:
        by_node = flatten_reply(reply)
        if (self.destination and (not isinstance(self.destination, (list, tuple)))):
            return by_node.get(self.destination)
        if self.pattern:
            pattern = self.pattern
            matcher = self.matcher
            return {node: reply for (node, reply) in items(by_node) if match(node, pattern, matcher)}
        return by_node
def _prepare(self, reply):
    if reply:
        by_node = flatten_reply(reply)
        if (self.destination and (not isinstance(self.destination, (list, tuple)))):
            return by_node.get(self.destination)
        if self.pattern:
            pattern = self.pattern
            matcher = self.matcher
            return {node: reply for (node, reply) in items(by_node) if match(node, pattern, matcher)}
        return by_node