Returns type and all classes that derive from it, in the order of their distance from type.
964108
def all_derived (type):
    
    assert isinstance(type, basestring)
    result = [type]
    for d in __types [type]['derived']:
        result.extend (all_derived (d))

    return result
613941
private static List<Field> getAllFields(Class type) {
		final List<Field> fields = new ArrayList<>();
		for (Class<?> c = type; c != null; c = c.getSuperclass()) {
			fields.addAll(Arrays.asList(c.getDeclaredFields()));
		}
		return fields;
	}
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;
    }
991122
def _typelist(x):
    """"""
    if isinstance(x, collections.Sequence):
        return list(map(_to_instance, x))
    elif isinstance(x, collections.Iterable):
        return x
    return None if x is None else [_to_instance(x)]
1212111
def _all_classes(self, classes):
        
        all_classes = {}

        def recurse(cls):
            all_classes[cls] = None
            for c in cls.__bases__:
                if c not in all_classes:
                    recurse(c)

        for cls in classes:
            recurse(cls)

        return all_classes.keys()
1184822
private static Class<?> extractGeneric(Type type) {
        if (type instanceof ParameterizedType) {
            Type[] genericTypes = ((ParameterizedType) type).getActualTypeArguments();
            if (genericTypes.length > 0 && genericTypes[0] instanceof Class) {
                return (Class<?>) genericTypes[0];
            }
        }
        return Object.class;
    }
1261426
def of_type(cls, iterable, types):
    

    return cls(x for x in iterable if isinstance(x, types))
955482
private static List<ClasspathElement> orderClasspathElements(
            final Collection<Entry<Integer, ClasspathElement>> classpathEltsIndexed) {
        final List<Entry<Integer, ClasspathElement>> classpathEltsIndexedOrdered = new ArrayList<>(
                classpathEltsIndexed);
        CollectionUtils.sortIfNotEmpty(classpathEltsIndexedOrdered, INDEXED_CLASSPATH_ELEMENT_COMPARATOR);
        final List<ClasspathElement> classpathEltsOrdered = new ArrayList<>(classpathEltsIndexedOrdered.size());
        for (final Entry<Integer, ClasspathElement> ent : classpathEltsIndexedOrdered) {
            classpathEltsOrdered.add(ent.getValue());
        }
        return classpathEltsOrdered;
    }
1266327
def klass_for_type(type, singular=false)
      type = type.singularize unless singular
      type.classify.constantize
    end
1268353
def get_ancestors(self):
        
        if self.is_root():
            return get_result_class(self.__class__).objects.none()

        paths = [
            self.path[0:pos]
            for pos in range(0, len(self.path), self.steplen)[1:]
        ]
        return get_result_class(self.__class__).objects.filter(
            path__in=paths).order_by('depth')
1241170
private static Class<?>[] getTypes(final Object... args) {
    final Class<?>[] argTypes = new Class<?>[args.length];
    for (int i = 0; i < argTypes.length; i++) {
      argTypes[i] = args[i].getClass();
    }
    return argTypes;
  }
944417
public List<String> getClasses() {
    	String classAttr = getAttribute("class");
    	return Stream.of((classAttr == null ? "" : classAttr).trim().split("\\s+")).distinct().sorted().collect(Collectors.toList());
    }
901471
def getTypeDefinition(cls, namespaceURI, name, lazy=False):
        ''' 
        '''
        klass = cls.types.get((namespaceURI, name), None)
        if lazy and klass is not None:
            return _Mirage(klass)
        return klass
391698
protected List<TypeName> getExtractedTypes(TypeName permutationType, TypeName paramType) {
    return match(permutationType)
        .when(typeOf(ParameterizedTypeName.class)).get(
            t -> {
              if (isDecomposableBuilder(t.rawType)) {
                return t.typeArguments.subList(1, t.typeArguments.size());
              } else if (t.rawType.equals(MATCH_ANY)) {
                return ImmutableList.of(paramType);
              } else {
                return Collections.<TypeName>emptyList();
              }
            })
        .when(typeOf(TypeVariableName.class)).get(t -> ImmutableList.of())
        .when(typeOf(ClassName.class)).get(t -> ImmutableList.of(paramType))
        .orElse(t -> ImmutableList.of(t))
        .getMatch();
  }
748782
def _get_types(type_):
    

    return list(
        itertools.chain.from_iterable(
            map(lambda x: TYPE_MAPPINGS[x].get(type_, []), TYPE_MAPPINGS)
        )
    )
989169
public <T> List<T> dataToTypedList(Class<T> type) {
        return Reflection.toTypedList(data, type);
    }
1317162
def get_class_hierarchy(self, base_class):
        
        classes = [base_class]
        while classes[-1] is not None and classes[-1] != "java.lang.Object":
            classes.append(self.get_superclass(classes[-1]))
        return classes[:-1]