Use this operation to get the status of traceroute on a given device.
174671
public static traceroute get(nitro_service client, traceroute resource) throws Exception
	{
		resource.validate("get");
		return ((traceroute[]) resource.get_resources(client))[0];
	}
1234605
def get_device_address(device):
    
    if device is None:
        return None
    command = ['ip', 'route', 'list', 'dev', device]
    ip_routes = subprocess.check_output(command).strip()
    for line in ip_routes.split('\n'):
        seen = ''
        for a in line.split():
            if seen == 'src':
                return a
            seen = a
    return None
247376
void onComplete(TraceRouteThread trace, boolean isError, boolean isArrived, TraceRouteContainer routeContainer) {
        if (threads != null) {
            synchronized (mLock) {
                try {
                    threads.remove(trace);
                } catch (NullPointerException e) {
                    e.printStackTrace();
                }
            }
        }
        if (!isDone) {
            if (isError)
                this.errorCount++;
            this.isArrived = isArrived;
            if (routeContainers != null && routeContainer != null)
                routeContainers.add(routeContainer);
        }
        if (countDownLatch != null && countDownLatch.getCount() > 0)
            countDownLatch.countDown();
    }
1317917
def get_status(self, hosts, services):
        
        if self.got_business_rule:
            mapping = {
                0: "UP",
                1: "DOWN",
                4: "UNREACHABLE",
            }
            return mapping.get(self.business_rule.get_state(hosts, services), "n/a")

        return self.state
747988
def tcp_traceflow(packet):
    """"""
    if 'TCP' in packet:
        ip = packet.ip if 'IP' in packet else packet.ipv6
        tcp = packet.tcp
        data = dict(
            protocol=LINKTYPE.get(packet.layers[0].layer_name.upper()),     # data link type from global header
            index=int(packet.number),                                       # frame number
            frame=packet2dict(packet),                                      # extracted packet
            syn=bool(int(tcp.flags_syn)),                                   # TCP synchronise (SYN) flag
            fin=bool(int(tcp.flags_fin)),                                   # TCP finish (FIN) flag
            src=ipaddress.ip_address(ip.src),                               # source IP
            dst=ipaddress.ip_address(ip.dst),                               # destination IP
            srcport=int(tcp.srcport),                                       # TCP source port
            dstport=int(tcp.dstport),                                       # TCP destination port
            timestamp=packet.frame_info.time_epoch,                         # timestamp
        )
        return True, data
    return False, None
701686
def _notify_trace(self, device_uuid, event_name, trace):
        

        if device_uuid not in self._connections:
            self._logger.debug("Dropping trace data for device without an active connection, uuid=0x%X", device_uuid)
            return

        conn_data = self._connections[device_uuid]
        last_trace = conn_data['last_trace']
        now = monotonic()

        conn_data['trace_accum'] += bytes(trace)

        # If we're throttling tracing data, we need to see if we should accumulate this trace or
        # send it now.  We acculumate if we've last sent tracing data less than self.throttle_trace seconds ago
        if last_trace is not None and (now - last_trace) < self.throttle_trace:
            if not conn_data['trace_scheduled']:
                self._loop.call_later(self.throttle_trace - (now - last_trace), self._send_accum_trace, device_uuid)
                conn_data['trace_scheduled'] = True
                self._logger.debug("Deferring trace data due to throttling uuid=0x%X", device_uuid)
        else:
            self._send_accum_trace(device_uuid)
460116
def status(self, obj):
        """"""

        reply = self._send_cmd_to_wpas(obj['name'], 'STATUS', True)
        result = reply.split('\n')

        status = ''
        for l in result:
            if l.startswith('wpa_state='):
                status = l[10:]
                return status_dict[status.lower()]
258238
def id_request(self, device_id):
        """"""
        self.logger.info("\nid_request for device %s", device_id)
        device_id = device_id.upper()

        self.direct_command(device_id, '10', '00')

        sleep(2)

        status = self.get_buffer_status(device_id)
        if not status:
            sleep(1)
            status = self.get_buffer_status(device_id)

        return status
432645
public int getHTTPStatus() throws InterruptedException, BOSHException {
        if (toThrow != null) {
            throw(toThrow);
        }
        lock.lock();
        try {
            if (!sent) {
                awaitResponse();
            }
        } finally {
            lock.unlock();
        }
        return statusCode;
    }
248649
async def status(dev: Device):
    """"""
    power = await dev.get_power()
    click.echo(click.style("%s" % power, bold=power))

    vol = await dev.get_volume_information()
    click.echo(vol.pop())

    play_info = await dev.get_play_info()
    if not play_info.is_idle:
        click.echo("Playing %s" % play_info)
    else:
        click.echo("Not playing any media")

    outs = await dev.get_inputs()
    for out in outs:
        if out.active:
            click.echo("Active output: %s" % out)

    sysinfo = await dev.get_system_info()
    click.echo("System information: %s" % sysinfo)
160205
@Override
    public String status() {
        MDC.setContextMap(contextMap);
        xlogger.entry();
        try {
            status = getStatus();
        } catch (final DevFailed e) {
            try {
                stateImpl.stateMachine(DeviceState.UNKNOWN);
                statusImpl.statusMachine(DevFailedUtils.toString(e), DeviceState.UNKNOWN);
                status = DevFailedUtils.toString(e);
            } catch (final DevFailed e1) {
                logger.debug(NOT_IMPORTANT_ERROR, e1);
            }
            logger.debug(NOT_IMPORTANT_ERROR, e);
        }
        return status;
    }
90050
def _traceroute_callback(self, line, kill_switch):
    

    line = line.lower()
    if "traceroute to" in line:
        self.started = True
    # need to run as root but not running as root.
    # usually happens when doing TCP and ICMP traceroute.
    if "enough privileges" in line:
        self.error = True
        self.kill_switch()
        self.stopped = True
    # name resolution failed
    if "service not known" in line:
        self.error = True
        self.kill_switch()
        self.stopped = True
1068862
public State getMobileState() {
		if (connMan == null) {
			connMan = (ConnectivityManager) context
					.getSystemService(Context.CONNECTIVITY_SERVICE);
		}
		NetworkInfo mobileNetworkInfo = connMan.getNetworkInfo(TYPE_MOBILE);
		if (mobileNetworkInfo == null) {
			return State.UNKNOWN;
		}

		return mobileNetworkInfo.getState();
	}
430272
def get_tc_device(self):
        

        if self.direction == TrafficDirection.OUTGOING:
            return self.device

        if self.direction == TrafficDirection.INCOMING:
            return self.ifb_device

        raise ParameterError(
            "unknown direction", expected=TrafficDirection.LIST, value=self.direction
        )
822231
public void collectRouteStats(String route, int statusCode) {

        // increments 200, 301, 401, 503, etc. status counters
        final String preciseStatusString = String.format("status_%d", statusCode);
        NamedCountingMonitor preciseStatus = namedStatusMap.get(preciseStatusString);
        if (preciseStatus == null) {
            preciseStatus = new NamedCountingMonitor(preciseStatusString);
            NamedCountingMonitor found = namedStatusMap.putIfAbsent(preciseStatusString, preciseStatus);
            if (found != null) preciseStatus = found;
            else MonitorRegistry.getInstance().registerObject(preciseStatus);
        }
        preciseStatus.increment();

        // increments 2xx, 3xx, 4xx, 5xx status counters
        final String summaryStatusString = String.format("status_%dxx", statusCode / 100);
        NamedCountingMonitor summaryStatus = namedStatusMap.get(summaryStatusString);
        if (summaryStatus == null) {
            summaryStatus = new NamedCountingMonitor(summaryStatusString);
            NamedCountingMonitor found = namedStatusMap.putIfAbsent(summaryStatusString, summaryStatus);
            if (found != null) summaryStatus = found;
            else MonitorRegistry.getInstance().registerObject(summaryStatus);
        }
        summaryStatus.increment();

        // increments route and status counter
        if (route == null) route = "ROUTE_NOT_FOUND";
        route = route.replace("/", "_");
        ConcurrentHashMap<Integer, RouteStatusCodeMonitor> statsMap = routeStatusMap.get(route);
        if (statsMap == null) {
            statsMap = new ConcurrentHashMap<Integer, RouteStatusCodeMonitor>();
            routeStatusMap.putIfAbsent(route, statsMap);
        }
        RouteStatusCodeMonitor sd = statsMap.get(statusCode);
        if (sd == null) {
            //don't register only 404 status codes (these are garbage endpoints)
            if (statusCode == 404) {
                if (statsMap.size() == 0) {
                    return;
                }
            }

            sd = new RouteStatusCodeMonitor(route, statusCode);
            RouteStatusCodeMonitor sd1 = statsMap.putIfAbsent(statusCode, sd);
            if (sd1 != null) {
                sd = sd1;
            } else {
                MonitorRegistry.getInstance().registerObject(sd);
            }
        }
        sd.update();
    }
29639
def status(name, sig=None):
    '''
    
    '''

    proxy_fn = 'dummy.service_status'
    resp = __proxy__[proxy_fn](name)
    if resp['comment'] == 'stopped':
        return False
    if resp['comment'] == 'running':
        return True
915916
def _get_vpn_status(self):
        """"""
        # Sleep for a bit to let any changes in state finish
        sleep(0.3)
        # Check if any active connections are a VPN
        bus = SystemBus()
        ids = []
        for name in self.active:
            conn = bus.get(".NetworkManager", name)
            if conn.Vpn:
                ids.append(conn.Id)
        # No active VPN
        return ids