Returns the :class:`DocField` field for the given name
544898
def get_field(self, name):
        
        try:
            return dict.__getitem__(self, name)
        except KeyError as err:
            raise SchemaError("'%s' is not a document field (existing attributes are: %s)" % (err, list(self)))
1222974
def get_field(self, name):
        
        # TODO could use a generator here
        prog = re.compile(name)
        l = []
        for i in self.get_classes():
            for j in i.get_fields():
                if prog.match(j.get_name()):
                    l.append(j)
        return l
1309468
def get_class_field(cls, field_name):
        
        if not cls.has_field(field_name):
            raise AttributeError('"%s" is not a field for the model "%s"' %
                                 (field_name, cls.__name__))

        field = getattr(cls, '_redis_attr_%s' % field_name)

        return field
978848
def get_field_embedded_doc(node):
    """"""

    definition = get_field_definition(node)
    cls_name = definition.last_child().last_child()
    cls = next(cls_name.infer())
    return cls
306455
def __list_fields(cls):
        
        for name in cls._doc_type.mapping:
            field = cls._doc_type.mapping[name]
            yield name, field, False

        if hasattr(cls.__class__, '_index'):
            if not cls._index._mapping:
                return
            for name in cls._index._mapping:
                # don't return fields that are in _doc_type
                if name in cls._doc_type.mapping:
                    continue
                field = cls._index._mapping[name]
                yield name, field, True
1167389
def get_composite_field_value(self, name):
        
        field = self.composite_fields[name]
        if hasattr(field, 'get_form'):
            return self.forms[name]
        if hasattr(field, 'get_formset'):
            return self.formsets[name]
119609
private static Field getLabelField(final String name) {
        try {
            Field f = Label.class.getDeclaredField(name);
            f.setAccessible(true);
            return f;
        } catch (NoSuchFieldException e) {
            return null;
        }
    }
1118881
def get_method_returning_field_value(self, field_name):
        
        method = getattr(self, field_name, None)
        return method if method and callable(method) else None
250269
def get_field_mro(cls, field_name):
    """"""
    res = set()
    if hasattr(cls, '__mro__'):
        for _class in inspect.getmro(cls):
            values_ = getattr(_class, field_name, None)
            if values_ is not None:
                res = res.union(set(make_list(values_)))
    return res
1322966
def _resolve_to_field_class(self, names, scope):
        
        switch = {
            "char"    : "Char",
            "int"     : "Int",
            "long"    : "Int",
            "int64"   : "Int64",
            "uint64"  : "UInt64",
            "short"   : "Short",
            "double"  : "Double",
            "float"   : "Float",
            "void"    : "Void",
            "string"  : "String",
            "wstring" : "WString"
        }

        core = names[-1]
        
        if core not in switch:
            # will return a list of resolved names
            type_info = scope.get_type(core)
            if type(type_info) is type and issubclass(type_info, fields.Field):
                return type_info
            resolved_names = type_info
            if resolved_names is None:
                raise errors.UnresolvedType(self._coord, " ".join(names), " ")
            if resolved_names[-1] not in switch:
                raise errors.UnresolvedType(self._coord, " ".join(names), " ".join(resolved_names))
            names = copy.copy(names)
            names.pop()
            names += resolved_names
        
        if len(names) >= 2 and names[-1] == names[-2] and names[-1] == "long":
            res = "Int64"
        else:        
            res = switch[names[-1]]

        if names[-1] in ["char", "short", "int", "long"] and "unsigned" in names[:-1]:
            res = "U" + res

        cls = getattr(fields, res)
        return cls
1192867
def hasField(self, name):
        
        if self._autoFixNames:
            name = self._fixName(name)
        return self._fieldAttrDict.has_key(name)
1081689
def get_model_field(model, field_name):
    
    meta = model._meta
    try:
        if DJANGO19:
            field = meta.get_field(field_name)
        else:
            field = meta.get_field_by_name(field_name)[0]
        return field
    except:
        if DJANGO19:
            related_objs = (
                f for f in meta.get_fields()
                if (f.one_to_many or f.one_to_one)
                and f.auto_created and not f.concrete
            )
            related_m2m_objs = (
                f for f in meta.get_fields(include_hidden=True)
                if f.many_to_many and f.auto_created
            )
        else:
            related_objs = meta.get_all_related_objects()
            related_m2m_objs = meta.get_all_related_many_to_many_objects()

        related_objects = {
            o.get_accessor_name(): o
            for o in chain(related_objs, related_m2m_objs)
        }
        if field_name in related_objects:
            return related_objects[field_name]
        else:
            # check virtual fields (1.7)
            if hasattr(meta, 'virtual_fields'):
                for field in meta.virtual_fields:
                    if field.name == field_name:
                        return field

            raise AttributeError(
                '%s is not a valid field for %s' % (field_name, model)
            )
173716
def _get_field_by_name(table: LdapObjectClass, name: str) -> tldap.fields.Field:
    
    fields = table.get_fields()
    return fields[name]
67771
def _get_field_by_name(model_class, field_name):
    
    field = model_class._meta.get_field(field_name)
    return (
        field,                                       # field
        field.model,                                 # model
        not field.auto_created or field.concrete,    # direct
        field.many_to_many                           # m2m
    )
755507
public Field getField(String name) {
    if (fieldMap == null) {
      return null;
    }
    return fieldMap.get(name);
  }
601
def get_field_label(self, field_name, field=None):
        
        label = None
        if field is not None:
            label = getattr(field, 'verbose_name', None)
            if label is None:
                label = getattr(field, 'name', None)
        if label is None:
            label = field_name
        return label.capitalize()
352330
def get_pattern(self, field_name):
        
        return re.compile(self.raw_pattern.replace(r'\w+', field_name), re.VERBOSE)