Assigns all fields an id if possible.  Fields are grouped by name and for each group, if there
is a single id, all fields in the group are assigned this id.  If the group has multiple ids,
an error is reported.
353978
protected final Set<String> inferThriftFieldIds()
    {
        Set<String> fieldsWithConflictingIds = new HashSet<>();

        // group fields by explicit name or by name extracted from field, method or property
        Multimap<String, FieldMetadata> fieldsByExplicitOrExtractedName = Multimaps.index(fields, getOrExtractThriftFieldName());
        inferThriftFieldIds(fieldsByExplicitOrExtractedName, fieldsWithConflictingIds);

        // group fields by name extracted from field, method or property
        // this allows thrift name to be set explicitly without having to duplicate the name on getters and setters
        // todo should this be the only way this works?
        Multimap<String, FieldMetadata> fieldsByExtractedName = Multimaps.index(fields, extractThriftFieldName());
        inferThriftFieldIds(fieldsByExtractedName, fieldsWithConflictingIds);

        return fieldsWithConflictingIds;
    }
432686
def _create_id_field(new_class):
        """"""
        id_field = Auto(identifier=True)

        setattr(new_class, 'id', id_field)
        id_field.__set_name__(new_class, 'id')

        # Ensure ID field is updated properly in Meta attribute
        new_class.meta_.declared_fields['id'] = id_field
        new_class.meta_.id_field = id_field
136196
def assign_group_items(name, items, raise_if_exists=false)
      group = group_items(name)

      if items.kind_of?(Array)
        items = Set[*items]
      elsif !items.kind_of?(Set)
        items = Set[items]
      end

      c_allocated = allocated.count
      c_group = group.count

      items.each do |item|
        utf8_item = item.encode("UTF-8")
        allocated.add(utf8_item)
        group.add(utf8_item)
      end

      if raise_if_exists
        raise unless group.count == c_group + items.count && allocated.count == c_allocated + items.count
      end

      replace_group(name, group)

      return items
    end
270302
function(oDD, sGroup) {
            if (!this.initialized) { this.init(); }
            
            if (!this.ids[sGroup]) {
                this.ids[sGroup] = {};
            }
            this.ids[sGroup][oDD.id] = oDD;
        }
652675
public Search groupField(String fieldName, boolean isNumber) {
        assertNotEmpty(fieldName, "fieldName");
        if (isNumber) {
            databaseHelper.query("group_field", fieldName + "<number>");
        } else {
            databaseHelper.query("group_field", fieldName);
        }
        return this;
    }
172193
def group_by(self, *args):
        
        if len(args) == 1:
            self.raw_fields_group = args[0].split(',')
        else:
            self.raw_fields_group = list(args)
        return self
1310411
protected function assignFields($fields)
    {
        foreach ($fields as $field) {
            if (!$field instanceof FieldInterface) {
                throw new ModelException(sprintf('Field must be an instance of FieldInterface, got "%s"', $this->getType($field)));
            }

            $field->table($this->table);
            $this->fields[$field->name()] = $field;
        }
    }
1184462
public void setIds(java.util.Collection<String> ids) {
        if (ids == null) {
            this.ids = null;
            return;
        }

        this.ids = new java.util.ArrayList<String>(ids);
    }
1101355
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case SESSION_IDS:
      return isSetSessionIds();
    case WHO:
      return isSetWho();
    }
    throw new IllegalStateException();
  }
509357
def group_by(self, *fields):
        
        fields = self._expand_group_by_fields(self.model, fields)
        return self._clone(klass=GroupByQuerySet, setup=True, _fields=fields)
1332836
def fields=(fields)
      @fields = fields.collect do |field|
        r = field.intern
        raise ArgumentError.new(_("Cannot have fields named %{name}") % { name: r }) if INVALID_FIELDS.include?(r)
        r
      end
    end
30286
def set_fields(
            self,
            new_fields):
        
        self.org_fields = {}
        self.fields_to_add = {}
        for k in new_fields:
            self.org_fields[k] = new_fields[k]
            self.fields_to_add[k] = new_fields[k]
93437
protected function assignId()
    {
        list($vendor, $package) = explode('/', $this->name);
        $package = str_replace(['flarum-ext-', 'flarum-'], '', $package);
        $this->id = "$vendor-$package";
    }
194039
public function updateGroup($groupId, $fields = array()) {
        if (empty($fields)) {
            $this->throwException(__METHOD__, 'Set fields for group');
        }

        $group = new \CGroup;
        if ($group->Update($groupId, $this->prepareFields($fields))) {
            return intval($groupId);
        }

        $this->throwException(__METHOD__, $group->LAST_ERROR);
    }
21229
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case TASK_ID:
      return is_set_taskId();
    case COMPONENT:
      return is_set_component();
    }
    throw new IllegalStateException();
  }
1195199
function setUnits (form, fieldGroup) {
    var hasUnit = false
    var noUnit = false
    // check all fields in group to see if they have unit field
    _.each(fieldGroup, field => {
        if (field.unit) {
            hasUnit = true
        }
        else {
            noUnit = true
        }
    })
    // if some fields have unit property and other dont throw error
    assert.ok(!(hasUnit && noUnit), 'some fields do not have unit')
    // if unit already defined do nothing
    if (hasUnit) {
        return
    }
    // 
    var units = fieldGroup.length
    // add unit property to each
    _.each(fieldGroup, field => {
        field.unit = '1-'+units
    })
}
1075819
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case ID:
      return isSetId();
    case CATEGORY:
      return isSetCategory();
    case LABEL:
      return isSetLabel();
    case THRESHOLD:
      return isSetThreshold();
    case RESPONSES:
      return isSetResponses();
    }
    throw new IllegalStateException();
  }