field : name directives selection_set
542491
def p_field_optional2_1(self, p):
        
        p[0] = Field(name=p[1], directives=p[2], selections=p[3])
1290975
def iselect(select, tag, namespaces=None, limit=0, flags=0, **kwargs):
    """"""

    for el in compile(select, namespaces, flags, **kwargs).iselect(tag, limit):
        yield el
977476
private void setDirectiveList(String directives) {
        String[] directiveList = directives.replaceAll("\\s", EMPTY_STRING_VALUE).split(",");
        for (String entry : directiveList) {
            String[] nameValueArray = entry.split("=");
            String directiveName = nameValueArray[0];
            if (checkDirective(directiveName)) {
                if (nameValueArray.length > 1) {
                    parseDirectiveWithValue(directiveName, nameValueArray[1]);
                    continue;
                }
                this.directives.put(Directive.get(directiveName), EMPTY_STRING_VALUE);
            }
        }
    }
712627
def unique_field(self, field_name):
        """"""
        self.fields_set.options["unique"] = True
        return self.select_field(field_name)
1338681
function selectTags(tags) {
  // select all tags
  if (!tags) {
    var keys = Object.keys(__TAG_IMPL);
    return keys + selectTags(keys)
  }

  return tags
    .filter(function (t) { return !/[^-\w]/.test(t); })
    .reduce(function (list, t) {
      var name = t.trim().toLowerCase();
      return list + ",[" + IS_DIRECTIVE + "=\"" + name + "\"]"
    }, '')
}
296229
def p_field_optional2_2(self, p):
        
        p[0] = Field(name=p[1], arguments=p[2], selections=p[3])
1320524
def p_field_optional1_1(self, p):
        
        p[0] = Field(name=p[1], arguments=p[2], directives=p[3],
                     selections=p[5])
1101491
def check_values_selection_field(cr, table_name, field_name, allowed_values):
    
    res = True
    cr.execute("SELECT %s, count(*) FROM %s GROUP BY %s;" %
               (field_name, table_name, field_name))
    for row in cr.fetchall():
        if row[0] not in allowed_values:
            logger.error(
                "Invalid value '%s' in the table '%s' "
                "for the field '%s'. (%s rows).",
                row[0], table_name, field_name, row[1])
            res = False
    return res
970011
def parse_selectors(model, fields=None, exclude=None, key_map=None, **options):
    
    fields = fields or DEFAULT_SELECTORS
    exclude = exclude or ()
    key_map = key_map or {}
    validated = []

    for alias in fields:
        # Map the output key name to the actual field/accessor name for
        # the model
        actual = key_map.get(alias, alias)

        # Validate the field exists
        cleaned = resolver.get_field(model, actual)

        if cleaned is None:
            raise AttributeError('The "{0}" attribute could not be found '
                                 'on the model "{1}"'.format(actual, model))

        # Mapped value, so use the original name listed in `fields`
        if type(cleaned) is list:
            validated.extend(cleaned)
        elif alias != actual:
            validated.append(alias)
        else:
            validated.append(cleaned)

    return tuple([x for x in validated if x not in exclude])
47560
def nested_parent_select name, class_or_item, *args
      impl_nested_belongs_to_select_with_mover name, object, class_or_item, object.class, *args

      # @template.content_tag :div, class: "field" do
      #   (field_label name, *args) + @template.tag(:br) + select(
      #     name, *([object.class.nested_set_select_options(nil, object, :include_blank => true)] + args) 
      #   )
      # end
    end
726631
def p_field_optional2_5(self, p):
        
        p[0] = Field(name=p[2], alias=p[1], directives=p[3])
749461
def p_field_optional2_4(self, p):
        
        p[0] = Field(name=p[2], alias=p[1], selections=p[3])
1175603
def directive(self, name, default=None):
        """"""
        return getattr(self, '_directives', {}).get(name,  hug.defaults.directives.get(name, default))
1164927
public void selectFields(String[] fieldNames) {
		checkNotNull(fieldNames, "fieldNames");
		this.fieldNames = fieldNames;
		RowTypeInfo rowTypeInfo = (RowTypeInfo) ParquetSchemaConverter.fromParquetType(expectedFileSchema);
		TypeInformation[] selectFieldTypes = new TypeInformation[fieldNames.length];
		for (int i = 0; i < fieldNames.length; i++) {
			try {
				selectFieldTypes[i] = rowTypeInfo.getTypeAt(fieldNames[i]);
			} catch (IndexOutOfBoundsException e) {
				throw new IllegalArgumentException(String.format("Fail to access Field %s , "
						+ "which is not contained in the file schema", fieldNames[i]), e);
			}
		}
		this.fieldTypes = selectFieldTypes;
	}
312934
function(fields, editing) {
    var f = [];
    _.each(fields, function(field) {
        var nf = {};
        if (!(field === Object(field))) {
            nf = nga.field(field);
        } else {
            switch (field.type) {
                case 'template':
                    nf = nga.field(field.field, 'template')
                        .template(field.template);
                    break;
                case 'boolean':
                    nf = nga.field(field.field, field.type)
                        .validation({required: true});
                    break;
                case 'float':
                case 'json':
                case 'text':
                    nf = nga.field(field.field, field.type);
                    break;
                case 'number':
                    nf = nga.field(field.field, field.type)
                        .format(field.format)
                    break;
                case 'choice':
                    nf = nga.field(field.field, field.type);
                    if (field.choiceField) {
                        nf.choices(function(entry) {
                            return field.choices.filter(function(choice) {
                                return choice[field.choiceField] == entry.values[field.choiceField];
                            });
                        });
                    } else {
                        nf.choices(field.choices);
                    }
                    break;
                case 'string':
                    if (!editing) {
                        switch (field.format) {
                            case 'url':
                                var caption = field.caption || 'Link';
                                nf = nga.field(field.field, 'template')
                                    .template('<a href="{{ entry.values.url }}" target="_blank" ng-show="entry.values.url">' + caption + '</a>')
                                ;
                                break;
                            case 'image':
                                nf = nga.field(field.field, 'template')
                                    .template('<img ng-src="' + field.url + '{{ entry.values.name }}"' + ' width="' + field.width + 'px" />')
                                ;
                                break;
                            default:
                                nf = nga.field(field.field);
                        }
                    } else {
                        nf = nga.field(field.field);
                    }
                    break;
                case 'integer':
                    if (!editing) {
                        switch (field.format) {
                            case 'count':
                                nf = nga.field(field.field, 'template')
                                    .template('{{ entry.values.' + field.targetField + '.length }}')
                                ;
                                break;
                            case 'rating':
                                nf = nga.field(field.field, 'template')
                                    .template('<star-rating stars="{{ entry.values.rating }}"></star-rating>');
                                break;
                            default:
                                nf = nga.field(field.field);
                        }
                    } else {
                        nf = nga.field(field.field);
                    }
                    break;
                case 'date':
                case 'datetime':
                    var formatString = field.formatString || '';
                    nf = nga.field(field.field, field.type)
                        .format(formatString);
                    break;
                case 'reference':
                    var tField = nga.field(field.targetField);
                    if (field.targetFieldMap) {
                        tField.map(field.targetFieldMap);
                    }
                    nf = nga.field(field.field, field.type)
                        .targetEntity(entities[field.targetEntity])
                        .targetField(tField)
                        .detailLinkRoute('show')
                    ;
                    break;
                case 'referenced_list':
                    var tFields = [];
                    if (field.targetFields) {
                        tFields = ngAdmin.ngaFieldsFromModel(
                            field.targetEntity, field.targetFields
                        );
                    }
                    nf = nga.field(field.field, field.type)
                        .targetEntity(entities[field.targetEntity])
                        .targetReferenceField(field.targetReferenceField)
                        .targetFields(tFields)
                    ;
                    break;
                case 'reference_many':
                    nf = nga.field(field.field, field.type)
                        .targetEntity(entities[field.targetEntity])
                        .targetField(nga.field(field.targetField))
                        // .detailLinkRoute('show')
                        .perPage(0)
                    ;
                    break;
                case 'id':
                // case 'string':
                default:
                    nf = nga.field(field.field);
                    break;
            };
            // default value
            if (field.defaultValue) {
                if (typeof field.defaultVale === "function") {
                    nf.defaultValue(field.defaultValue());
                } else {
                    nf.defaultValue(field.defaultValue);
                }
            }
            // read-only
            if (field.readOnly) {
                nf.editable(false);
            }
            // add attributes
            if (field.attributes) {
                nf.attributes(field.attributes);
            }
            // add filters
            if (field.permanentFilters) {
                nf.permanentFilters(field.permanentFilters);
            }
            // add map
            if (field.map) {
                nf.map(field.map);
            }
            // add page
            if (field.perPage) {
                nf.perPage(field.perPage);
            }
            // add sort
            if (field.sort) {
                nf.sortField(field.sort.field);
                nf.sortDir(field.sort.dir);
            }
            // add field label
            if (field.label) {
                nf.label(field.label);
            }
            // add detail link
            if (field.detailRoute) {
                nf.isDetailLink(true);
                nf.detailLinkRoute(field.detailRoute);
            }
            // set field pinned
            if (field.pinned) {
                nf.pinned(true);
            }
        }
        f.push(nf);
    });
    return f;
}
1193681
function pair(name, value, i) {
  if(typeof name === 'function') return name(value);
  if(!name) return {name: `notMappedField${i}`, value};

  var candidateKey = name.split('|');
  var directive = candidateKey[1];
  if(keys.indexOf(directive) !== -1) return {name: candidateKey[0], value: format[directive](value)};

  return {name, value};
}
1090556
function ( fields ) {

            var field, data = {}, key, value;

            for ( var i = fields.length - 1; i >= 0; i-- ) {

                field = fields[ i ];

                field.removeAttribute( 'name' );
                key = field.getAttribute( this.fieldNameAttribute );
                value = field.value;

                // Cater for select boxes
                if ( field.options && typeof field.selectedIndex !== "undefined" ) {
                    value = field.options[ field.selectedIndex ].value;
                }

                data[ key ] = value;

            }
            
            return data;

        }