the heart of it all
169399
private void append(StringBuilder buffer, char c) {

		// version manually simplified
		// final boolean shouldAppend = rawOutput || escaped
		// || (c != quoteChar && c != escapeChar);
		// final boolean newEscaped = c == escapeChar && !escaped;
		// final boolean newQuoted = (c == quoteChar && !escaped) ? !quoted
		// : quoted;

		// side-effect free version directly extracted from if

		// final boolean shouldAppend = (c == escapeChar && (escaped ||
		// rawOutput))
		// || (c == quoteChar && (escaped || rawOutput))
		// || !(c == quoteChar || c == escapeChar);
		// final boolean newEscaped = c == escapeChar ? !escaped
		// : (c == quoteChar ? false : false);
		// final boolean newQuoted = c == escapeChar ? quoted
		// : (c == quoteChar ? (!escaped ? !quoted : quoted) : quoted);

		// if (shouldAppend) {
		// buffer.append(c);
		// }
		//
		// escaped = newEscaped;
		// quoted = newQuoted;

		// original version
		// XXX needed to revert to this original version as micro benchmark
		// tests
		// showed a slow down of more than 100%
		if (c == escapeChar) {
			if (escaped || rawOutput) {
				buffer.append(c);
			}
			escaped = !escaped;
		} else if (c == quoteChar) {
			if (escaped) {
				buffer.append(c);
				escaped = false;
			} else {
				quoted = !quoted;
				if (rawOutput) {
					buffer.append(c);
				}
			}
		} else {
			buffer.append(c);
			escaped = false;
		}
	}
1014075
def top_process(self):
        
        key = next(iter(self.entries))
        return self.entries[key].process_entry
493864
def file_parts(self):
        
        file_parts = []
        for part in self.parts:
            try:
                for sub_part in part:
                    if isinstance(sub_part, FileToken):
                        file_parts.append(sub_part)
            except TypeError:
                if isinstance(part, FileToken):
                    file_parts.append(part)
        return file_parts
468065
def all(self):
        
        result = self.invoke()
        if self.resolve_links:
            result.resolve_links()

        return result
933765
void onHeartbeat(Member member, long timestamp) {
        if (!heartbeatAwareQuorumFunction) {
            return;
        }
        ((HeartbeatAware) quorumFunction).onHeartbeat(member, timestamp);
    }
298119
public function all()
    {
        $saved = $this->allSaved();

        return $this->allDefaults()->map(function ($value, $key) use ($saved) {
            if ($saved->has($key)) {
                return $saved->get($key);
            }

            return $value;
        });
    }
403319
def all_up(self):
        
        level = self
        while level.up:
            level = level.up
        return level
696010
@Override
  public void heartbeat() {
    // Prepare metadata for the next heartbeat
    BlockHeartbeatReport blockReport = mBlockWorker.getReport();
    BlockStoreMeta storeMeta = mBlockWorker.getStoreMeta();

    // Send the heartbeat and execute the response
    Command cmdFromMaster = null;
    List<alluxio.grpc.Metric> metrics = new ArrayList<>();
    for (Metric metric : MetricsSystem.allWorkerMetrics()) {
      metrics.add(metric.toProto());
    }
    try {
      cmdFromMaster = mMasterClient.heartbeat(mWorkerId.get(), storeMeta.getCapacityBytesOnTiers(),
          storeMeta.getUsedBytesOnTiers(), blockReport.getRemovedBlocks(),
          blockReport.getAddedBlocks(), blockReport.getLostStorage(), metrics);
      handleMasterCommand(cmdFromMaster);
      mLastSuccessfulHeartbeatMs = System.currentTimeMillis();
    } catch (IOException | ConnectionFailedException e) {
      // An error occurred, log and ignore it or error if heartbeat timeout is reached
      if (cmdFromMaster == null) {
        LOG.error("Failed to receive master heartbeat command.", e);
      } else {
        LOG.error("Failed to receive or execute master heartbeat command: {}",
            cmdFromMaster.toString(), e);
      }
      mMasterClient.disconnect();
      if (mHeartbeatTimeoutMs > 0) {
        if (System.currentTimeMillis() - mLastSuccessfulHeartbeatMs >= mHeartbeatTimeoutMs) {
          if (ServerConfiguration.getBoolean(PropertyKey.TEST_MODE)) {
            throw new RuntimeException("Master heartbeat timeout exceeded: " + mHeartbeatTimeoutMs);
          }
          // TODO(andrew): Propagate the exception to the main thread and exit there.
          ProcessUtils.fatalError(LOG, "Master heartbeat timeout exceeded: %d",
              mHeartbeatTimeoutMs);
        }
      }
    }
  }
1205656
def get_all_upper(self):
        """"""
        all_upper = set()
        for upper in self.get_goterms_upper():
            all_upper.add(upper.item_id)
            all_upper |= upper.get_all_upper()
        return all_upper
1002296
def all(self, components_in_and=True):
        ''''''
        self.components_in_and = components_in_and
        return [obj for obj in iter(self)]
599720
def _heartbeat_view(self):
        
        details = {}
        statuses = {}
        level = 0

        for name, check in self.checks.items():
            detail = self._heartbeat_check_detail(check)
            statuses[name] = detail['status']
            level = max(level, detail['level'])
            if detail['level'] > 0:
                details[name] = detail

        payload = {
            'status': checks.level_to_text(level),
            'checks': statuses,
            'details': details,
        }

        def render(status_code):
            return make_response(jsonify(payload), status_code)

        if level < checks.WARNING:
            status_code = 200
            heartbeat_passed.send(self, level=level)
            return render(status_code)
        else:
            status_code = 500
            heartbeat_failed.send(self, level=level)
            raise HeartbeatFailure(response=render(status_code))
229737
function() {
    // Walk all of the elements in the DOM (try to only do this once)
    var elements = doc.getElementsByTagName('*');
    var re = /url\((http.*)\)/ig;
    for (var i = 0; i < elements.length; i++) {
      var el = elements[i];
      var style = win.getComputedStyle(el);

      // check for Images
      if (el.tagName == 'IMG') {
        CheckElement(el, el.src);
      }
      // Check for background images
      if (style['background-image']) {
        re.lastIndex = 0;
        var matches = re.exec(style['background-image']);
        if (matches && matches.length > 1)
          CheckElement(el, matches[1]);
      }
      // recursively walk any iFrames
      if (el.tagName == 'IFRAME') {
        try {
          var rect = GetElementViewportRect(el);
          if (rect) {
            var tm = RUMSpeedIndex(el.contentWindow);
            if (tm) {
              rects.push({'tm': tm,
                          'area': rect.area,
                          'rect': rect});
            }
        }
        } catch(e) {
        }
      }
    }
  }
910761
def allPolygons(self):
        
        polygons = self.polygons[:]
        if self.front: 
            polygons.extend(self.front.allPolygons())
        if self.back: 
            polygons.extend(self.back.allPolygons())
        return polygons
543127
void heartbeat() {
        if (!clusterService.isJoined()) {
            return;
        }

        checkClockDrift(heartbeatIntervalMillis);

        final long clusterTime = clusterClock.getClusterTime();
        if (clusterService.isMaster()) {
            heartbeatWhenMaster(clusterTime);
        } else {
            heartbeatWhenSlave(clusterTime);
        }
    }
539795
function () {
            var self = this;
            self.set('expanded', true);
            util.each(self.get('children'), function (c) {
                c.expandAll();
            });
        }
1328483
def viewbox(self):
        
        return self.left, self.top, self.right, self.bottom
967071
def all(self, data={}, **kwargs):
        "
        return super(Settlement, self).all(data, **kwargs)