the field member matching name, or None if no such field is found
437949
def get_field_by_name(self, name):
        

        for f in self.fields:
            if f.get_name() == name:
                return f
        return None
112658
def input_has_value(step, field_name, value):
    
    with AssertContextManager(step):
        text_field = find_any_field(world.browser,
                                    DATE_FIELDS + TEXT_FIELDS,
                                    field_name)
        assert_false(step, text_field is False,
                     'Can not find a field named "%s"' % field_name)
        assert_equals(text_field.get_attribute('value'), value)
164525
def match(self, name):
        
        for pat in self.pats:
            if fnmatch.fnmatch(name, pat):
                return True

        return False
1024679
def is_not_none(entity, prop, name):
    ""
    return is_not_empty(entity, prop, name) and name in entity._data and getattr(entity, name) is not None
368103
def get_field(self, field_name):
        """"""
        for attr_name, field in self:
            if field_name == attr_name:
                return field

        raise errors.FieldNotFound('Field not found', field_name)
103720
def has_field(mc, field_name):
    
    try:
        mc._meta.get_field(field_name)
    except FieldDoesNotExist:
        return False
    return True
951910
function nameValMatch(definedNameVals, lookupKey) {
    var keys = _.keys(definedNameVals),
        key,
        index;
    for (index in keys) {
        key = keys[index];
        if (key === lookupKey) {
            return {
                matchedWith: lookupKey,
                match: definedNameVals[key]
            };
        } else if (!definedNameVals[key].matchKeyCase && (key.toUpperCase() === (lookupKey.toUpperCase()))) {
            return {
                matchedWith: key,
                match: definedNameVals[key]
            };
        }
    }
    return null;
}
1056845
def has_field(self, dotted_name):
        
        parts = dotted_name.split('.')
        cur_layer = self
        for part in parts:
            if part in cur_layer.field_names:
                cur_layer = cur_layer.get_field(part)
            else:
                return False
        return True
701525
def namedb_name_fields_check( name_rec ):
    

    if not name_rec.has_key('name'):
        raise Exception("BUG: name record has no name")

    # extract namespace ID if it's not already there 
    if not name_rec.has_key('namespace_id'):
        name_rec['namespace_id'] = get_namespace_from_name( name_rec['name'] )

    # extract name_hash if it's not already there 
    if not name_rec.has_key('name_hash128'):
        name_rec['name_hash128'] = hash256_trunc128( name_rec['name'] )

    return True
1227944
def find_field(ctx, search, by_type, obj):
    """"""

    # TODO: Fix this to work recursively on all possible subschemes
    if search is not None:
        search = search
    else:
        search = _ask("Enter search term")

    database = ctx.obj['db']

    def find(search_schema, search_field, find_result=None, key=""):
        """Examine a schema to find fields by type or name"""

        if find_result is None:
            find_result = []
        fields = search_schema['properties']
        if not by_type:
            if search_field in fields:
                find_result.append(key)
                # log("Found queried fieldname in ", model)
        else:
            for field in fields:
                try:
                    if "type" in fields[field]:
                        # log(fields[field], field)
                        if fields[field]["type"] == search_field:
                            find_result.append((key, field))
                            # log("Found field", field, "in", model)
                except KeyError as e:
                    log("Field access error:", e, type(e), exc=True,
                        lvl=debug)

        if 'properties' in fields:
            # log('Sub properties checking:', fields['properties'])
            find_result.append(find(fields['properties'], search_field,
                                    find_result, key=fields['name']))

        for field in fields:
            if 'items' in fields[field]:
                if 'properties' in fields[field]['items']:
                    # log('Sub items checking:', fields[field])
                    find_result.append(find(fields[field]['items'], search_field,
                                            find_result, key=field))
                else:
                    pass
                    # log('Items without proper definition!')

        return find_result

    if obj is not None:
        schema = database.objectmodels[obj]._schema
        result = find(schema, search, [], key="top")
        if result:
            # log(args.object, result)
            print(obj)
            pprint(result)
    else:
        for model, thing in database.objectmodels.items():
            schema = thing._schema

            result = find(schema, search, [], key="top")
            if result:
                print(model)
                # log(model, result)
                print(result)
230117
def getmember(self, name):
        '''
        
        '''
        members = self.getmembers()
        for m in members[::-1]:
            if m.name == name:
                return m

        raise KeyError("member %s could not be found" % name)
3002
def check(self, obj, value, errors):
        
        fieldname = "%s.%s" % (type(obj).__name__, self._name)

        if value is None:
            if not self._null:
                errors.append("%s may not be 'null'" % fieldname)

            # If None, just leave. The rest of checks don't make any sense.
            return

        for has_error in [self._has_wrong_type, self._has_wrong_length,
                          self._is_not_one_of, self._has_subproblems]:
            if has_error(fieldname, value, errors):
                break
46552
def selector(self, fieldname):
        """"""
        finder = self._finders[fieldname]
        return (finder._by, finder._selector)
1163836
def get_field_by_name(self, name):
        '''
        
        '''
        if name in self._fields_dict:
            return self._fields_dict[name]
        raise KittyException('field named (%s) was not found in (%s)' % (self, name))
1363957
def get_field_from_model_by_name(model_class, field_name):
    
    return first_match(lambda x: x if x.name == field_name else None, model_class._meta.fields)
1089858
private boolean matchesField(Format.Field attribute, int field) {
        if (this.attribute != null) {
            return this.attribute.equals(attribute);
        }
        return (field == this.field);
    }
1316090
def has_field(idx, name = nil, opts={})
      set_index_for(name, idx) if name
      set_field_attributes(idx, { :name => name,
                                  :type => opts[:type] || :string,
                                  :default => opts[:default]})

      @field_count ||= 0
      @field_count = [@field_count, idx].max

      return unless name

      define_method :"#{name}=" do |val|
        @fields ||= {}
        @fields[idx] = val
      end

      define_method :"#{name}" do
        field_attrs = self.class.get_field_attributes(idx)
        val = (@fields || {})[idx]
        converter = CONVERSION_WRITER[field_attrs[:type]] if field_attrs
        val = converter.call(val) if converter
        val
      end
    end