check if stack line for this instance matches targetStackLines
494014
public boolean matchesStackLines(List<StackLine> targetStackLines) {
        if (targetStackLines.size() != getStackLines().size()) {
            return false;
        }
        for (int i = 0; i < targetStackLines.size(); i++) {
            StackLine targetLine = targetStackLines.get(i);
            StackLine line = getStackLines().get(i);
            if (!targetLine.getMethod().getKey().equals(line.getMethod().getKey())) {
                return false;
            }
            if (targetLine.getCodeBodyIndex() != line.getCodeBodyIndex()) {
                return false;
            }
        }
        return true;
    }
556515
private boolean canStepInCaptureTo(List<StackLine> stackLines) {
        // stack bottom line ( = root line) is always regarded as stepIn true line
        for (int i = 0; i < stackLines.size() - 1; i++) {
            StackLine stackLine = stackLines.get(i);
            CaptureStyle style = stackLine.getMethod().getCaptureStyle();
            if (style != CaptureStyle.STEP_IN && style != CaptureStyle.STEP_IN_ONLY) {
                return false;
            }
        }
        return true;
    }
41978
private static boolean isCallTo(Node n, Node targetMethod) {
    if (!n.isCall()) {
      return false;
    }
    Node method = n.getFirstChild();
    return method.isGetProp() && method.matchesQualifiedName(targetMethod);
  }
681532
@Override
    public boolean matches(TargetProperties targetConatiner, IBond targetBond) {
        if (this.smartQueryBond != null) {
            return smartQueryBond.matches(targetBond);
        } else {
            if (!isBondMatchFlag()) {
                return true;
            }
            if (isBondMatchFlag() && isBondTypeMatch(targetBond)) {
                return true;
            }
            if (isBondMatchFlag() && this.unsaturation == getUnsaturation(targetConatiner, targetBond)) {
                return true;
            }
        }
        return false;
    }
1056968
private static StackTraceElement[] cropStackTrace(StackTraceElement[] callStack,
                                                    int maxDepth) {
    int realDepth = callStack.length;
    if (maxDepth > 0) {
      realDepth = Math.min(maxDepth, realDepth);
    }
    StackTraceElement[] realStack = new StackTraceElement[realDepth];
    System.arraycopy(callStack, 0, realStack, 0, realDepth);
    return realStack;
  }
804136
def _LookUpStack(self, name):
        """"""
        i = len(self.stack) - 1
        while 1:
            frame = self.stack[i]
            if name == '@index':
                if frame.index != -1:  # -1 is undefined
                    return frame.index  # @index is 1-based
            else:
                context = frame.context
                if hasattr(context, 'get'):  # Can't look up names in a list or atom
                    try:
                        return context[name]
                    except KeyError:
                        pass
            
            i -= 1  # Next frame
            if i <= -1:  # Couldn't find it anywhere
                return self._Undefined(name)
1219998
def getStackTraceLogger(*args, **kwargs):
    """"""
    logger = logging.getLogger(*args, **kwargs)
    return StackTraceLogger(logger)
758802
private List<StackLine> getCodeLineHookedStackLines(
            final String hookedMethodSimpleName, final String actualHookedMethodSimpleName,
            final int hookedLine, final int actualHookedLine) {
        // this replacer replaces method name and line to the actual hooked method name and line
        LineReplacer replacer = new LineReplacer() {

            @Override
            public void replace(String classQualifiedName, String methodSimpleName, int line) {
                super.replace(classQualifiedName, methodSimpleName, line);
                // replacing root method name
                if (StringUtils.equals(methodSimpleName, currentActualRootMethodSimpleName)) {
                    replaceMethodSimpleName(currentRunResult.getRootMethod().getSimpleName());
                }
                // replacing hooked method name and line number
                if (StringUtils.equals(methodSimpleName, actualHookedMethodSimpleName)
                        && (line == actualHookedLine)) {
                    replaceMethodSimpleName(hookedMethodSimpleName);
                    replaceLine(hookedLine);
                }
            }
        };

        List<StackLine> result = StackLineUtils.getStackLines(
                srcTree, Thread.currentThread().getStackTrace(), replacer);
        assert result.size() > 0;
        return result;
    }
907560
def compare_property_vs_target(property, target)
      case target
      when NilClass
        return true if property.nil?
      when Liquid::Expression::MethodLiteral # `empty` or `blank`
        return true if Array(property).join == target.to_s
      else
        Array(property).each do |prop|
          return true if prop.to_s == target.to_s
        end
      end

      false
    end
46873
def match(self, context, line):
		""""""
		stripped = line.stripped
		return stripped.startswith('#') and not stripped.startswith('#{')
350165
private static boolean itemStackIngredientsMatch(ItemStack A, ItemStack B)
    {
        if (A == null && B == null)
            return true;
        if (A == null || B == null)
            return false;
        if (A.getMetadata() == OreDictionary.WILDCARD_VALUE || B.getMetadata() == OreDictionary.WILDCARD_VALUE)
            return A.getItem() == B.getItem();
        return ItemStack.areItemsEqual(A, B);
    }
232272
def _get_matching(self, reltype, target, is_external=False):
        
        def matches(rel, reltype, target, is_external):
            if rel.reltype != reltype:
                return False
            if rel.is_external != is_external:
                return False
            rel_target = rel.target_ref if rel.is_external else rel.target_part
            if rel_target != target:
                return False
            return True

        for rel in self.values():
            if matches(rel, reltype, target, is_external):
                return rel
        return None
1317344
def checkCalledInside(classname, stack):
    
    ok = False
    for s in stack[1:]:
        cc = s.code_context[0]
        if 'class' in cc:
            if '(' in cc:
                bases = [b.strip() for b in cc.split('(')[1].split(')')[0].split(',')]
                for base_name in bases:
                    if base_name in s.frame.f_globals:
                        base = s.frame.f_globals[base_name]
                        for cls in base.__class__.mro(base):
                            if cls.__name__ == classname:
                                ok = True
                                break
                        if ok:
                            break
                if ok:
                    break
    if not ok:
        name = stack[0].function
        raise SyntaxError('%s not called inside a class inheriting from LocalNameManager' % name)
896554
function isBlacklisted(moduleId)
{
  var i;

  // strip basePath
  moduleId = moduleId.replace(this.basePathRegexp, '');

  for (i = 0; i < this.blackList.length; i++)
  {
    if (minimatch(moduleId, this.blackList[i]))
    {
      return true;
    }
  }

  return false;
}
613843
private boolean reachable(ILexNameToken sought, LexNameSet nextset,
		Map<ILexNameToken, LexNameSet> dependencies, Stack<ILexNameToken> stack)
	{
		if (nextset == null)
		{
			return false;
		}
		
		if (nextset.contains(sought))
		{
			stack.push(sought);
			return true;
		}
		
		for (ILexNameToken nextname: nextset)
		{
			if (stack.contains(nextname))	// Been here before!
			{
				return false;
			}
			
			stack.push(nextname);
			
			if (reachable(sought, dependencies.get(nextname), dependencies, stack))
			{
				return true;
			}
			
			stack.pop();
		}
		
		return false;
    }
660790
private static Method getStackTraceElementGetter() {
		try {
			Method method = Throwable.class.getDeclaredMethod("getStackTraceElement", int.class);
			method.setAccessible(true);
			StackTraceElement stackTraceElement = (StackTraceElement) method.invoke(new Throwable(), 0);
			if (LegacyJavaRuntime.class.getName().equals(stackTraceElement.getClassName())) {
				return method;
			} else {
				return null;
			}
		} catch (Exception ex) {
			return null;
		}
	}
917175
private boolean isApplicationError(Throwable rootEx, String pkgRoot) {
        
        if (rootEx != null) {
            StackTraceElement[] stackTrace = rootEx.getStackTrace();
            if (stackTrace != null && stackTrace.length > 0) {
                StackTraceElement rootThrower = stackTrace[0];
                String className = rootThrower.getClassName();
                if (className != null && !!!className.startsWith(pkgRoot)) {
                    return true;
                }
            }
        }
        
        return false;
    }