Get field value if is included in `options.fields`
492044
function valueFilteredByFields(fieldName, item, options) {
	if (!inFields(fieldName, options)) return null;
	return item.dataValues[fieldName];
}
580136
def special_get_field(self, value, args, kwargs, format_spec=None):
        """"""
        if value in self.chain:
            raise BadOptionFormat("Recursive option", chain=self.chain + [value])
794751
def get_pk(self, field_val):
        """"""
        field_name = self.schema.pk.name
        return self.is_field(field_name, field_val).get_one()
1191147
function(fields, value, options) {
            fields  = this.__resolveFields(fields);
            options = this.__resolveOptions(options);

            var property = fields.shift();

            if (options.check) {
                this.__checkProperty(property, {
                    writable: true,
                    method:   'set',
                    params:   _.toArray(arguments)
                });
            }

            var field, container;

            if (fields.length) {
                field     = _.last(fields);
                container = this.__getPropertyValue([property].concat(fields).slice(0, -1), false);
            }
            else {
                field     = '_' + property;
                container = this;
            }

            var wasExisted = field in container;
            var oldValue   = container[field];
            var newValue   = this.__applySetters(property, value, fields);

            container[field] = newValue;

            if (options.emit && this.__checkEmitEvent()) {
                this.__emitPropertySet([property].concat(fields), newValue, oldValue, wasExisted);
            }

            return this;
        }
564264
function( field ){
    var tagName = field.tagName.toLowerCase();

    if( tagName == 'input' && field.type == 'checkbox' ){
        return field.checked;
    }

    if( tagName == 'select' ){
        return field.options[field.selectedIndex].value;
    }

    return field.value;
}
1240924
def get_option_value_selected(option_value)
      if @args[:multiple]
        values = @args[:value].is_a?(Array) ? @args[:value] : @args[:value].split(',')
        return values.include?(option_value) ? "selected='selected'" : ''
      end

      @args[:value] == option_value ? "selected='selected'" : ''
    end
1211610
def load_field_values(instance, include_fields):
    
    ret = {}
    schema = instance.Schema()
    val = None
    for field in schema.fields():
        fieldname = field.getName()
        if include_fields and fieldname not in include_fields:
            continue
        try:
            val = field.get(instance)
        except AttributeError:
            # If this error is raised, make a look to the add-on content
            # expressions used to obtain their data.
            print "AttributeError:", sys.exc_info()[1]
            print "Unreachable object. Maybe the object comes from an Add-on"
            print traceback.format_exc()

        if val:
            field_type = field.type
            # If it a proxy field, we should know to the type of the proxied
            # field
            if field_type == 'proxy':
                actual_field = field.get_proxy(instance)
                field_type = actual_field.type
            if field_type == "blob" or field_type == 'file':
                continue
            # I put the UID of all references here in *_uid.
            if field_type == 'reference':
                if type(val) in (list, tuple):
                    ret[fieldname + "_uid"] = [v.UID() for v in val]
                    val = [to_utf8(v.Title()) for v in val]
                else:
                    ret[fieldname + "_uid"] = val.UID()
                    val = to_utf8(val.Title())
            elif field_type == 'boolean':
                val = True if val else False
            elif field_type == 'text':
                val = to_utf8(val)

        try:
            json.dumps(val)
        except:
            val = str(val)
        ret[fieldname] = val
    return ret
798280
def get(self, field=None, index=None, lpar=0, prompt=1, native=0, mode="h"):
        """"""

        if field and field != "p_value":
            # note p_value comes back to this routine, so shortcut that case
            return self._getField(field,native=native,prompt=prompt)

        # may prompt for value if prompt flag is set
        if prompt: self._optionalPrompt(mode)

        if index is not None:
            raise SyntaxError("Parameter "+self.name+" is not an array")

        if native:
            rv = self.value
        else:
            rv = self.toString(self.value)
        return rv
925754
def _get_option_value(self, key):
        
        fn_name = "set_{}_value".format(key)
        if key in self.overrides:
            val = self.overrides[key]
        elif hasattr(self, fn_name):
            val = getattr(self, fn_name)()
        else:
            val = self.defaults[key]["d"]

        if self.defaults[key]["t"] == constants.FT_PARAM:
            return val.split("|")
        else:
            return val
770713
def check_field_exists(self, field_name):
        
        if not settings.DEBUG:
            return

        try:
            self.lookup_opts.get_field(field_name)

        except FieldDoesNotExist as e:
            raise AdmirarchyConfigurationError(e)
1372832
function handleField (name, value, options) {
      var serialized
      var length
      var key
      var i

      options = options || { attachment: false }

      if (is(name).a(Object)) {
        for (key in name) {
          if (Object.prototype.hasOwnProperty.call(name, key)) {
            handleField(key, name[key], options)
          }
        }
      } else {
        if (is(value).a(Array)) {
          for (i = 0, length = value.length; i < length; i++) {
            serialized = handleFieldValue(value[i])
            if (serialized) {
              $this.rawField(name, serialized, options)
            }
          }
        } else if (value != null) {
          $this.rawField(name, handleFieldValue(value), options)
        }
      }

      return $this
    }
384027
def export_value(value, options = nil)
      return if value.nil?
      value.respond_to?(:export) ? value.export(options) : value
    end
323939
def get_parameter_value(self):
        
        parameters = self.parameter_container.get_parameters(True)
        field_parameters = {}
        value_parameters = {}
        for parameter in parameters:
            if parameter.selected_option_type() in [SINGLE_DYNAMIC, STATIC]:
                value_parameters[parameter.guid] = parameter.value
            elif parameter.selected_option_type() == MULTIPLE_DYNAMIC:
                field_parameters[parameter.guid] = parameter.value
        return {
            'fields': field_parameters,
            'values': value_parameters
        }
485630
def find_field(browser, field, value):
    
    return find_field_by_id(browser, field, value) + \
        find_field_by_name(browser, field, value) + \
        find_field_by_label(browser, field, value)
625461
function findFieldOption(options, field) {
  const flattenedOptions = Util.flatten(options);

  return Util.find(flattenedOptions, function(fieldOption) {
    var isField = fieldOption.name === field;
    if (fieldOption.fieldType === "object" && !isField) {
      return findFieldOption(fieldOption.definition, field);
    }

    return isField;
  });
}
840596
function addToFields(fieldName, options) {
	if (inFields(fieldName, options)) return;
	options.fields = options.fields.concat([fieldName]);
}
5292
def parse_field_options(self, *options):
        
        defaults = {}
        for option in options:
            if isinstance(option, six.text_type):
                tokens = [token.strip() for token in option.split(self.view.lookup_sep)]

                for token in tokens:
                    if not len(token.split(":")) == 2:
                        warnings.warn("The %s token is not properly formatted. Tokens need to be "
                                      "formatted as 'token:value' pairs." % token)
                        continue

                    param, value = token.split(":", 1)

                    if any([k == param for k in ("start_date", "end_date", "gap_amount")]):

                        if param in ("start_date", "end_date"):
                            value = parser.parse(value)

                        if param == "gap_amount":
                            value = int(value)

                    defaults[param] = value

        return defaults