Return all superclasses for a given class.
427029
def superclasses(klass)
      super_classes = []
      while klass != Object
        klass = klass.superclass
        super_classes << klass
      end
      super_classes
    end
126466
def find_subclass(cls, name):
        """"""
        if name == cls.__name__:
            return cls
        for sc in cls.__sub_classes__:
            r = sc.find_subclass(name)
            if r != None:
                return r
427263
def EMetaclass(cls):
    """"""
    superclass = cls.__bases__
    if not issubclass(cls, EObject):
        sclasslist = list(superclass)
        if object in superclass:
            index = sclasslist.index(object)
            sclasslist.insert(index, EObject)
            sclasslist.remove(object)
        else:
            sclasslist.insert(0, EObject)
        superclass = tuple(sclasslist)
    orig_vars = cls.__dict__.copy()
    slots = orig_vars.get('__slots__')
    if slots is not None:
        if isinstance(slots, str):
            slots = [slots]
        for slots_var in slots:
            orig_vars.pop(slots_var)
    orig_vars.pop('__dict__', None)
    orig_vars.pop('__weakref__', None)
    return MetaEClass(cls.__name__, superclass, orig_vars)
709215
def _getSuitableClasses(self, data):
        """"""
        classes = None
        if data[EI.CLASS] == ELFCLASS.BITS_32:
            if data[EI.DATA] == ELFDATA.LSB:
                classes = LSB_32
            elif data[EI.DATA] == ELFDATA.MSB:
                classes = MSB_32

        elif data[EI.CLASS] == ELFCLASS.BITS_64:
            if data[EI.DATA] == ELFDATA.LSB:
                classes = LSB_64
            elif data[EI.DATA] == ELFDATA.MSB:
                classes = MSB_64

        return classes
1210019
def get_proxy_ancestor_classes(klass):
    
    proxy_ancestor_classes = set()
    for superclass in klass.__bases__:
        if hasattr(superclass, '_meta') and superclass._meta.proxy:
            proxy_ancestor_classes.add(superclass)
        proxy_ancestor_classes.update(
            get_proxy_ancestor_classes(superclass))
    return proxy_ancestor_classes
1060241
public static Class<?>[] getAllSuperClasses(Class<?> clz) {
    List<Class<?>> list = new ArrayList<>();
    while ((clz = clz.getSuperclass()) != null) {
      list.add(clz);
    }
    return list.toArray(new Class<?>[list.size()]);
  }
1229664
def visit_class(rec, cls, op):
    # type: (Any, Iterable, Union[Callable[..., Any], partial[Any]]) -> None
    """"""

    if isinstance(rec, MutableMapping):
        if "class" in rec and rec.get("class") in cls:
            op(rec)
        for d in rec:
            visit_class(rec[d], cls, op)
    if isinstance(rec, MutableSequence):
        for d in rec:
            visit_class(d, cls, op)
668889
public static List<Class<?>> getAllClasses(Class<?> clazz) {
        List<Class<?>> types = new ArrayList<>();
        while (clazz != null) {
            types.add(clazz);
            clazz = clazz.getSuperclass();
        }
        return types;
    }
647656
public static <T> Set<Class<? extends T>> getNonAbstractSubclasses(Class<T> clazz) {
        return ClassGraphUtil/*TraverseClasspath*/.getNonAbstractSubClasses(clazz);
    }
1016846
def root_classes(self) -> Set[OntologyClass]:
        
        return set(filter(lambda e: not e.super_classes(), self.classes))
522329
def _subclassed(base, *classes):
        
        return all(map(lambda obj: isinstance(obj, base), classes))
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
1351709
public ClassInfoList getSubclasses(final String superclassName) {
        if (closed.get()) {
            throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
        }
        if (!scanSpec.enableClassInfo) {
            throw new IllegalArgumentException("Please call ClassGraph#enableClassInfo() before #scan()");
        }
        if (superclassName.equals("java.lang.Object")) {
            // Return all standard classes (interfaces don't extend Object)
            return getAllStandardClasses();
        } else {
            final ClassInfo superclass = classNameToClassInfo.get(superclassName);
            return superclass == null ? ClassInfoList.EMPTY_LIST : superclass.getSubclasses();
        }
    }
321870
def classes(p: ecore.EPackage):
        """"""
        classes = (c for c in p.eClassifiers if isinstance(c, ecore.EClass))
        return sorted(classes, key=lambda c: len(set(c.eAllSuperTypes())))
157969
public static Set<Class<?>> commonSuperclasses(Iterable<Class<?>> classes) {
        Iterator<Class<?>> it = classes.iterator();
        if (!it.hasNext()) {
            return Collections.emptySet();
        }
        // begin with set from first hierarchy
        Set<Class<?>> result = getSuperclasses(it.next());
        // remove non-superclasses of remaining
        while (it.hasNext()) {
            Class<?> c = it.next();
            Iterator<Class<?>> resultIt = result.iterator();
            while (resultIt.hasNext()) {
                Class<?> sup = resultIt.next();
                if (!sup.isAssignableFrom(c)) {
                    resultIt.remove();
                }
            }
        }
        return result;
    }
528113
def superclasses_bug_fix(data):
    '''  '''
    for i, value in enumerate(data['superclasses']):
        data['superclasses'][i]['superclass_tid'] = data['superclasses'][i].pop('id')
    return data
1205844
def classes(
            self,
            name=None,
            function=None,
            header_dir=None,
            header_file=None,
            recursive=None,
            allow_empty=None):
        """"""
        return (
            self._find_multiple(
                self._impl_matchers[scopedef_t.class_],
                name=name,
                function=function,
                decl_type=self._impl_decl_types[
                    scopedef_t.class_],
                header_dir=header_dir,
                header_file=header_file,
                recursive=recursive,
                allow_empty=allow_empty)
        )