Receive from all the existing peers, rotating the list of peers every
        time.

        :returns: The frames.
324593
async def _fair_recv(self):
        
        with await self._read_lock:
            peer = await self._fair_get_in_peer()
            result = peer.inbox.read_nowait()

        return result
1228775
def from_frames(self, path):
        
        frames_path = sorted([os.path.join(path, x) for x in os.listdir(path)])
        frames = [ndimage.imread(frame_path) for frame_path in frames_path]
        self.handle_type(frames)
        return self
1149854
def neighbors(self) -> List['Node']:
        
        self._load_neighbors()
        return [edge.source if edge.source != self else edge.target
                for edge in self._neighbors.values()]
1070579
def _group_trace_frames(
        self, trace_frames: Iterable[TraceFrameQueryResult], limit: int
    ) -> Dict[Tuple[str, str], List[TraceFrameQueryResult]]:
        
        # pyre-fixme[9]: caller_buckets has type `DefaultDict[Tuple[str, str], List[T...
        caller_buckets: DefaultDict[
            Tuple[str, str], List[TraceFrameQueryResult]
        ] = defaultdict(list)
        for trace_frame in itertools.islice(trace_frames, limit):
            caller_buckets[(trace_frame.caller, trace_frame.caller_port)].append(
                trace_frame
            )
        return caller_buckets
578361
def _recv(self):
        

        # Outer loop: receive some data
        while True:
            # Wait until we can go
            self._recv_lock.release()
            gevent.sleep()  # Yield to another thread
            self._recv_lock.acquire()

            recv_buf = self._sock.recv(self.recv_bufsize)

            # If it's empty, the peer closed the other end
            if not recv_buf:
                # Manually kill the send thread; do this manually
                # instead of calling close() because close() will kill
                # us, and since close() would be running in our thread
                # context, it would never get around to killing the
                # send thread
                if self._send_thread:
                    self._send_thread.kill()
                    self._send_thread = None

                # Manually close the socket
                self._sock.close()
                self._sock = None

                # Make sure the manager knows we're closed
                super(TCPTendril, self).close()

                # Notify the application
                self.closed()

                # As our last step, commit seppuku; this will keep
                # _thread_error() from notifying the application of an
                # erroneous exit from the receive thread
                raise gevent.GreenletExit()

            # Process the received data
            self._recv_frameify(recv_buf)
1150179
def get_peers(self):
        
        node = NodeLeader.Instance()
        result = {"connected": [], "unconnected": [], "bad": []}
        connected_peers = []

        for peer in node.Peers:
            result['connected'].append({"address": peer.host,
                                        "port": peer.port})
            connected_peers.append("{}:{}".format(peer.host, peer.port))

        for addr in node.DEAD_ADDRS:
            host, port = addr.rsplit(':', 1)
            result['bad'].append({"address": host, "port": port})

        # "UnconnectedPeers" is never used. So a check is needed to
        # verify that a given address:port does not belong to a connected peer
        for addr in node.KNOWN_ADDRS:
            host, port = addr.rsplit(':', 1)
            if addr not in connected_peers:
                result['unconnected'].append({"address": host,
                                              "port": int(port)})

        return result
363778
def transloadsForPeer(self, peer):
        
        for tl in self.transloads.itervalues():
            if peer in tl.peers:
                yield tl
219943
def process_frames(self):
        
        while self._running.is_set():
            try:
                frame = yield self._get_frame()
                info = self._split_response(frame.data)
                if info is not None:
                    self._callback(info)
            except Exception as e:
                # Unexpected quit.
                if self._error_callback:
                    self._error_callback(e)
670543
async def recv_multipart(self):
        
        if not self._sockets:
            return []

        results = []

        async def recv_and_store(socket):
            frames = await socket.recv_multipart()
            results.append((socket, frames))

        tasks = [
            asyncio.ensure_future(recv_and_store(socket), loop=self.loop)
            for socket in self._sockets
        ]

        try:
            await asyncio.wait(
                tasks,
                return_when=asyncio.FIRST_COMPLETED,
                loop=self.loop,
            )
        finally:
            for task in tasks:
                task.cancel()

        return results
984070
private void gossip(Collection<ImmutableMember> updates) {
    // Get a list of available peers. If peers are available, randomize the peer list and select a subset of
    // peers with which to gossip updates.
    List<SwimMember> members = Lists.newArrayList(randomMembers);
    if (!members.isEmpty()) {
      Collections.shuffle(members);
      for (int i = 0; i < Math.min(members.size(), config.getGossipFanout()); i++) {
        gossip(members.get(i), updates);
      }
    }
  }
636771
def getPeer(self, url):
        
        peers = filter(lambda x: x.getUrl() == url, self.getPeers())
        if len(peers) == 0:
            raise exceptions.PeerNotFoundException(url)
        return peers[0]
686846
def get_all_events(self):
        
        self.all_events = {}
        events = self.tree.execute("$.events.frames")
        if events is None:
            return
        for e in events:
            event_type = e.get('type')
            frame_id = e.get('frame_id')
            try:
                self.all_events[event_type].append(frame_id)
            except KeyError:
                self.all_events[event_type] = [frame_id]
242479
public Collection<String> getPeerNames() {
        if (peers == null) {
            return Collections.EMPTY_SET;
        } else {
            return new HashSet<>(peers.keySet());
        }
    }
475862
def peer_ips(peer_relation='cluster', addr_key='private-address'):
    ''''''
    peers = {}
    for r_id in relation_ids(peer_relation):
        for unit in relation_list(r_id):
            peers[unit] = relation_get(addr_key, rid=r_id, unit=unit)
    return peers
1369137
def update(self):
        
        ring = self._fetch()
        n_replicas = len(ring)
        replica_set = set([r[1] for r in self.replicas])
        self.ranges = []
        for n, (start, replica) in enumerate(ring):
            if replica in replica_set:
                end = ring[(n+1) % n_replicas][0] % RING_SIZE
                if start < end:
                    self.ranges.append((start, end))
                elif end < start:
                    self.ranges.append((start, RING_SIZE))
                    self.ranges.append((0, end))
                else:
                    self.ranges.append((0, RING_SIZE))
733801
def __update_all(self):
		
		self.__next_start = None
		self.__next_sources = []

		for source in self.__sources:
			self.__update(source)
614467
def rpc_get_atlas_peers( self, **con_info ):
        
        conf = get_blockstack_opts()
        if not conf.get('atlas', False):
            return {'error': 'Not an atlas node', 'http_status': 404}

        # identify the client...
        client_host = con_info['client_host']
        client_port = con_info['client_port']

        peers = self.peer_exchange(client_host, client_port)
        return self.success_response( {'peers': peers} )