Returns True or False if monitor is deleted
975358
def deleteMonitorById(self, monitorID):
        
        url = self.baseUrl
        url += "deleteMonitor?apiKey=%s" % self.apiKey
        url += "&monitorID=%s" % monitorID
        url += "&noJsonCallback=1&format=json"
        success, response = self.requestApi(url)
        if success:
            return True
        else:
            return False
555455
def is_marked_deleted(self, entity):
        
        try:
            result = EntityState.get_state(entity).status \
                                                    == ENTITY_STATUS.DELETED
        except ValueError:
            result = False
        return result
996020
function (port, parent_port) {

	// check if the port wasn't reported
	if (l_ports.hasOwnProperty(port) === false) {
		
		LOG.warn('recording used port [' + port + ']...', 'SR.Monitor');	
		l_ports[port] = parent_port || port;
	}
}
948134
function(error) {
        if (error) {
          return callback(error);
        }
        probe.off('change', monitor.probeChange);
        monitor.set({probeId:null});
        monitor.probe = monitor.probeChange = null;
        return callback(null, reason);
      }
7277
def monitor(self, target):
        
        if 'monitor-notify' in self._capabilities and not self.is_monitoring(target):
            yield from self.rawmsg('MONITOR', '+', target)
            self._monitoring.add(target)
            return True
        else:
            return False
744396
private void sawMonitorExit(int pc) {
        if (!monitorSyncPCs.isEmpty()) {
            ScopeBlock sb = findSynchronizedScopeBlock(rootScopeBlock, monitorSyncPCs.get(0).intValue());
            if (sb != null) {
                sb.setFinish(pc);
            }
            monitorSyncPCs.remove(monitorSyncPCs.size() - 1);
        }
    }
272688
protected void unsetMonitor(ServiceReference<FileMonitor> monitorRef) {
        MonitorHolder holder = fileMonitors.remove(monitorRef);

        if (holder != null) {
            holder.destroy();
        }
    }
306539
public function isSick($monitor)
    {
        $result = $this->getStatus($monitor);

        if (is_null($result)) {
            return false;
        }

        return (! $result->healthy);
    }
1258472
def _monitor(self):
        
        err_msg = ("invalid internal state:"
                   " _stop_nowait can not be set if _stop is not set")
        assert self._stop.isSet() or not self._stop_nowait.isSet(), err_msg

        q = self.queue
        has_task_done = hasattr(q, 'task_done')
        while not self._stop.isSet():
            try:
                record = self.dequeue(True)
                if record is self._sentinel_item:
                    break
                self.handle(record)
                if has_task_done:
                    q.task_done()
            except queue.Empty:
                pass

        # There might still be records in the queue,
        # handle then unless _stop_nowait is set.
        while not self._stop_nowait.isSet():
            try:
                record = self.dequeue(False)
                if record is self._sentinel_item:
                    break
                self.handle(record)
                if has_task_done:
                    q.task_done()
            except queue.Empty:
                break
1262815
def update_monitor(self):
        """"""
        result = self._client.get_state(self._monitor_url)
        self._raw_result = result['monitor']
194701
def _remove_monitor(monitors, handle, devices, events):
    """"""

    empty_devices = []

    for conn_string in devices:
        data = monitors.get(conn_string)
        if data is None:
            continue

        for event in events:
            event_dict = data.get(event)
            if event_dict is None:
                continue

            if handle in event_dict:
                del event_dict[handle]

            if len(event_dict) == 0:
                del data[event]

        if len(data) == 0:
            empty_devices.append(conn_string)

    return empty_devices
1124904
public function isDeleted()
	{
		if (!array_key_exists('state', $this->_tbl->getFields()))
		{
			return false;
		}
		if ($this->get('state') == self::APP_STATE_DELETED)
		{
			return true;
		}
		return false;
	}
576345
function isConnectionDead(cursor, callback) {
  if (cursor.pool && cursor.pool.isDestroyed()) {
    cursor.s.killed = true;
    const err = new MongoNetworkError(
      `connection to host ${cursor.pool.host}:${cursor.pool.port} was destroyed`
    );
    _setCursorNotifiedImpl(cursor, () => callback(err));
    return true;
  }

  return false;
}
144208
@Override
    public void monitor() {
        Runtime runtime = Runtime.getRuntime();

        double allocatedMemory = runtime.totalMemory() / (double) 1024;
        double freeMemory = runtime.freeMemory() / (double) 1024;

        double totalFreeMemory = freeMemory + (maxMemory - allocatedMemory);

        calculatedAllocatedMemory = allocatedMemory;
        calculatedFreeMemory = freeMemory;
        calculatedTotalFreeMemory = totalFreeMemory;

        this.percentageOfMemoryUsed = (((double) 100) - ((totalFreeMemory / maxMemory) * ((double) 100)));

        super.applyNewValue(memoryAlarmLevel, percentageOfMemoryUsed, memoryThreshold, backToNormalMemoryThreshold, true);
    }
308547
def getMonitorByName(self, monitorFriendlyName):
        
        url = self.baseUrl
        url += "getMonitors?apiKey=%s" % self.apiKey
        url += "&noJsonCallback=1&format=json"
        success, response = self.requestApi(url)
        if success:
            monitors = response.get('monitors').get('monitor')
            for i in range(len(monitors)):
                monitor = monitors[i]
                if monitor.get('friendlyname') == monitorFriendlyName:
                    status = monitor.get('status')
                    alltimeuptimeratio = monitor.get('alltimeuptimeratio')
                    return status, alltimeuptimeratio
        return None, None
1126927
def has_reset(self):
        """"""
        currentTime = self._read_as_int(Addr.Uptime, 4)
        if currentTime <= self._ticks:
            self._ticks = currentTime
            return True
        self._ticks = currentTime
        return False
632914
def teardown(self):
        '''
        
        '''
        self.monitor_thread.stop()
        self.monitor_thread = None
        super(BaseMonitor, self).teardown()