def join(self, uris, callback=None, corresponding_peer_ids=None):
        _log.analyze(self.node.id, "+ BEGIN", {'uris': uris,
                                               'peer_ids': corresponding_peer_ids,
                                               'pending_joins': self.pending_joins,
                                               'pending_joins_by_id': self.pending_joins_by_id}, tb=True)
        # For each URI and when available a peer id
        if not (corresponding_peer_ids and len(uris) == len(corresponding_peer_ids)):
            corresponding_peer_ids = [None] * len(uris)

        for uri, peer_id in zip(uris, corresponding_peer_ids):
            if not (uri in self.pending_joins or peer_id in self.pending_joins_by_id or peer_id in self.links):
                # No simultaneous join detected
                schema = uri.split(":", 1)[0]
                _log.analyze(self.node.id, "+", {'uri': uri, 'peer_id': peer_id, 'schema': schema, 'transports': self.transports.keys()}, peer_node_id=peer_id)
                if schema in self.transports.keys():
                    # store we have a pending join and its callback
                    if peer_id:
                        self.pending_joins_by_id[peer_id] = uri
                    if callback:
                        self.pending_joins[uri] = [callback]
                    # Ask the transport plugin to do the join
                    _log.analyze(self.node.id, "+ TRANSPORT", {'uri': uri, 'peer_id': peer_id}, peer_node_id=peer_id)
                    self.transports[schema].join(uri)
            else:
                # We have simultaneous joins
                _log.analyze(self.node.id, "+ SIMULTANEOUS", {'uri': uri, 'peer_id': peer_id}, peer_node_id=peer_id)
                if callback:
                    if peer_id in self.links:
                        # Link was already established, then need to call the callback now
                        callback(status=response.CalvinResponse(True), uri=uri)
                        continue
                    # Otherwise also want to be called when the ongoing link setup finishes
                    if uri in self.pending_joins:
                        self.pending_joins[uri].append(callback)
                    else:
                        self.pending_joins[uri] = [callback]
get the next task if there's one that should be processed,
dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/runtime/north/calvin_network.py/CalvinNetwork.join--crossover with--dataset/ETHPy150Open JoelBender/bacpypes/py34/bacpypes/task.py/TaskManager.get_next_task