Gets tape field names for the condition "ON DUPLICATE KEY UPDATE".
Ignore the first field, as it should be unique and should not be changed.
Generates set to ON DUPLICATE KEY UPDATE, the type field = VALUES (field), field2 = VALUES (field2), ...
960842
private function _onDuplicateKeyUpdateField($fieldsStr, $idField)
    {
        $fields_array = explode(',', $fieldsStr);
        $fields = [];
        foreach ($fields_array as $field) {
            if (trim($field, '` ') == $idField) {
                $fields[] = " {$idField} = LAST_INSERT_ID($idField)";
                continue;
            }
            $fields[] = " {$field} = VALUES({$field})";
        }

        return (string) implode(',', $fields);
    }
78309
private LinkedHashMap<String, Long> getPrefixRefs(String field) {
    if (fieldReferences.containsKey(field)) {
      FieldReferences fr = fieldReferences.get(field);
      if (!prefixReferences.containsKey(field)) {
        LinkedHashMap<String, Long> refs = new LinkedHashMap<String, Long>();
        try {
          IndexInput inPrefix = indexInputList.get("prefix");
          inPrefix.seek(fr.refPrefix);
          for (int i = 0; i < fr.numberOfPrefixes; i++) {
            Long ref = inPrefix.getFilePointer();
            String prefix = inPrefix.readString();
            refs.put(prefix, ref);
          }
        } catch (Exception e) {
          log.error(e);
          refs.clear();
        }
        prefixReferences.put(field, refs);
        return refs;
      } else {
        return prefixReferences.get(field);
      }
    } else {
      return null;
    }
  }
721981
def get_field_list(fields, schema):
  
  # If the fields weren't supplied get them from the schema.
  if isinstance(fields, list):
    return fields
  if isinstance(fields, basestring) and fields != '*':
    return fields.split(',')
  if not schema:
    return []
  return [f['name'] for f in schema._bq_schema if f['type'] != 'RECORD']
1106276
def get_field_name(self):
        
        if hasattr(self, 'agnocomplete_field') and \
           hasattr(self.agnocomplete_field, 'to_field_name'):
            return self.agnocomplete_field.to_field_name or 'pk'
        return 'pk'
758908
function () {
			
			var i, j, ilength, jlength, currentSubChoices, currentSubChoice, currentValue,
			    testValue, isDuplicateChoice, secondSelectChoices;
			
			
			// object used in updateSecondSelectChoices
			//
			//   * key   : string representing a value in 1st select
			//   * value : array of values available in 2nd select when key is selected in first select
			//
			this.valuesMatching = {};
			
			
			// helper to filter 2nd select choices to find duplicates
			isDuplicateChoice = function(elt, arrElt) {
				elt    = lang.isObject(elt)    ? elt.value    : elt;
				arrElt = lang.isObject(arrElt) ? arrElt.value : arrElt;
				return elt === arrElt;
			};
			
			// collect 2nd level choices + ensure uniqueness of values
			secondSelectChoices = [];
			
			for (i = 0, ilength = this.options.choices.length; i < ilength; i += 1) {
				
				currentValue = lang.isObject(this.options.choices[i]) ? this.options.choices[i].value : this.options.choices[i];
				currentSubChoices = this.options.choices[i].choices;
				
				this.valuesMatching[currentValue] = [];
				
				// maybe no sub choices ???
				if (currentSubChoices) {
					for (j = 0, jlength = currentSubChoices.length; j < jlength; j += 1) {
					
						currentSubChoice = currentSubChoices[j];
					
						testValue = lang.isObject(currentSubChoice) ? currentSubChoice.value : currentSubChoice;
					
						this.valuesMatching[currentValue].push(testValue);
					
						if (inputEx.indexOf(testValue, secondSelectChoices, isDuplicateChoice) === -1) {
							secondSelectChoices.push(currentSubChoices[j]);
						}
					
					}
				}
				
			}
			
			
			// create and store selects
			this.selects = [];
			this.selects.push(new inputEx.SelectField({ choices: this.options.choices }));
			this.selects.push(new inputEx.SelectField({ choices: secondSelectChoices }));
			
			// append <select>s to DOM tree
			this.fieldContainer.appendChild(this.selects[0].getEl());
			this.fieldContainer.appendChild(this.selects[1].getEl());
			
		}
446927
def on_lstFields_itemSelectionChanged(self):
        
        self.clear_further_steps()
        field_names = self.selected_fields()
        layer_purpose = self.parent.step_kw_purpose.selected_purpose()
        # Exit if no selection
        if not field_names:
            self.parent.pbnNext.setEnabled(False)
            self.lblDescribeField.setText('')
            return
        # Compulsory fields can be list of field name or single field name.
        # We need to iterate through all of them
        if not isinstance(field_names, list):
            field_names = [field_names]
        field_descriptions = ''
        feature_count = self.parent.layer.featureCount()
        for field_name in field_names:
            layer_fields = self.parent.layer.fields()
            field_index = layer_fields.indexFromName(field_name)
            # Exit if the selected field_names comes from a previous wizard run
            if field_index < 0:
                return

            # Generate description for the field.
            field_type = layer_fields.field(field_name).typeName()
            field_index = layer_fields.indexFromName(field_name)
            unique_values = self.parent.layer.uniqueValues(field_index)
            unique_values_str = [
                i is not None and str(i) or 'NULL'
                for i in list(unique_values)[0:48]]
            unique_values_str = ', '.join(unique_values_str)
            field_descriptions += tr('<b>Field name</b>: {field_name}').format(
                field_name=field_name)
            field_descriptions += tr(
                '<br><b>Field type</b>: {field_type}').format(
                field_type=field_type)
            if (feature_count != -1 and (
                    layer_purpose == layer_purpose_aggregation)):
                if len(unique_values) == feature_count:
                    unique = tr('Yes')
                else:
                    unique = tr('No')
                field_descriptions += tr(
                    '<br><b>Unique</b>: {unique} ({unique_values_count} '
                    'unique values from {feature_count} features)'.format(
                        unique=unique,
                        unique_values_count=len(unique_values),
                        feature_count=feature_count))
            field_descriptions += tr(
                '<br><b>Unique values</b>: {unique_values_str}<br><br>'
            ).format(unique_values_str=unique_values_str)

        self.lblDescribeField.setText(field_descriptions)

        self.parent.pbnNext.setEnabled(True)
960995
def _field_names_(self):
        
        ret = []
        for n in six.iterkeys(self.__swagger_fields__):
            new_n = self.__swagger_rename__.get(n, None)
            ret.append(new_n) if new_n else ret.append(n)
        
        return ret
1338970
public List<String> getFieldNames() {
		List<String> ret = new ArrayList<String>();
		DOType typ = this;
		while(typ != null) {
			ret.addAll(typ.getDeclaredFieldNames());
			typ = typ.getSuperType();
		}
		return ret;
	}
1234389
private Set<String> collidingFieldNames(ImmutableList<Field> fields) {
    Set<String> fieldNames = new LinkedHashSet<>();
    Set<String> collidingNames = new LinkedHashSet<>();
    for (Field field : fields) {
      if (!fieldNames.add(field.name())) {
        collidingNames.add(field.name());
      }
    }
    return collidingNames;
  }
847861
def get_uniqueness_extra_kwargs(self, field_names, declared_fields, extra_kwargs):
        
        model = getattr(self.Meta, 'model')
        model_fields = self._get_model_fields(
            field_names, declared_fields, extra_kwargs
        )

        # Determine if we need any additional `HiddenField` or extra keyword
        # arguments to deal with `unique_for` dates that are required to
        # be in the input data in order to validate it.
        unique_constraint_names = set()

        for model_field in model_fields.values():
            # Include each of the `unique_for_*` field names.
            unique_constraint_names |= {model_field.unique_for_date, model_field.unique_for_month,
                                        model_field.unique_for_year}

        unique_constraint_names -= {None}

        # Include each of the `unique_together` field names,
        # so long as all the field names are included on the serializer.
        for parent_class in [model] + list(model._meta.parents.keys()):
            for unique_together_list in parent_class._meta.unique_together:
                if set(field_names).issuperset(set(unique_together_list)):
                    unique_constraint_names |= set(unique_together_list)

        # Now we have all the field names that have uniqueness constraints
        # applied, we can add the extra 'required=...' or 'default=...'
        # arguments that are appropriate to these fields, or add a `HiddenField` for it.
        hidden_fields = {}
        uniqueness_extra_kwargs = {}

        for unique_constraint_name in unique_constraint_names:
            # Get the model field that is referred too.
            unique_constraint_field = model._meta.get_field(unique_constraint_name)

            if getattr(unique_constraint_field, 'auto_now_add', None):
                default = CreateOnlyDefault(timezone.now)
            elif getattr(unique_constraint_field, 'auto_now', None):
                default = timezone.now
            elif unique_constraint_field.has_default():
                default = unique_constraint_field.default
            else:
                default = empty

            if unique_constraint_name in model_fields:
                # The corresponding field is present in the serializer
                if default is empty:
                    uniqueness_extra_kwargs[unique_constraint_name] = {'required': True}
                else:
                    uniqueness_extra_kwargs[unique_constraint_name] = {'default': default}
            elif default is not empty:
                # The corresponding field is not present in the,
                # serializer. We have a default to use for it, so
                # add in a hidden field that populates it.
                hidden_fields[unique_constraint_name] = HiddenField(default=default)

        # Update `extra_kwargs` with any new options.
        for key, value in uniqueness_extra_kwargs.items():
            if key in extra_kwargs:
                extra_kwargs[key].update(value)
            else:
                extra_kwargs[key] = value

        return extra_kwargs, hidden_fields
895619
def get_unique_fields(cls):
        
        unique_fields = []

        for fname, field in cls.__dict__.items():
            if isinstance(field, models.fields.Field):
                if getattr(field,'unique',False):
                    try:
                        field.unique = False
                    except AttributeError:
                        # newer Django defines unique as a property
                        # that uses _unique to store data.  We're
                        # jumping over the fence by setting _unique,
                        # so this sucks, but this happens early enough
                        # to be safe.
                        field._unique = False
                    unique_fields.append(fname)
        return unique_fields
722122
private TableFieldSchema getSchemaOfRepeatedFields(Field field) {
    Class<?> parameterType = BigQueryFieldUtil.getParameterTypeOfRepeatedField(field);
    TableFieldSchema tf = parseFieldAnnotations(field);
    tf.setMode(BigQueryFieldMode.REPEATED.getValue());
    if (BigqueryFieldMarshallers.getMarshaller(parameterType) != null) {
      return tf.setType(BigQueryDataTypeUtil.getBigQueryType(
          BigqueryFieldMarshallers.getMarshaller(parameterType).getSchemaType()));
    }
    tf.setType(BigQueryConstants.RECORD_TYPE);
    return tf.setFields(getSchema(parameterType));
  }
1210513
def get_field_name(self, field):
        
        for field_name, f in self.fields.items():
            if f == field:
                return field_name
        raise AttributeError("Field %s does not exists in %s resource" % (
            field, self.__class__))
36356
def get_all_storage_keys(self):
        

        parts1 = [
            self.model._name,
            self.field.name,
        ]

        parts2 = parts1 + ['*']  # for indexes taking args, like for hashfields

        if self.prefix:
            parts1.append(self.prefix)
            parts2.append(self.prefix)

        if self.key:
            parts1.append(self.key)
            parts2.append(self.key)

        parts1.append('*')
        parts2.append('*')

        return set(
            self.model.database.scan_keys(self.field.make_key(*parts1))
        ).union(
            set(
                self.model.database.scan_keys(self.field.make_key(*parts2))
            )
        )
343420
def _set_field_on_message(msg, key, value):
    """"""
    # Attempt to set the value on the types of objects we know how to deal
    # with.
    if isinstance(value, (collections_abc.MutableSequence, tuple)):
        # Clear the existing repeated protobuf message of any elements
        # currently inside it.
        while getattr(msg, key):
            getattr(msg, key).pop()

        # Write our new elements to the repeated field.
        for item in value:
            if isinstance(item, collections_abc.Mapping):
                getattr(msg, key).add(**item)
            else:
                # protobuf's RepeatedCompositeContainer doesn't support
                # append.
                getattr(msg, key).extend([item])
    elif isinstance(value, collections_abc.Mapping):
        # Assign the dictionary values to the protobuf message.
        for item_key, item_value in value.items():
            set(getattr(msg, key), item_key, item_value)
    elif isinstance(value, message.Message):
        getattr(msg, key).CopyFrom(value)
    else:
        setattr(msg, key, value)
312401
def rec_append_fields(rec, names, arrs, dtypes=None):
    
    if (not isstring(names) and iterable(names) and len(names) and isstring(names[0])):
        if len(names) != len(arrs):
            raise ValueError("number of arrays do not match number of names")
    else:  # we have only 1 name and 1 array
        names = [names]
        arrs = [arrs]
    arrs = list(map(np.asarray, arrs))
    if dtypes is None:
        dtypes = [a.dtype for a in arrs]
    elif not iterable(dtypes):
        dtypes = [dtypes]
    if len(arrs) != len(dtypes):
        if len(dtypes) == 1:
            dtypes = dtypes * len(arrs)
        else:
            raise ValueError("dtypes must be None, a single dtype or a list")
    old_dtypes = rec.dtype.descr
    if six.PY2:
        old_dtypes = [(name.encode('utf-8'), dt) for name, dt in old_dtypes]
    newdtype = np.dtype(old_dtypes + list(zip(names, dtypes)))
    newrec = np.recarray(rec.shape, dtype=newdtype)
    for field in rec.dtype.fields:
        newrec[field] = rec[field]
    for name, arr in zip(names, arrs):
        newrec[name] = arr
    return newrec
437337
def id_field_name(cls):
        
        if cls._cache_id_field_name is None:
            pk_names = cls.pk_names()
            if len(pk_names) == 1:
                cls._cache_id_field_name = pk_names[0]
            else:  # pragma: no cover
                raise ValueError(
                    "{classname} has more than 1 primary key!"
                    .format(classname=cls.__name__)
                )
        return cls._cache_id_field_name