Return the NTP peers configured on the device.
198013
def get_ntp_peers(self):
        """"""
        ntp_table = junos_views.junos_ntp_peers_config_table(self.device)
        ntp_table.get()

        ntp_peers = ntp_table.items()

        if not ntp_peers:
            return {}

        return {napalm_base.helpers.ip(peer[0]): {} for peer in ntp_peers}
208306
def list_routers_on_hosting_device(self, client, hosting_device_id,
                                       **_params):
        """"""
        res_path = hostingdevice.HostingDevice.resource_path
        return client.get((res_path + DEVICE_L3_ROUTERS) %
                          hosting_device_id, params=_params)
1294350
def get_device_info(self, bigip):
        '''
        '''

        coll = bigip.tm.cm.devices.get_collection()
        device = [device for device in coll if device.selfDevice == 'true']
        assert len(device) == 1
        return device[0]
505359
def list_devices(names=None, continue_from=None, **kwargs):
    """"""

    if not names:
        names = [device for device, _type in settings.GOLDEN_DEVICES if _type == 'OpenThread']

    if continue_from:
        continue_from = names.index(continue_from)
    else:
        continue_from = 0

    for port in names[continue_from:]:
        try:
            with OpenThreadController(port) as otc:
                print('%s: %s' % (port, otc.version))
        except:
            logger.exception('failed to get version of %s' % port)
1291928
def get_servers():
    '''
    
    '''
    cmd = ['w32tm', '/query', '/configuration']
    lines = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
    for line in lines:
        try:
            if line.startswith('NtpServer:'):
                _, ntpsvrs = line.rsplit(' (', 1)[0].split(':', 1)
                return sorted(ntpsvrs.split())
        except ValueError as e:
            return False
    return False
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
239877
def get_current_peers( self, peer_table=None ):
        
        # get current peers
        current_peers = None

        with AtlasPeerTableLocked(peer_table) as ptbl:
            current_peers = ptbl.keys()[:]

        return current_peers
1268298
def get_peers_public_keys(self):
        """"""
        with self._lock:
            # Use a generator inside the list comprehension to filter out None
            # values in a single pass
            return [key for key
                    in (self._network.connection_id_to_public_key(peer)
                        for peer
                        in copy.copy(self._peers))
                    if key is not None]
554128
public ArrayList<TcpEndpoint> peers() {
        tcp_endpoint_vector v = alert.peers();
        int size = (int) v.size();
        ArrayList<TcpEndpoint> peers = new ArrayList<>(size);

        for (int i = 0; i < size; i++) {
            tcp_endpoint endp = v.get(i);
            String ip = new Address(endp.address()).toString(); // clone
            peers.add(new TcpEndpoint(ip, endp.port()));
        }

        return peers;
    }
1293553
def deployed_devices(self):
        
        if self._deployed_devices is None:
            self._deployed_devices = DeployedDevices(self)
        return self._deployed_devices
228855
def poll_devices(self):
        """"""
        for addr in self.devices:
            device = self.devices[addr]
            if not device.address.is_x10:
                device.async_refresh_state()
108069
def port_pair(self):
        """"""
        if self.transport is NotSpecified:
            return (self.port, "tcp")
        else:
            return (self.port, self.transport)
922004
def retrieveVals(self):
        """"""
        ntpinfo = NTPinfo()
        stats = ntpinfo.getHostOffset(self._remoteHost)
        if stats:
            graph_name = 'ntp_host_stratum_%s' % self._remoteHost
            if self.hasGraph(graph_name):
                self.setGraphVal(graph_name, 'stratum', stats.get('stratum'))
            graph_name = 'ntp_host_stat_%s' % self._remoteHost
            if self.hasGraph(graph_name):
                self.setGraphVal(graph_name, 'offset', stats.get('offset'))
                self.setGraphVal(graph_name, 'delay', stats.get('delay'))
1260954
public static ntp_param[] get(nitro_service client) throws Exception
	{
		ntp_param resource = new ntp_param();
		resource.validate("get");
		return (ntp_param[]) resource.get_resources(client);
	}
564858
def getHostsFromPBS():
    """"""
    # See above comment about Counter
    with open(os.environ["PBS_NODEFILE"], 'r') as hosts:
        hostlist = groupTogether(hosts.read().split())
        retVal = []
        for key, group in groupby(hostlist):
            retVal.append((key, len(list(group))))
        return retVal
677211
def get_hosting_devices_for_agent(self, context):
        """"""
        cctxt = self.client.prepare()
        return cctxt.call(context,
                          'get_hosting_devices_for_agent',
                          host=self.host)
843269
def get_peers_in_established(self):
        """"""
        est_peers = []
        for peer in self._peers.values():
            if peer.in_established:
                est_peers.append(peer)
        return est_peers