Returns the schema for the field on this annotation class whose name matches the provided
name. This method returns null if no field matches.
17601
public FieldSchema getField(String name) {
    for (FieldSchema field : fieldSchemas)
      if (field.getName().equals(name))
        return field;
    return null;
  }
1121730
def field_(self, name):
    
    try:
        field = self.fields[name]
    except KeyError:
        raise KeyError("Key %r not found in '%s'" % (name, self.__class__.__name__))
    return BoundField(self, field, name)
139569
public static Field[] getFieldsIgnoreCase(Class clazz, String name) throws NoSuchFieldException {
	Field[] fields = fStorage.getFields(clazz, name);
	if (fields != null) return fields;
	throw new NoSuchFieldException("there is no field with name " + name + " in object [" + Type.getName(clazz) + "]");
    }
692747
def schema_map(schema):
    """"""
    mapper = {}
    for name in getFieldNames(schema):
        mapper[name] = name
    return mapper
741064
public Map<String, Object> getObjectReferenceMap(String field, String schemaName) {
        List<String> instanceIds = references.get(field);
        if(instanceIds == null || instanceIds.size() == 0) {
            return null;
        }
        Map<String, Object> objects = new HashMap<>();
        for (String instanceId : instanceIds) {
            BeanId id = BeanId.create(instanceId, schemaName);
            Object instance = instances.get(id);
            if(instance != null) {
                objects.put(instanceId, instance);
            } else {
                instance = cache.get(id);
                instances.put(id, instance);
                objects.put(instanceId, instance);
            }
        }
        return objects;
    }
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
1269337
def schema(self):
    
    if not self._schema:
      try:
        self._load_info()
        self._schema = _schema.Schema(self._info['schema']['fields'])
      except KeyError:
        raise Exception('Unexpected table response: missing schema')
    return self._schema
1220825
def _get_schema(name):
  
  item = datalab.utils.commands.get_notebook_item(name)
  if not item:
    item = _get_table(name)

  if isinstance(item, datalab.bigquery.Schema):
    return item
  if hasattr(item, 'schema') and isinstance(item.schema, datalab.bigquery._schema.Schema):
    return item.schema
  return None
269232
def get_field_schema(name, field):
    """"""
    field_schema = {
        'type': 'string',
    }

    if field.label:
        field_schema['title'] = str(field.label)  # force translation

    if field.help_text:
        field_schema['description'] = str(field.help_text)  # force translation

    if isinstance(field, (fields.URLField, fields.FileField)):
        field_schema['format'] = 'uri'
    elif isinstance(field, fields.EmailField):
        field_schema['format'] = 'email'
    elif isinstance(field, fields.DateTimeField):
        field_schema['format'] = 'date-time'
    elif isinstance(field, fields.DateField):
        field_schema['format'] = 'date'
    elif isinstance(field, (fields.DecimalField, fields.FloatField)):
        field_schema['type'] = 'number'
    elif isinstance(field, fields.IntegerField):
        field_schema['type'] = 'integer'
    elif isinstance(field, fields.NullBooleanField):
        field_schema['type'] = 'boolean'
    elif isinstance(field.widget, widgets.CheckboxInput):
        field_schema['type'] = 'boolean'

    if getattr(field, 'choices', []):
        field_schema['enum'] = sorted([choice[0] for choice in field.choices])

    # check for multiple values
    if isinstance(field.widget, (widgets.Select, widgets.ChoiceWidget)):
        if field.widget.allow_multiple_selected:
            # promote to array of <type>, move details into the items field
            field_schema['items'] = {
                'type': field_schema['type'],
            }
            if 'enum' in field_schema:
                field_schema['items']['enum'] = field_schema.pop('enum')
            field_schema['type'] = 'array'

    return field_schema
692009
def getSchema(cls):
        
        schema = []
        for name, atr in cls.__attributes__:
            atr = atr.__get__(None, cls)
            if isinstance(atr, SQLAttribute):
                schema.append((name, atr))
        cls.getSchema = staticmethod(lambda schema=schema: schema)
        return schema
863725
def _compile_schema(self, schema):
        
        assert self.matcher == schema.matcher

        self.name = schema.name
        self.compiled_type = schema.compiled_type

        return schema.compiled
163742
public MappedField getMappedFieldByJavaField(final String name) {
        for (final MappedField mf : persistenceFields) {
            if (name.equals(mf.getJavaFieldName())) {
                return mf;
            }
        }

        return null;
    }
778077
public AnnSchema getSchema(final Class<? extends Ann> klass) {
    for (AnnSchema ann : annSchemas)
      if (ann.getKlass().equals(klass))
        return ann;
    return null;
  }
1003966
def schema(self):
        
        if self.key_type is None:
            return "%s %s" % (self.name, self.data_type)
        else:
            return "%s %s %s KEY" % (self.name, self.data_type, self.key_type)
620377
Schema schema() {
    if (schema == null) {
      synchronized (this) {
        if (schema == null) {
          schema = new Schema(datasource, context, strictTraceId);
        }
      }
    }
    return schema;
  }
1150904
public Field field(String name) {
    for (Field field : declaredFields) {
      if (field.name().equals(name)) {
        return field;
      }
    }
    for (OneOf oneOf : oneOfs) {
      for (Field field : oneOf.fields()) {
        if (field.name().equals(name)) {
          return field;
        }
      }
    }
    return null;
  }
679656
Field getField(String name)
    {       
        FieldInfo info=getFieldInfo(name);
        return getField(info,true);
    }