Returns a boolean indicating whether the node is running out of memory.
966917
private boolean isRunningOutOfMemory() {
    StorageLevel level = raft.getStorage().storageLevel();
    if (level == StorageLevel.MEMORY || level == StorageLevel.MAPPED) {
      long freeMemory = raft.getStorage().statistics().getFreeMemory();
      long totalMemory = raft.getStorage().statistics().getTotalMemory();
      if (freeMemory > 0 && totalMemory > 0) {
        return freeMemory / (double) totalMemory < raft.getStorage().freeMemoryBuffer();
      }
    }
    return false;
  }
524486
def size(self, type=None, failed=False):
        
        return len(self.nodes(type=type, failed=failed))
350465
def memory_used(self):
        
        if self._end_memory:
            memory_used = self._end_memory - self._start_memory
            return memory_used
        else:
            return None
1045476
def _is_memory_usage_qualified(self):
        
        def f(l):
            return 'mixed' in l or 'string' in l or 'unicode' in l
        return any(f(l) for l in self._inferred_type_levels)
1362483
private boolean shouldRemoveNode(HistoryNode node) {
    if (node == null) {
      return true;
    }
    
    int sizeOfChildren = 0;
    if (node.children != null) {
      sizeOfChildren = node.children.size();
    }
    
    if (sizeOfChildren > 0) {
      return false;
    }
    
    int sizeOfNotifications = 0;
    if (node.notifications != null) {
      for (List<HistoryTreeEntry> notiList : node.notifications.values()) {
        if (notiList != null) {
          sizeOfNotifications += notiList.size();
          if (sizeOfNotifications > 0) {
            return false;
          }
        }
      }
    }
    
    return true;
  }
422500
public boolean isEmpty() {
		switch(size()) {
			case 0:
				return true;
			case 1:
				Element element = (Element) arrayList.get(0);
				switch (element.type()) {
					case Element.CHUNK:
						return ((Chunk) element).isEmpty();
					case Element.ANCHOR:
					case Element.PHRASE:
					case Element.PARAGRAPH:
						return ((Phrase) element).isEmpty();
					case Element.LIST:
						return ((List) element).isEmpty();
				}
			return false;
			default:
				return false;
		}
	}
135269
@Pure
	public boolean isEndingBusHalt() {
		final BusItinerary itinerary = getContainer();
		if (itinerary != null && itinerary.isValidPrimitive()) {
			final int count = itinerary.getValidBusHaltCount();
			if (count > 0) {
				try {
					return itinerary.getBusHaltAt(count - 1) == this;
				} catch (IndexOutOfBoundsException exception) {
					// invalid halt
				}
			}
		}
		return false;
	}
1169725
def check_available_ram(self, requested_ram):
        

        available_ram = int(psutil.virtual_memory().available / (1024 * 1024))
        percentage_left = psutil.virtual_memory().percent
        if requested_ram > available_ram:
            message = '"{}" requires {}MB of RAM to run but there is only {}MB - {}% of RAM left on "{}"'.format(self.name,
                                                                                                                 requested_ram,
                                                                                                                 available_ram,
                                                                                                                 percentage_left,
                                                                                                                 platform.node())
            self.project.emit("log.warning", {"message": message})
131554
Node<E> last() {
        restartFromTail:
        for (;;)
            for (Node<E> t = tail, p = t, q;;) {
                if ((q = p.next) != null &&
                    (q = (p = q).next) != null)
                    // Check for tail updates every other hop.
                    // If p == q, we are sure to follow tail instead.
                    p = (t != (t = tail)) ? t : q;
                else if (p == t
                         // It is possible that p is NEXT_TERMINATOR,
                         // but if so, the CAS is guaranteed to fail.
                         || casTail(t, p))
                    return p;
                else
                    continue restartFromTail;
            }
    }
375193
function(node) {
		var hasNodes = false;

		if (node.hasChildNodes()) {
			for (var i = 0, len = node.childNodes.length; i < len; i++) {
				if (node.childNodes[i].nodeType === 1) {
					hasNodes = true;
					break;
				}
			}
		}

		return hasNodes;
	}
969091
@Trivial
    public synchronized boolean isFull() {
        // final String methodName = "isFull()";
        boolean isFull = false;
        int size = this.explicitBuffer.size() + this.scanBuffer.size() + this.garbageCollectorBuffer.size();
        if (size > this.maxInvalidationBufferSize || (System.currentTimeMillis() - this.lastRemoveTime) >= this.maxInvalidationBufferLife) {
            isFull = true;
            setlastRemoveTime();
        }
        // if (isFull) {
        // traceDebug(methodName, "cacheName=" + this.cod.cacheName + " isFull=" + isFull + " explicitBuffer=" +
        // explicitBuffer.size() + " scanBuffer=" + this.scanBuffer.size());
        // }
        return isFull;
    }
1075855
public boolean lastChild() {
        if (mNode == null || mNode.getChildCount() < 1) {
            return false;
        }
        for (int i = mNode.getChildCount() - 1; i >= 0; --i) {
            AccessibilityNodeInfoCompat newNode = mNode.getChild(i);
            if (newNode == null) {
                return false;
            }
            if (AccessibilityNodeInfoUtils.isVisibleOrLegacy(newNode)) {
                reset(newNode);
                return true;
            }
            newNode.recycle();
        }
        return false;
    }
1170253
function (node) {
            var len = nodeLength(node);

            if (len === 0) {
                return true;
            } else if (!isText(node) && len === 1 && node.innerHTML === blankHTML) {
                // ex) <p><br></p>, <span><br></span>
                return true;
            } else if (list.all(node.childNodes, isText) && node.innerHTML === '') {
                // ex) <p></p>, <span></span>
                return true;
            }

            return false;
        }
1024648
boolean isProcessTreeOverLimit(ProcfsBasedProcessTree pTree, 
                                    String tId, long limit) {
    long currentMemUsage = pTree.getCumulativeVmem();
    // as processes begin with an age 1, we want to see if there are processes
    // more than 1 iteration old.
    long curMemUsageOfAgedProcesses = pTree.getCumulativeVmem(1);
    return isProcessTreeOverLimit(tId, currentMemUsage, 
                                  curMemUsageOfAgedProcesses, limit);
  }
1266002
public <T extends Memory> T getNodeMemory(MemoryFactory<T> node) {
        return nodeMemories.getNodeMemory( node, this );
    }
1241727
def is_empty(self):
        
        while self.pq:
            if self.pq[0][1] != self.INVALID:
                return False
            else:
                _, _, element = heapq.heappop(self.pq)
                if element in self.element_finder:
                    del self.element_finder[element]
        return True
781990
private boolean isNsAware(Element mathNode) {
        Field field;
        Document document = mathNode.getOwnerDocument();
        try {
            field = document.getClass().getDeclaredField("fNamespacesEnabled");
            field.setAccessible(true);
            return (boolean) field.get(document);
        } catch (NoSuchFieldException | IllegalAccessException e) {
            logger.debug("Possible performance issue: Can not determine if node document is namespace aware.", e);
            return false;
        }
    }