add value to the aggregation group and all subgroups in accordance with the groupKeys paths.
979509
private synchronized void updateMetric(String value, Group group, Set<String>[] groupKeys, int index){
		group.update(value);
		if (index < groupKeys.length){
			for (String key : groupKeys[index]){
				Group subgroup = group.subgroup(key);
				updateMetric(value, subgroup, groupKeys, index + 1);
			}
		}
	}
359436
def group_add(self, name, restrict, repos, lces=[], assets=[], queries=[],
                  policies=[], dashboards=[], credentials=[], description=''):
        '''
        '''
        return self.raw_query('group', 'add', data={
            'lces': [{'id': i} for i in lces],
            'assets': [{'id': i} for i in assets],
            'queries': [{'id': i} for i in queries],
            'policies': [{'id': i} for i in policies],
            'dashboardTabs': [{'id': i} for i in dashboards],
            'credentials': [{'id': i} for i in credentials],
            'repositories': [{'id': i} for i in repos],
            'definingAssets': [{'id': i} for i in restrict],
            'name': name,
            'description': description,
            'users': [],
            'context': ''
        })
10093
def add(self, *args, **kwargs):
        

        check_uniqueness = kwargs.get('check_uniqueness', True)

        key = self.get_storage_key(*args)
        if self.field.unique and check_uniqueness:
            self.check_uniqueness(key=key, *args)

        # Do index => create a key to be able to retrieve parent pk with
        # current field value]
        pk = self.instance.pk.get()
        logger.debug("adding %s to index %s" % (pk, key))
        self.connection.sadd(key, pk)
        self._indexed_values.add(tuple(args))
270116
def update_params(self, token, match):
        """"""
        for k, v in self.params.items():
            if isinstance(v, MatchGroup):
                self.params[k] = v.get_group_value(token, match)
825675
private void addNeighborGroup(Collection<String> neighborGroups, Tile tile, int ox, int oy)
    {
        final Tile neighbor = map.getTile(tile.getInTileX() + ox, tile.getInTileY() + oy);
        if (neighbor != null)
        {
            final String neighborGroup = getNeighborGroup(tile, neighbor);
            if (neighborGroup != null)
            {
                neighborGroups.add(neighborGroup);
            }
        }
    }
1116289
def put(self, **kwargs):
        
        required_args = ['id']
        check_required_args(required_args, kwargs)

        return self._put('components/groups/%s' % kwargs['id'], data=kwargs)
1263587
private void placeMultipleGroups(IAtomContainer mol) {
        final List<Sgroup> sgroups = mol.getProperty(CDKConstants.CTAB_SGROUPS);
        if (sgroups == null)
            return;
        final List<Sgroup> multipleGroups = new ArrayList<>();
        for (Sgroup sgroup : sgroups) {
            if (sgroup.getType() == SgroupType.CtabMultipleGroup)
                multipleGroups.add(sgroup);
        }
        if (multipleGroups.isEmpty())
            return;

        int[][] adjlist = GraphUtil.toAdjList(mol);
        Map<IAtom,Integer> idxs = new HashMap<>();
        for (IAtom atom : mol.atoms())
            idxs.put(atom, idxs.size());

        for (Sgroup sgroup : multipleGroups) {
            final int numCrossing = sgroup.getBonds().size();
            if (numCrossing != 0 && numCrossing != 2)
                continue;

            // extract substructure
            final IAtomContainer substructure = mol.getBuilder().newInstance(IAtomContainer.class);
            final Set<IAtom> visit = new HashSet<>();
            final Collection<IAtom> patoms = sgroup.getValue(SgroupKey.CtabParentAtomList);
            if (patoms == null)
                continue;
            for (IAtom atom : patoms) {
                substructure.addAtom(atom);
                visit.add(atom);
            }
            for (IBond bond : mol.bonds()) {
                IAtom beg = bond.getBegin();
                IAtom end = bond.getEnd();
                if (visit.contains(beg) && visit.contains(end))
                    substructure.addBond(bond);
            }

            // advanced API usage, we make a set that only includes the atoms we want to match
            // and use this in a custom AtomMatcher to skip matches we don't want and update as
            // we go
            visit.addAll(sgroup.getAtoms());

            Pattern ptrn = VentoFoggia.findSubstructure(substructure, new AtomMatcher() {
                @Override
                public boolean matches(IAtom a, IAtom b) {
                    if (!visit.contains(b))
                        return false;
                    final int aElem = safeUnbox(a.getAtomicNumber());
                    final int bElem = safeUnbox(b.getAtomicNumber());
                    if (aElem != bElem)
                        return false;
                    final int aChg = safeUnbox(a.getFormalCharge());
                    final int bChg = safeUnbox(b.getFormalCharge());
                    if (aChg != bChg)
                        return false;
                    final int aMass = safeUnbox(a.getMassNumber());
                    final int bMass = safeUnbox(b.getMassNumber());
                    if (aMass != bMass)
                        return false;
                    final int aHcnt = safeUnbox(a.getImplicitHydrogenCount());
                    final int bHcnt = safeUnbox(b.getImplicitHydrogenCount());
                    if (aHcnt != bHcnt)
                        return false;
                    return true;
                }
            }, BondMatcher.forOrder());

            Set<IAtom> sgroupAtoms = sgroup.getAtoms();

            // when there are crossing bonds, things are more tricky as
            // we need to translate connected parts
            List<Map.Entry<Point2d,Vector2d>> outgoing = new ArrayList<>();
            List<Map.Entry<IBond,Vector2d>>   xBondVec = new ArrayList<>();
            if (numCrossing == 2) {
                for (IBond bond : mol.bonds()) {
                    IAtom beg = bond.getBegin();
                    IAtom end = bond.getEnd();
                    if (patoms.contains(beg) == patoms.contains(end))
                        continue;
                    if (patoms.contains(beg)) {
                        outgoing.add(new SimpleImmutableEntry<>(beg.getPoint2d(),
                                                                new Vector2d(end.getPoint2d().x - beg.getPoint2d().x,
                                                                             end.getPoint2d().y - beg.getPoint2d().y)));
                    } else {
                        outgoing.add(new SimpleImmutableEntry<>(end.getPoint2d(),
                                                                new Vector2d(beg.getPoint2d().x - end.getPoint2d().x,
                                                                             beg.getPoint2d().y - end.getPoint2d().y)));
                    }
                }
                for (IBond bond : sgroup.getBonds()) {
                    IAtom beg = bond.getBegin();
                    IAtom end = bond.getEnd();
                    if (sgroupAtoms.contains(beg)) {
                        xBondVec.add(new SimpleImmutableEntry<>(bond,
                                                                new Vector2d(end.getPoint2d().x - beg.getPoint2d().x,
                                                                             end.getPoint2d().y - beg.getPoint2d().y)));
                    } else {
                        xBondVec.add(new SimpleImmutableEntry<>(bond,
                                                                new Vector2d(beg.getPoint2d().x - end.getPoint2d().x,
                                                                             beg.getPoint2d().y - end.getPoint2d().y)));
                    }
                }
            }

            // no crossing bonds is easy just map the repeat part and transfer coordinates
            visit.removeAll(patoms); // don't need to map parent
            for (Map<IAtom, IAtom> atoms : ptrn.matchAll(mol).uniqueAtoms().toAtomMap()) {
                for (Map.Entry<IAtom, IAtom> e : atoms.entrySet()) {
                    e.getValue().setPoint2d(new Point2d(e.getKey().getPoint2d()));
                }
                // search is lazy so can update the matcher before the next match
                // is found (implementation ninja)
                visit.removeAll(atoms.values());
            }

            // reposition
            assert xBondVec.size() == outgoing.size();
            for (Map.Entry<IBond,Vector2d> e : xBondVec) {
                IBond bond = e.getKey();

                // can't fix move ring bonds
                if (bond.isInRing())
                    continue;

                IAtom beg  = sgroupAtoms.contains(bond.getBegin()) ? bond.getBegin() : bond.getEnd();
                Map.Entry<Point2d,Vector2d> best = null;
                for (Map.Entry<Point2d,Vector2d> candidate : outgoing) {
                    if (best == null || candidate.getKey().distance(beg.getPoint2d()) < best.getKey().distance(beg.getPoint2d()))
                        best = candidate;
                }
                outgoing.remove(best);
                assert best != null;

                // visit rest of connected molecule
                Set<Integer> iVisit = new HashSet<>();
                iVisit.add(idxs.get(beg));
                visit(iVisit, adjlist, idxs.get(bond.getOther(beg)));
                iVisit.remove(idxs.get(beg));
                IAtomContainer frag = mol.getBuilder().newInstance(IAtomContainer.class);
                for (Integer idx : iVisit)
                    frag.addAtom(mol.getAtom(idx));

                Vector2d orgVec = e.getValue();
                Vector2d newVec = best.getValue();

                Point2d endP    = bond.getOther(beg).getPoint2d();
                Point2d newEndP = new Point2d(beg.getPoint2d());
                newEndP.add(newVec);

                // need perpendicular dot product to get signed angle
                double pDot  = orgVec.x * newVec.y - orgVec.y * newVec.x;
                double theta = Math.atan2(pDot, newVec.dot(orgVec));

                // position
                GeometryUtil.translate2D(frag, newEndP.x - endP.x, newEndP.y - endP.y);
                GeometryUtil.rotate(frag, new Point2d(bond.getOther(beg).getPoint2d()), theta);
            }
        }

    }
1356091
public function addGroupToNews()
    {
        $aAddGroups = $this->_getActionIds('oxgroups.oxid');
        $soxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid');

        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) {
            $sGroupTable = $this->_getViewName('oxgroups');
            $aAddGroups = $this->_getAll($this->_addFilter("select $sGroupTable.oxid " . $this->_getQuery()));
        }

        if ($soxId && $soxId != "-1" && is_array($aAddGroups)) {
            foreach ($aAddGroups as $sAddgroup) {
                $oNewGroup = oxNew(\OxidEsales\Eshop\Application\Model\Object2Group::class);
                $oNewGroup->oxobject2group__oxobjectid = new \OxidEsales\Eshop\Core\Field($soxId);
                $oNewGroup->oxobject2group__oxgroupsid = new \OxidEsales\Eshop\Core\Field($sAddgroup);
                $oNewGroup->save();
            }
        }
    }
1031930
function(group, containers)
	{
	    if (lang.isObject(group.groupContainer))
		containers.push(group.groupContainer);
	    else
	    {
		for (var cI in group.containers)
		    containers.push(group.containers[cI].container);

		for (var gI in group.groups)
		    WireIt.GroupUtils.addAllContainers(group.groups[gI].group, containers)
	    }
	}
584687
def merge_into_group(self, group):
        
        super(ValueConstant, self).merge_into_group(group)
        group.value = self.value
1175523
public Setting set(String group, String key, String value) {
		this.put(group, key, value);
		return this;
	}
990776
function addGroup(group, options) {
  options = _.opts(options, {gid: null});
  if (!runningAsRoot()) return;
  if (!group) throw new Error('You must provide a group');
  if (groupExists(group)) {
    return;
  }

  if (isPlatform('linux')) {
    _addGroupLinux(group, options);
  } else if (isPlatform('osx')) {
    _addGroupOsx(group, options);
  } else if (isPlatform('windows')) {
    throw new Error(`Don't know how to add group ${group} on Windows`);
  } else {
    throw new Error(`Don't know how to add group ${group} in current platform`);
  }
}
232006
function(id, data) {
			data[this.settings.optgroupValueField] = id;
			if (id = this.registerOptionGroup(data)) {
				this.trigger('optgroup_add', id, data);
			}
		}
712779
def group_id(self, value):
        
        if isinstance(value, GroupId):
            self._group_id = value
        else:
            self._group_id = GroupId(value)
1101918
protected final Set<AggregatedGroupMapping> collectAllGroupsFromParams(
            Set<K> keys, AggregatedGroupMapping[] aggregatedGroupMappings) {
        final Builder<AggregatedGroupMapping> groupsBuilder =
                ImmutableSet.<AggregatedGroupMapping>builder();
        // Add all groups from the keyset
        for (K aggregationKey : keys) {
            groupsBuilder.add(aggregationKey.getAggregatedGroup());
        }
        // Add groups from parameters
        groupsBuilder.add(aggregatedGroupMappings);
        return groupsBuilder.build();
    }
88704
def add_grouping(state_collection, grouping_name, loaded_processes, overriding_parameters=None):
    
    if (
        grouping_name not in state_collection.groupings and
        loaded_processes != None and
        loaded_processes["grouping_selector"].get(grouping_name) != None
    ):
        state_collection = loaded_processes["grouping_selector"][grouping_name].process_function(state_collection,overriding_parameters)
    return state_collection
999042
def _move_group_helper(self, group):
        """"""

        for i in group.children:
            self.groups.remove(i)
            i.level = group.level + 1
            self.groups.insert(self.groups.index(group) + 1, i)
            if i.children:
                self._move_group_helper(i)