Filter classes by comparing two lists.

    :param classes: matrix classes
    :type classes: list
    :param class_name: sub set of classes
    :type class_name : list
    :return: filtered classes as list
193082
def class_filter(classes, class_name):
    
    result_classes = classes
    if isinstance(class_name, list):
        if set(class_name) <= set(classes):
            result_classes = class_name
    return result_classes
515587
def methods_for_class(classname)
      a = raw_data_relative.first.keys.select{|kl,_| kl == classname}.map{|_,meth| meth}.sort
      a.empty? ? nil : a
    end
640848
def match_classes(self, el, classes):
        """"""

        current_classes = self.get_classes(el)
        found = True
        for c in classes:
            if c not in current_classes:
                found = False
                break
        return found
287035
def _next_class(cls):
        
        return next(
            class_
            for class_ in cls.__mro__
            if not issubclass(class_, Multi)
        )
850138
private Class<?>[] getClassList(List<Object> objects) {
        Class<?>[] classes = new Class<?>[objects.size()];
        for (int i = 0; i < objects.size(); i++) {
            classes[i] = objects.get(i).getClass();
        }
        return classes;
    }
1245679
private int getIndexOfClass(List list, Class cls) {
        for (int i = 0; i < list.size(); i++) {
            if (list.get(i).getClass().equals(cls)) {
                return i;
            }
        }
        return -1;
    }
1343301
public static <T> ArrayList<T> filterViews(Class<T> classToFilterBy, Iterable<?> viewList) {
		ArrayList<T> filteredViews = new ArrayList<T>();
		for (Object view : viewList) {
			if (view != null && classToFilterBy.isAssignableFrom(view.getClass())) {
				filteredViews.add(classToFilterBy.cast(view));
			}
		}
		viewList = null;
		return filteredViews;
	}
150971
def find_class_in_list(klass, lst):
    
    filtered = list(filter(lambda x: x.__class__ == klass, lst))
    if filtered:
        return filtered[0]
    return None
401999
public static List<ASTNodePredicate> matchByClass(Class<ASTNode>... classes) {
        ArrayList<ASTNodePredicate> result = new ArrayList<ASTNodePredicate>(classes.length);
        for (final Class<ASTNode> astNodeClass : classes) {
            result.add(new MatchByClass(astNodeClass));
        }
        return result;
    }
296187
def get_methods_class(self, class_name):
        
        l = []
        for i in self.classes.class_def:
            for j in i.get_methods():
                if class_name == j.get_class_name():
                    l.append(j)

        return l
1163050
private List<ClassDocImpl> getClasses(boolean filtered) {
        if (allClasses != null && !filtered) {
            return allClasses;
        }
        if (allClassesFiltered != null && filtered) {
            return allClassesFiltered;
        }
        ListBuffer<ClassDocImpl> classes = new ListBuffer<>();
        for (Symbol enumerated : sym.members().getSymbols(NON_RECURSIVE)) {
            if (enumerated != null) {
                ClassSymbol s = (ClassSymbol)enumerated;
                ClassDocImpl c = env.getClassDoc(s);
                if (c != null && !c.isSynthetic())
                    c.addAllClasses(classes, filtered);
            }
        }
        if (filtered)
            return allClassesFiltered = classes.toList();
        else
            return allClasses = classes.toList();
    }
312806
def subclasses(cls, leaves=False):
    
    stack = [cls]
    subcls = []
    while stack:
        c = stack.pop()
        c_subs = c.__subclasses__()
        stack.extend(c_subs)
        if not leaves or not c_subs:
            subcls.append(c)
    return subcls
86637
public static ArrayList<View> filterViewsToSet(Class<View> classSet[], Iterable<View> viewList) {
		ArrayList<View> filteredViews = new ArrayList<View>();
		for (View view : viewList) {
			if (view == null)
				continue;
			for (Class<View> filter : classSet) {
				if (filter.isAssignableFrom(view.getClass())) {
					filteredViews.add(view);
					break;
				}
			}
		}
		return filteredViews;
	}
1105245
def match_classes(allowed_classes):
    """"""
    cleaned_allowed_classes = [
        utils.cls_to_cls_name(tmp_cls)
        for tmp_cls in allowed_classes
    ]

    def matcher(cause):
        cause_cls = None
        cause_type_name = cause.exception_type_names[0]
        try:
            cause_cls_idx = cleaned_allowed_classes.index(cause_type_name)
        except ValueError:
            pass
        else:
            cause_cls = allowed_classes[cause_cls_idx]
            if not isinstance(cause_cls, type):
                cause_cls = importutils.import_class(cause_cls)
            cause_cls = ensure_base_exception(cause_type_name, cause_cls)
        return cause_cls

    return matcher
264243
def filter(self, callback=None):
        
        if callback:
            return self.__class__(list(filter(callback, self.items)))

        return self.__class__(list(filter(None, self.items)))
316359
def get_methods_class(self, class_name):
        
        l = []
        for i in self.get_classes():
            for j in i.get_methods():
                if class_name == j.get_class_name():
                    l.append(j)

        return l
508823
def __find_child_classes(self, file):
        

        child_classes = []
        folder, name = os.path.split(file)
        name = os.path.splitext(name)[0]

        import imp
        module = imp.load_source(name, file)

        def filter_classes(m):
            if inspect.isclass(m):
                if inspect.getmro(m)[1] == self.__base_class:
                    return True
            return False

        for name, obj in inspect.getmembers(module, filter_classes):
            child_classes.append(obj)

        return child_classes