Return all fields of a specific class

            :param class_name: the class name
            :type class_name: string

            :rtype: a list with :class:`EncodedField` objects
778474
def get_fields_class(self, class_name):
        
        l = []
        for i in self.classes.class_def:
            for j in i.get_fields():
                if class_name == j.get_class_name():
                    l.append(j)

        return l
476621
def _get_classes_to_inspect(self):
        
        return tuple(filter(lambda c:
                      SerializableMixIn._get_version(c, require=False) or
                      (SerializableMixIn._get_serialize_fields(c) or
                       SerializableMixIn._get_interpolation_map(c)),
                      self.__class__.__mro__))
592180
def _get_fields(attrs, field_class, pop=False, ordered=False):
    
    fields = [
        (field_name, field_value)
        for field_name, field_value in iteritems(attrs)
        if is_instance_or_subclass(field_value, field_class)
    ]
    if pop:
        for field_name, _ in fields:
            del attrs[field_name]
    if ordered:
        fields.sort(key=lambda pair: pair[1]._creation_index)
    return fields
103801
public static String getFieldNameByType(Class<?> classType, Class<?> fieldType) {
		Field[] declaredFields = classType.getDeclaredFields();
		for (Field field : declaredFields) {
			if (field.getType().isAssignableFrom(fieldType)) {
				return field.getName();
			}
		}
		if (classType.getSuperclass() != null) {
			return getFieldNameByType(classType.getSuperclass(), fieldType);
		}
		return null;
	}
1264383
def get_fields(self):
        

        fields = self.Meta.fields
        exclude = self.Meta.exclude
        ignore_fields = self.Meta.ignore_fields
        indices = self.Meta.index_classes

        declared_fields = copy.deepcopy(self._declared_fields)
        prefix_field_names = len(indices) > 1
        field_mapping = OrderedDict()

        # overlapping fields on multiple indices is supported by internally prefixing the field
        # names with the index class to which they belong or, optionally, a user-provided alias
        # for the index.
        for index_cls in self.Meta.index_classes:
            prefix = ""
            if prefix_field_names:
                prefix = "_%s__" % self._get_index_class_name(index_cls)
            for field_name, field_type in six.iteritems(index_cls.fields):
                orig_name = field_name
                field_name = "%s%s" % (prefix, field_name)

                # Don't use this field if it is in `ignore_fields`
                if orig_name in ignore_fields or field_name in ignore_fields:
                    continue
                # When fields to include are decided by `exclude`
                if exclude:
                    if orig_name in exclude or field_name in exclude:
                        continue
                # When fields to include are decided by `fields`
                if fields:
                    if orig_name not in fields and field_name not in fields:
                        continue

                # Look up the field attributes on the current index model,
                # in order to correctly instantiate the serializer field.
                model = index_cls().get_model()
                kwargs = self._get_default_field_kwargs(model, field_type)
                kwargs['prefix_field_names'] = prefix_field_names
                field_mapping[field_name] = self._field_mapping[field_type](**kwargs)

        # Add any explicitly declared fields. They *will* override any index fields
        # in case of naming collision!.
        if declared_fields:
            for field_name in declared_fields:
                field_mapping[field_name] = declared_fields[field_name]
        return field_mapping
786573
def typed_fields(cls):
        """"""

        # Checking cls._typed_fields could return a superclass _typed_fields
        # value. So we check our class __dict__ which does not include
        # inherited attributes.
        klassdict = cls.__dict__

        try:
            return klassdict["_typed_fields"]
        except KeyError:
            fields = cls.typed_fields_with_attrnames()
            cls._typed_fields = tuple(field for _, field in fields)
        return cls._typed_fields
1006612
def get_class(self, name):
        
        for i in self.classes.class_def:
            if i.get_name() == name:
                return i
        return None
714224
def get_class(self, name):
        
        for i in self.get_classes():
            if i.get_name() == name:
                return i
        return None
1272354
def get_declared_fields(mcs, klass, cls_fields, inherited_fields, dict_cls):
        
        opts = klass.opts
        converter = opts.model_converter(schema_cls=klass)
        base_fields = _BaseModelSerializerMetaclass.get_declared_fields(
            klass, cls_fields, inherited_fields, dict_cls)
        declared_fields = mcs.get_fields(converter, opts, base_fields, dict_cls)
        if declared_fields is not None:  # prevents sphinx from blowing up
            declared_fields.update(base_fields)
        return declared_fields
947609
def _class_tags(cls):  # pylint: disable=no-self-argument
        
        class_tags = set()

        for base in cls.mro()[1:]:  # pylint: disable=no-member
            class_tags.update(getattr(base, '_class_tags', set()))

        return class_tags
224850
def get_class_variables(cls):
    
    return [
        target
        for node in cls.body
        if isinstance(node, ast.Assign)
        for target in node.targets
    ]
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
1224292
def get_field_class(qs, field_name):
    
    try:
        return qs.model._meta.get_field(field_name).__class__.__name__
    # while annotating, it's possible that field does not exists.
    except FieldDoesNotExist:
        return None
501527
public static Field[] getAllFields(Class<?> clazz) {
        if (clazz == null) {
            throw new IllegalArgumentException("You must specify the class that contains the fields");
        }
        Set<Field> fields = new LinkedHashSet<Field>();

        Class<?> thisType = clazz;

        while (thisType != null) {
            final Field[] declaredFields = thisType.getDeclaredFields();
            for (Field field : declaredFields) {
                field.setAccessible(true);
                fields.add(field);
            }
            thisType = thisType.getSuperclass();
        }
        return fields.toArray(new Field[fields.size()]);
    }
1210513
def get_field_name(self, field):
        
        for field_name, f in self.fields.items():
            if f == field:
                return field_name
        raise AttributeError("Field %s does not exists in %s resource" % (
            field, self.__class__))
1353952
public static Set<Field> getAllFields(Class<?> classs) {
    Set<Field> set = new HashSet<>();
    Class<?> c = classs;
    while (c != null) {
      set.addAll(Arrays.asList(c.getDeclaredFields()));
      c = c.getSuperclass();
    }
    return set;
  }
1177309
def get_fields(self):
        
        for c in self.classes.values():
            for f in c.get_fields():
                yield f