Apply a function to mapping with 'field'.
8367
def visit_field(rec, field, op):
    # type: (Any, Iterable, Union[Callable[..., Any], partial[Any]]) -> None
    """"""

    if isinstance(rec, MutableMapping):
        if field in rec:
            rec[field] = op(rec[field])
        for d in rec:
            visit_field(rec[d], field, op)
    if isinstance(rec, MutableSequence):
        for d in rec:
            visit_field(d, field, op)
158359
def _create_mappings(self, spec):
        
        ret = dict(zip(set(spec.fields), set(spec.fields)))
        ret.update(dict([(n, s.alias) for n, s in spec.fields.items() if s.alias]))
        return ret
722590
def _build_field_type_map(base_class):
    """"""
    mapping = {}

    for cls in _get_recursive_subclasses(base_class):
        if cls.field_type:
            if isinstance(cls.field_type, tuple):
                for field_type in cls.field_type:
                    mapping[field_type] = cls
            elif isinstance(cls.field_type, _string_types):
                mapping[cls.field_type] = cls
            else:
                raise ValueError('Field type must be str or tuple, cannot understand type "{}" on class "{}"'.format(
                    type(cls.field_type),
                    cls
                ))

    return mapping
354385
def hset(self, key, field, value):
        """"""
        return self.execute(b'HSET', key, field, value)
392475
def mutapply(self, function, fieldname):
        
        self[fieldname] = self.apply(function, fieldname)
569950
def _create_mapping(self, func, switch):
        """"""
        mapping = {}
        for feature in self.data['features']:
            content = func(feature)
            if switch == 'style':
                for key, value in content.items():
                    if isinstance(value, MacroElement):
                        # Make sure objects are rendered:
                        if value._parent is None:
                            value._parent = self.geojson_obj
                            value.render()
                        # Replace objects with their Javascript var names:
                        content[key] = "{{'" + value.get_name() + "'}}"
            key = self._to_key(content)
            mapping.setdefault(key, []).append(self.get_feature_id(feature))
        self._set_default_key(mapping)
        return mapping
341671
def _generate_field_with_default(**kwargs):
        """"""
        field = kwargs['field']
        if callable(field.default):
            return field.default()
        return field.default
378044
def _create_request_map(cls, input_map):
        """"""
        field_map = cls._get_attributes_map()
        return {field_map[k]: v for k, v in input_map.items() if k in field_map}
718574
def update(table, field, value, **kwargs):
    

    return convert(table, field, lambda v: value, **kwargs)
306443
public static Map<String,Object> addFieldParam(Map<String,Object> map, Field field)
    {
        if (!field.isNull())
            map.put(field.getFieldName(), field.toString());
        return map;
    }
1241133
private Map<String, Object> toFieldsMap(Map<String, DocumentField> fields) {
		Map<String, Object> result = new HashMap<>();
		for (Entry<String, DocumentField> entry : fields.entrySet()) {
			if (entry.getValue().getValues().size() > 1) {
				result.put(entry.getKey(), entry.getValue().getValues());
			} else {
				result.put(entry.getKey(), entry.getValue().getValue());
			}

		}
		return result;
	}
570676
function expandField(input, grunt){
  var get = pointer(input);

  return function(memo, fin, fout){
    if(_.isString(fin)){
      var match = fin.match(re.PATH_POINT);
      // matched  ...with a `$.`       ...but not with a `\`
      if(match && match[3] === '$.' && !match[1]){
        // field name, starts with an unescaped `$`, treat as JSON Path
        memo[fout] = jsonPath(input, match[2]);
      }else if(match && match[3] === '/' && !match[1]){
        // field name, treat as a JSON pointer
        memo[fout] = get(match[2]);
      }else{
        memo[fout] = input[match[2]];
      }
    }else if(_.isFunction(fin)){
      // call a function
      memo[fout] = fin(input);
    }else if(_.isArray(fin)){
      // pick out the values
      memo[fout] = _.map(fin, function(value){
        return expandField(input)({}, value, "dummy")["dummy"];
      });
    }else if(_.isObject(fin)){
      // build up an object of something else
      memo[fout] = _.reduce(fin, expandField(input, grunt), {});
    }else if(_.isNull(fin)){
      // copy the value
      memo[fout] = input[fout];
    }else{
      grunt.fail.warn('Could not map `' + JSON.stringify(fin) + '` to `' + 
        JSON.stringify(fout) + '`');
    }
    return memo;
  };
}
849172
private Method[] settersMethodForField(Field field) {
    List<Method> methods = new ArrayList<>();
    for (Method method : field.getDeclaringClass().getDeclaredMethods()) {
      if (Ascii.toLowerCase(method.getName()).equals("set" + Ascii.toLowerCase(field.getName()))
          && method.getParameterTypes().length == 1) {
        methods.add(method);
      }
    }
    return methods.toArray(new Method[0]);
  }
1104319
def apply(self, collection, ops, resource=None, **kwargs):
        """"""
        mfield = self.mfield or resource.meta.model._meta.fields.get(self.field.attribute)
        if mfield:
            collection = collection.where(*[op(mfield, val) for op, val in ops])
        return collection
692747
def schema_map(schema):
    """"""
    mapper = {}
    for name in getFieldNames(schema):
        mapper[name] = name
    return mapper
358331
public void mapFunction(String prefix, String function, Method meth) {
        getELContext().getFunctionMapper().mapFunction(prefix, function, meth);
    }
1092132
def set_fields(self, fields=None, *fields_args, **fields_kwargs):
        
        if fields_args:
            fields = [fields]
            fields.extend(fields_args)
            for field_name in fields:
                self.set_field(field_name)

        elif fields_kwargs:
            fields = make_dict(fields, fields_kwargs)
            for field_name, field_val in fields.items():
                self.set_field(field_name, field_val)

        else:
            if isinstance(fields, Mapping):
                for field_name, field_val in fields.items():
                    self.set_field(field_name, field_val)

            else:
                for field_name in fields:
                    self.set_field(field_name)

        return self