Method called by core.
        Should not be overwritten.
485541
async def pull_metrics(self, event_fn, loop=None):
        
        if self.lazy and not self.ready:
            return None
        logger = self.get_logger()

        ts = timer()
        logger.trace("Waiting for process event")
        result = await self.process(event_fn)
        td = int(timer() - ts)
        logger.trace("It took: {}ms".format(td))
        self._last_run = current_ts()
        return result
572188
private void cleanupIfNeccessary(JsonGetterContext excluded) {
        int cacheCount;
        while ((cacheCount = internalCache.size()) > maxContexts) {
            int sampleCount = Math.max(cacheCount - maxContexts, cleanupRemoveAtLeastItems) + 1;
            for (SamplingEntry sample: internalCache.getRandomSamples(sampleCount)) {
                if (excluded != sample.getEntryValue()) {
                    internalCache.remove(sample.getEntryKey());
                }
            }
        }
    }
529645
def prepare_method(self, method):
        """"""
        self.method = method
        if self.method is not None:
            self.method = self.method.upper()
34368
private static boolean isAsyncMethod(Method method) {
        Class<?>[] parameterTypes = method.getParameterTypes();
        for (Class<?> c : parameterTypes)
        {
            if (c.isAssignableFrom(javax.ws.rs.container.AsyncResponse.class))
                return true;
        }
        return false;
    }
755124
def check_is_not_created(method):
    
    def check(self, *args, **kwargs):
        if self.id is not None:
            raise AlreadyCreatedError('%s.id %s already exists.' %
                                     (self.__class__.__name__, self.id))
        return method(self, *args, **kwargs)
    return check
1021735
private void newTranslet(MethodType requestMethod, String requestName, TransletRule transletRule,
                             Translet parentTranslet) {
        translet = new CoreTranslet(transletRule, this);
        translet.setRequestName(requestName);
        translet.setRequestMethod(requestMethod);
        if (parentTranslet != null) {
            translet.setProcessResult(parentTranslet.getProcessResult());
        }
    }
78947
private boolean mustContinue(BitSet potentialNode) {
        boolean result = true;
        boolean cancel = false;
        BitSet projG1 = projectG1(potentialNode);
        BitSet projG2 = projectG2(potentialNode);

        // if we reached the maximum number of
        // search iterations than do not continue
        if (getMaxIteration() != -1 && getNbIteration() >= getMaxIteration()) {
            return false;
        }

        // if constrains may no more be fulfilled then stop.
        if (!isContainedIn(sourceBitSet, projG1) || !isContainedIn(targetBitSet, projG2)) {
            return false;
        }

        // check if the solution potential is not included in an already
        // existing solution
        for (Iterator<BitSet> i = getSolutionList().iterator(); i.hasNext() && !cancel;) {
            BitSet sol = i.next();

            // if we want every 'mappings' do not stop
            if (isFindAllMap() && (projG1.equals(projectG1(sol)) || projG2.equals(projectG2(sol)))) {
                // do nothing
            } // if maxIterator is not possible to do better than an already existing solution than stop.
            else if (isContainedIn(projG1, projectG1(sol)) || isContainedIn(projG2, projectG2(sol))) {
                result = false;
                cancel = true;
            }
        }

        return result;
    }
455586
public void log(Throwable exception) {
		if (exception instanceof CoreException) {
			getILog().log(new Status(IStatus.ERROR, PLUGIN_ID,
					exception.getMessage(),
					exception.getCause()));
		} else if (exception != null) {
			getILog().log(new Status(IStatus.ERROR, PLUGIN_ID,
					exception.getMessage(), exception));
		} else {
			getILog().log(new Status(IStatus.ERROR, PLUGIN_ID,
					"Internal Error", exception));   //$NON-NLS-1$
		}
	}
1127699
private void addMethodInfo(ExecutableElement method, Content dl) {
        TypeElement enclosing = utils.getEnclosingTypeElement(method);
        List<? extends TypeMirror> intfacs = enclosing.getInterfaces();
        ExecutableElement overriddenMethod = utils.overriddenMethod(method);
        // Check whether there is any implementation or overridden info to be
        // printed. If no overridden or implementation info needs to be
        // printed, do not print this section.
        if ((!intfacs.isEmpty()
                && new ImplementedMethods(method, this.configuration).build().isEmpty() == false)
                || overriddenMethod != null) {
            MethodWriterImpl.addImplementsInfo(this, method, dl);
            if (overriddenMethod != null) {
                MethodWriterImpl.addOverridden(this,
                        utils.overriddenType(method),
                        overriddenMethod,
                        dl);
            }
        }
    }
875149
public void setCores(java.util.Collection<Core> cores) {
        if (cores == null) {
            this.cores = null;
            return;
        }

        this.cores = new java.util.ArrayList<Core>(cores);
    }
1285212
@Override
    public void sawOpcode(int seen) {
        if (seen != Const.INVOKESPECIAL) {
            return;
        }

        String calledClassName = getClassConstantOperand();
        String calledMethodName = getNameConstantOperand();
        String calledMethodSig = getSigConstantOperand();
        if (calledClassName.equals(getSuperclassName()) && calledMethodName.equals(getMethodName())
                && calledMethodSig.equals(getMethodSig())) {
            sawCallToSuper = true;
        }

    }
441988
protected void handleMutation() {

        if (m_unregistered) {
            removeObserver();
            return;
        }

        int maxHeight = getState().getMaxHeight();
        if (m_currentHeight > 0) {
            removeObserver(); // prevent 'recursive' call of handleMutation (it's not actually recursive since it's async, but would still lead to an infinite number of calls)
            JavaScriptObject scrollPositionData = saveScrollPositions(m_widget.getElement());
            String classToAdd = "o-measuring-height";
            m_widget.addStyleName(classToAdd);
            m_widget.getElement().getStyle().clearHeight();
            int computedHeight = m_widget.getOffsetHeight();
            m_widget.removeStyleName(classToAdd);
            if ((computedHeight + 10) < m_currentHeight) {
                m_currentHeight = -1;
                m_rpc.fixHeight(m_currentHeight);
            } else {
                m_widget.getElement().getStyle().setHeight(m_currentHeight, Unit.PX);
            }
            restoreScrollPositions(scrollPositionData);
            addMutationObserver(m_widget.getElement());
        } else if ((maxHeight > 0) && (m_widget.getOffsetHeight() > maxHeight)) {
            m_currentHeight = maxHeight;
            m_rpc.fixHeight(m_currentHeight);
        }
    }
224512
private static void removeMethodByName(Method method, List<Method> methods) {
    if(methods != null) {
      Iterator<Method> itr = methods.iterator();
      Method aMethod = null;
      while(itr.hasNext()) {
        aMethod = itr.next();
        if(aMethod.getName().equals(method.getName())) {
          itr.remove();
          break;
        }
      }
      if(aMethod != null) {
        methods.add(aMethod);
      }
    }
  }
1019063
def _writable(method):
    
    @wraps(method)
    def wrapper(self, *args, **kwargs):
        """Send record for indexing.

        :returns: Execution result of the decorated method.

        :raises InvalidOperationError: It occurs when the bucket is locked or
            deleted.
        """
        if self.bucket.locked or self.bucket.deleted:
            raise InvalidOperationError()
        return method(self, *args, **kwargs)
    return wrapper
930139
public void clear() {
        exceptionSet.clear();
        explicitSet.clear();
        universalHandler = false;
        commonSupertype = null;
        size = 0;
    }
136604
private void detectNestedInvocations(Method daoMethod) {
		if (!Config.IN_PRODUCTION && !daoMethod.getName().startsWith("read")) {
			StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
			for (StackTraceElement stackTraceElement : stackTraceElements) {
				if (daoMethod.getDeclaringClass().getName().equals(stackTraceElement.getClassName()) &&
						!daoMethod.getName().equals(stackTraceElement.getMethodName())) {
					throw new RuntimeException(Utils.
							formatMessage("Method {0}.{1}() was invoked from another method in the same "
							+ "class - {2}.{3}(). DAO implementations should avoid this as it causes objects to be "
							+ "indexed and cached twice per request.",
							daoMethod.getDeclaringClass().getSimpleName(), daoMethod.getName(),
							stackTraceElement.getClassName(), stackTraceElement.getMethodName()));
				}
			}
		}
	}
392230
@Override
    public void visitMethod(Method obj) {
        Code c = obj.getCode();
        if (c != null) {
            byte[] opcodes = c.getCode();
            if (opcodes != null) {
                trPCPos = opcodes.length - 1;
                if (!obj.getSignature().endsWith(Values.SIG_VOID)) {
                    trPCPos -= 1;
                }
                trPCPos -= TAILRECURSIONFUDGE;
                possibleTailRecursion = true;
                isStatic = obj.isStatic();
                stack.resetForMethodEntry(this);
                super.visitMethod(obj);
            }
        }
    }