Gets all direct fields of Message Descriptor to FieldMask.
428501
def AllFieldsFromDescriptor(self, message_descriptor):
    """"""
    self.Clear()
    for field in message_descriptor.fields:
      self.paths.append(field.name)
1364049
private static String[] getDefinedFonts(Context ctx, Field[] fields) {
        ArrayList<String> fieldArray = new ArrayList<>();
        for (Field field : fields) {
            if (field.getName().contains("define_font_")) {
                fieldArray.add(getStringResourceByName(ctx, field.getName()));
            }
        }
        return fieldArray.toArray(new String[0]);
    }
1324777
private static List<Field> getAllDeclaredFields(final Class<?> sourceEntity) {
        List<Field> fields = new ArrayList<Field>();
        Class<?> clazz = sourceEntity;
        while (clazz != null) {
            Field[] f = clazz.getDeclaredFields();
            fields.addAll(Arrays.asList(f));
            clazz = clazz.getSuperclass();
        }
        return fields;
    }
954175
def _get_fieldnames(item):
        """"""
        if hasattr(item, "_fldsdefprt"): # Is a GOEnrichmentRecord
            return item.get_prtflds_all()
        if hasattr(item, "_fields"): # Is a namedtuple
            return item._fields
1150421
def get_fields(node, fields_tag="field_list"):
    
    fields_nodes = [c for c in node.children if c.tagname == fields_tag]
    if len(fields_nodes) == 0:
        return {}
    assert len(fields_nodes) == 1, "multiple nodes with tag " + fields_tag
    fields_node = fields_nodes[0]
    fields = [
        {f.tagname: f.rawsource.strip() for f in n.children}
        for n in fields_node.children
        if n.tagname == "field"
    ]
    return {f["field_name"]: f["field_body"] for f in fields}
266036
def getfields(comm):
    
    fields = []
    for field in comm:
        if 'field' in field:
            fields.append(field)
    return fields
1188267
def MapEncoder(field_descriptor):
  
  # Can't look at field_descriptor.message_type._concrete_class because it may
  # not have been initialized yet.
  message_type = field_descriptor.message_type
  encode_message = MessageEncoder(field_descriptor.number, False, False)

  def EncodeField(write, value):
    for key in value:
      entry_msg = message_type._concrete_class(key=key, value=value[key])
      encode_message(write, entry_msg)

  return EncodeField
868846
def _describe_fields(cls):
        
        dispatch_table = {
            'ShortestPathModel': 'sssp',
            'GraphColoringModel': 'graph_coloring',
            'PagerankModel': 'pagerank',
            'ConnectedComponentsModel': 'connected_components',
            'TriangleCountingModel': 'triangle_counting',
            'KcoreModel': 'kcore',
            'DegreeCountingModel': 'degree_count',
            'LabelPropagationModel': 'label_propagation'
        }
        try:
            toolkit_name = dispatch_table[cls.__name__]
            toolkit = _tc.extensions._toolkits.graph.__dict__[toolkit_name]
            return toolkit.get_model_fields({})
        except:
            raise RuntimeError('Model %s does not have fields description' % cls.__name__)
21264
def _get_fields(self, fields, excludes, hotfixes):
        '''
        
        '''
        final_fields = {}
        fields = fields or []
        excludes = excludes or []

        for f in self.model._meta.fields:
            # If the field name is already present, skip
            if f.name in self.fields:
                continue

            # If field is not present in explicit field listing, skip
            if fields and f.name not in fields:
                continue

            # If field is in exclude list, skip
            if excludes and f.name in excludes:
                continue

            # If field is a relation, skip.
            if getattr(f, 'rel'):
                continue

            attr = {'model_attr': f.name}
            if f.has_default():
                attr['null_value'] = f.default

            if f.name in hotfixes:
                attr.update(hotfixes[f.name])

            final_fields[f.name] = django_field_to_index(f, **attr)

        return final_fields
817012
public static List<String> getDeclaredFields(Class<?> baseClass) {

        Method[] methods = baseClass.getMethods();

        List<String> fields = new ArrayList<>();

        for (Method fm : methods) {
            if ((!fm.getName().startsWith(GET_METHOD_PREFIX) && !fm.getName().startsWith(IS_METHOD_PREFIX)) || fm.getParameterCount() != 0) {
                continue;
            }

            String field = getFieldNameFromMethod(fm);
            fields.add(field);
        }
        return fields;
    }
717083
public static Descriptors.FieldDescriptor getFieldDescriptor(final MessageOrBuilder builder, final int fieldNumber) {
        return builder.getDescriptorForType().findFieldByNumber(fieldNumber);
    }
617412
def get_base_fields(msg, prefix='', parse_header=True):
    ''''''
    slots = msg.__slots__
    ret_val = []
    msg_types = dict()
    for i in slots:
        slot_msg = getattr(msg, i)
        if not parse_header and i == 'header':
            continue
        if hasattr(slot_msg, '__slots__'):
                (subs, type_map) = get_base_fields(
                    slot_msg, prefix=prefix + i + '.',
                    parse_header=parse_header,
                )

                for i in subs:
                    ret_val.append(i)
                for k, v in type_map.items():
                    msg_types[k] = v
        else:
            ret_val.append(prefix + i)
            msg_types[prefix + i] = slot_msg
    return (ret_val, msg_types)
1262284
public static Field[] getAllFields(final Class<?> clazz) {
        final List<Field> allFields = new ArrayList<>();
        addFields(allFields, clazz);
        return allFields.toArray(new Field[allFields.size()]);
    }
948547
@Override
    public Map<FieldDescriptor, Object> getAllFields() {
        TreeMap<FieldDescriptor, Object> result = new TreeMap<FieldDescriptor, Object>();
        for (final FieldDescriptor field : metadata.descriptor.getFields()) {
            if (hasField(field)) {
                result.put(field, getField(field));
            }
        }
        return Collections.unmodifiableMap(result);
    }
650689
def get_fields(self):
        
        prefix = getattr(self.Meta, 'source_prefix', '')
        fields = super(ModelSubSerializer, self).get_fields()
        fields_without_prefix = OrderedDict()
        for field_name, field in fields.items():
            if field_name.startswith(prefix):
                # Set real model field name as field's `source` unless the
                # source is already explicitly set, in which case it is
                # probably a method name not the direct field name
                if not field.source:
                    field.source = field_name
                field_name = field_name[len(prefix):]
            fields_without_prefix[field_name] = field
        return fields_without_prefix
1141685
private static FieldRef getExtensionField(FieldDescriptor descriptor) {
    Preconditions.checkArgument(descriptor.isExtension(), "%s is not an extension", descriptor);
    String extensionFieldName = getFieldName(descriptor, false);
    if (descriptor.getExtensionScope() != null) {
      TypeInfo owner = messageRuntimeType(descriptor.getExtensionScope());
      return FieldRef.createPublicStaticField(owner, extensionFieldName, EXTENSION_TYPE);
    }
    // else we have a 'top level extension'
    String containingClass =
        JavaQualifiedNames.getPackage(descriptor.getFile())
            + "."
            + JavaQualifiedNames.getOuterClassname(descriptor.getFile());
    return FieldRef.createPublicStaticField(
        TypeInfo.create(containingClass), extensionFieldName, EXTENSION_TYPE);
  }
890897
private static List<Field> findFields() {
        List<Field> result = new ArrayList<Field>();
        for (Field f : LoadStatistics.class.getFields()) {
            if (Modifier.isPublic(f.getModifiers()) && MultiStageTimeSeries.class.isAssignableFrom(f.getType())
                    && f.getAnnotation(Deprecated.class) == null) {
                result.add(f);
            }
        }
        return result;
    }