Create a new EffectCollection containing only effects whose priority
        falls below the given class.
500552
def filter_by_effect_priority(self, min_priority_class):
        
        min_priority = transcript_effect_priority_dict[min_priority_class]
        return self.filter(
            lambda effect: effect_priority(effect) >= min_priority)
627082
public static Method filter(List<Method> methods, Class<?> declareClass) {
        if (declareClass == null) {
            return null;
        }
        Optional<Method> optional = methods.stream()
            .filter(method -> method.getDeclaringClass() == declareClass).limit(1).findFirst();
        return optional.orElse(filter(methods, declareClass.getSuperclass()));
    }
692882
private static void includeAffected(Set<String> allClasses, Set<String> affectedClasses, List<File> sortedFiles) {
        Storer storer = Config.createStorer();
        Hasher hasher = Config.createHasher();

        NameBasedCheck classCheck = Config.DEBUG_MODE_V != Config.DebugMode.NONE ?
            new DebugNameCheck(storer, hasher, DependencyAnalyzer.CLASS_EXT) :
            new NameBasedCheck(storer, hasher, DependencyAnalyzer.CLASS_EXT);
        NameBasedCheck covCheck = new NameBasedCheck(storer, hasher, DependencyAnalyzer.COV_EXT);
        MethodCheck methodCheck = new MethodCheck(storer, hasher);
        String prevClassName = null;
        for (File file : sortedFiles) {
            String fileName = file.getName();
            String dirName = file.getParent();
            String className = null;
            if (file.isDirectory()) {
                continue;
            }
            if (fileName.endsWith(DependencyAnalyzer.COV_EXT)) {
                className = covCheck.includeAll(fileName, dirName);
            } else if (fileName.endsWith(DependencyAnalyzer.CLASS_EXT)) {
                className = classCheck.includeAll(fileName, dirName);
            } else {
                className = methodCheck.includeAll(fileName, dirName);
            }
            // Reset after some time to free space.
            if (prevClassName != null && className != null && !prevClassName.equals(className)) {
                methodCheck.includeAffected(affectedClasses);
                methodCheck = new MethodCheck(Config.createStorer(), Config.createHasher());
            }
            if (className != null) {
                allClasses.add(className);
                prevClassName = className;
            }
        }
        classCheck.includeAffected(affectedClasses);
        covCheck.includeAffected(affectedClasses);
        methodCheck.includeAffected(affectedClasses);
    }
256468
@SuppressWarnings("unchecked")
  private Collection<Object> newCollection(Class<?> type) {
    if (SortedSet.class.isAssignableFrom(type)) return new TreeSet();
    else if (LinkedHashSet.class.isAssignableFrom(type)) return new LinkedHashSet();
    else if (Set.class.isAssignableFrom(type)) return new HashSet();
    else if (List.class.isAssignableFrom(type)) return new ArrayList();
    else {
      throw new ParameterException("Parameters of Collection type '" + type.getSimpleName()
                                  + "' are not supported. Please use List or Set instead.");
    }
  }
369578
public static <E> Collection<E> filterColl(Iterable<E> coll,
					       Predicate<E> pred,
					       Collection<E> newColl) {
	for(E elem : coll) {
	    if(pred.check(elem)) {
		newColl.add(elem);
	    }
	}
	return newColl;
    }
848436
public static List<? extends ExecutableElement> getEffectiveMethods(TypeElement cls)
    {
        List<ExecutableElement> list = new ArrayList<>();
        while (cls != null)
        {
            for (ExecutableElement method : ElementFilter.methodsIn(cls.getEnclosedElements()))
            {
                if (!overrides(list, method))
                {
                    list.add(method);
                }
            }
            cls = (TypeElement) Typ.asElement(cls.getSuperclass());
        }
        return list;
    }
55908
public static <T, U> Collector<T, ?, Optional<U>> min(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
        return collectingAndThen(minBy(function, comparator), t -> t.map(function));
    }
877709
private static List<ClassNode> keepLowestCommonInterfaces(List<ClassNode> fromA, List<ClassNode> fromB) {
        if (fromA==null||fromB==null) return EMPTY_CLASSNODE_LIST;
        Set<ClassNode> common = new HashSet<ClassNode>(fromA);
        common.retainAll(fromB);
        List<ClassNode> result = new ArrayList<ClassNode>(common.size());
        for (ClassNode classNode : common) {
            addMostSpecificInterface(classNode, result);
        }
        return result;
    }
823324
public static void notEmpty(final Collection<?> collection, final String collectionName) {
        notNull(collection, collectionName);

        if (collection.isEmpty()) {
            throw new IllegalArgumentException("expecting " + maskNullArgument(collectionName) + " to contain 1 or more elements");
        }
    }
402276
def FilterCollection(aff4_collection, offset, count=0, filter_value=None):
  """"""

  if offset < 0:
    raise ValueError("Offset needs to be greater than or equal to zero")

  if count < 0:
    raise ValueError("Count needs to be greater than or equal to zero")

  count = count or sys.maxsize
  if filter_value:
    index = 0
    items = []
    for item in aff4_collection.GenerateItems():
      serialized_item = item.SerializeToString()
      if re.search(re.escape(filter_value), serialized_item, re.I):
        if index >= offset:
          items.append(item)
        index += 1

        if len(items) >= count:
          break
  else:
    items = list(itertools.islice(aff4_collection.GenerateItems(offset), count))

  return items
802099
private GinjectorBindings lowest(Set<GinjectorBindings> sources) {
    GinjectorBindings lowest = output.getGraph().getOrigin();
    while (!sources.contains(lowest)) {
      lowest = lowest.getParent();
    }
    return Preconditions.checkNotNull(lowest, "Should never make it to null");
  }
759738
def create_collection_class(collection_name)
      unless class_exists?(collection_name)
        self.const_set(collection_name, Class.new do
          include Foggy::Collection
        end)
      end
    end
265985
void addAllClasses(ListBuffer<ClassDocImpl> l, boolean filtered) {
        try {
            if (isSynthetic()) return;
            // sometimes synthetic classes are not marked synthetic
            if (!JavadocTool.isValidClassName(tsym.name.toString())) return;
            if (filtered && !env.shouldDocument(tsym)) return;
            if (l.contains(this)) return;
            l.append(this);
            List<ClassDocImpl> more = List.nil();
            for (Scope.Entry e = tsym.members().elems; e != null;
                 e = e.sibling) {
                if (e.sym != null && e.sym.kind == Kinds.TYP) {
                    ClassSymbol s = (ClassSymbol)e.sym;
                    ClassDocImpl c = env.getClassDoc(s);
                    if (c.isSynthetic()) continue;
                    if (c != null) more = more.prepend(c);
                }
            }
            // this extra step preserves the ordering from oldjavadoc
            for (; more.nonEmpty(); more=more.tail) {
                more.head.addAllClasses(l, filtered);
            }
        } catch (CompletionFailure e) {
            // quietly ignore completion failures
        }
    }
229190
def items_lower(self):
        '''
        
        '''
        return ((key, val[1]) for key, val in six.iteritems(self._data))
264450
public static <E> Filter<E> collectionAcceptFilter(Collection<E> objs) {
    return new CollectionAcceptFilter<E>(objs, true);
  }
557859
private CollectionDescriptorDef cloneCollection(CollectionDescriptorDef collDef, String prefix)
    {
        CollectionDescriptorDef copyCollDef = new CollectionDescriptorDef(collDef, prefix);

        copyCollDef.setOwner(this);
        // we remove properties that are only relevant to the class the features are declared in
        copyCollDef.setProperty(PropertyHelper.OJB_PROPERTY_IGNORE, null);

        Properties mod = getModification(copyCollDef.getName());

        if (mod != null)
        {
            if (!PropertyHelper.toBoolean(mod.getProperty(PropertyHelper.OJB_PROPERTY_IGNORE), false) &&
                hasFeature(copyCollDef.getName()))
            {
                LogHelper.warn(true,
                               ClassDescriptorDef.class,
                               "process",
                               "Class "+getName()+" has a feature that has the same name as its included collection "+
                               copyCollDef.getName()+" from class "+collDef.getOwner().getName()); 
            }
            copyCollDef.applyModifications(mod);
        }
        return copyCollDef;
    }
1192074
private int adjustPriority(int priority) {

        try {
            Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2();

            if (!subtypes2.hasSubtypes(getClassDescriptor())) {
                priority++;
            } else {
                Set<ClassDescriptor> mySubtypes = subtypes2.getSubtypes(getClassDescriptor());

                String myPackagename = getThisClass().getPackageName();

                for (ClassDescriptor c : mySubtypes) {
                    if (c.equals(getClassDescriptor())) {
                        continue;
                    }
                    if (!c.getPackageName().equals(myPackagename)) {
                        priority--;
                        break;
                    }
                }
            }
        } catch (ClassNotFoundException e) {
            bugReporter.reportMissingClass(e);
        }
        return priority;
    }