/* Creates a custom group of entries (rather than the natural grouping things fall into)
497517
function groups (selection, transformer) {
  if (selection.has('group')) {
    const sortedEntity = selection.filter('group')
    return dom.create('div').class('qm-api-groups')
      .add(sortedEntity.selectAll('group').map(utils.organisedEntity).map((groupSelection) => {
        const nestedGroups = groupSelection.filter('group')
        return dom.create('div').class('qm-api-group')
          .add(dom.create('div').class('qm-api-group-header qm-header-font').text(groupSelection.ps()))
          .add(dom.create('div').class('qm-api-group-content')
            .add(description(groupSelection, transformer))
            .add(groupSelection
              .filter(entity => quantum.isEntity(entity) && entity.type !== 'description' && entity.type !== 'group')
              .transform(transformer))
            .add(groups(nestedGroups, transformer)))
      }))
  }
}
1180387
private void addGroup(String key, Group object) {
    int fieldIndex = getIndex(key);
    this.schema.getType(fieldIndex).asGroupType();
    this.data[fieldIndex].add(object);
  }
836198
function groupBy(keySelector, elementSelector, resultSelector, keyComparator) {
                            __assertFunction(keySelector);
                            __assertFunction(elementSelector);
                            __assert(__isUndefined(resultSelector) || __isFunction(resultSelector), 'resultSelector must be undefined or function!');
                            __assertFunction(keyComparator);
                            var groups = new Map();
                            var result = void 0;
                            var _iteratorNormalCompletion15 = true;
                            var _didIteratorError15 = false;
                            var _iteratorError15 = undefined;

                            try {
                                for (var _iterator15 = self[Symbol.iterator](), _step15; !(_iteratorNormalCompletion15 = (_step15 = _iterator15.next()).done); _iteratorNormalCompletion15 = true) {
                                    var val = _step15.value;

                                    // Instead of checking groups.has we use our custom function since we want to treat some keys as equal even if they aren't for the Map
                                    var key = __Collection.__getEqualKey(groups, keySelector(val), keyComparator);
                                    var elem = elementSelector(val);
                                    if (groups.has(key)) {
                                        groups.get(key).push(elem);
                                    } else {
                                        groups.set(key, [elem]);
                                    }
                                }
                            } catch (err) {
                                _didIteratorError15 = true;
                                _iteratorError15 = err;
                            } finally {
                                try {
                                    if (!_iteratorNormalCompletion15 && _iterator15.return) {
                                        _iterator15.return();
                                    }
                                } finally {
                                    if (_didIteratorError15) {
                                        throw _iteratorError15;
                                    }
                                }
                            }

                            if (resultSelector) {
                                // If we want to select the final result with the resultSelector, we use the built-in Select function and retrieve a new Collection
                                result = __Collection.from(groups).select(function (g) {
                                    return resultSelector.apply(undefined, _toConsumableArray(g));
                                });
                            } else {
                                // our result is just the groups -> return the Map
                                result = groups;
                            }
                            return result;
                        }
17245
private static Map<?, ?> mapOfEntries( Entry<?, ?>... entries ) {
        Map<Object, Object> looseTypedMap = new LinkedHashMap<>( entries.length );
        for (Entry<?, ?> entry : entries)
            looseTypedMap.put(entry.getKey(), entry.getValue());
        return looseTypedMap;
    }
270302
function(oDD, sGroup) {
            if (!this.initialized) { this.init(); }
            
            if (!this.ids[sGroup]) {
                this.ids[sGroup] = {};
            }
            this.ids[sGroup][oDD.id] = oDD;
        }
984699
def writegroup(self, auth, entries, defer=False):
        
        return self._call('writegroup', auth, [entries], defer)
331014
private function buildGroups($diff, $offset = 2) {
        $groups = [];

        for ($i = 0; $i < count($diff); $i++) {
            if (!$diff[$i] instanceof UnmodifiedEntry) {
                $group = new DiffGroup();

                // Beginning offset
                for ($j = $i - 1; $j >= $i - $offset && $j >= 0; $j--) {
                    if ($diff[$j] instanceof UnmodifiedEntry) {
                        $group->addEntry($diff[$j], true);
                    }
                }

                for (; $i < count($diff) && !$diff[$i] instanceof UnmodifiedEntry; $i++) {
                    $group->addEntry($diff[$i]);
                }

                // Ending offset
                for ($j = $i; $j <= $i + $offset - 1 && $j < count($diff); $j++) {
                    if ($diff[$j] instanceof UnmodifiedEntry) {
                        $group->addEntry($diff[$j]);
                    }
                }

                $groups[] = $group;
            }
        }

        return $groups;
    }
651226
public void create(String roomName, String subject, HashMap<String, String> customConfigs, List<Jid> occupants)
            throws Exception {
        MUCLightCreateIQ createMUCLightIQ = new MUCLightCreateIQ(room, roomName, occupants);

        messageCollector = connection.createStanzaCollector(fromRoomGroupChatFilter);

        try {
            connection.createStanzaCollectorAndSend(createMUCLightIQ).nextResultOrThrow();
        } catch (NotConnectedException | InterruptedException | NoResponseException | XMPPErrorException e) {
            removeConnectionCallbacks();
            throw e;
        }
    }
2811
function group() {
    var ret = this.seq(
        this.stringf('('),
        this.manyf(c_wsp),
        alternation,
        this.manyf(c_wsp),
        this.stringf(')'));
    return new ast.Group(ret[3]);
}
1031660
public EvaluationResult.MeasurementGroup newGroup(String string) {
    EvaluationResult.MeasurementGroup g = new MeasurementGroup(string);
    groups.add(g);
    return g;
  }
535628
function grouped(array, groups, order) {
  if (!groups) { groups = [returnFalse]; }
  var sorted = [];
  var ordered = [];
  var remaining = array.slice();
  var unmatchedPosition = groups.indexOf('unmatched');
  groups.forEach(function(criteria, index) {
    if (index === unmatchedPosition) { return; }
    var tieBreakers = [];
    if (index !== groups.length - 1) {
      tieBreakers = groups.slice(index + 1);
      if (index < unmatchedPosition) {
        tieBreakers.splice(unmatchedPosition - index - 1, 1);
      }
    }
    var spliced = splice(remaining, criteria, tieBreakers);
    var matched = spliced.matched;
    var unmatched = spliced.unmatched;
    sorted[index] = matched;
    remaining = unmatched;
  });
  if (unmatchedPosition === -1) { unmatchedPosition = sorted.length; }
  sorted[unmatchedPosition] = remaining;
  if (Array.isArray(order)) {
    order.forEach(function(position, index) {
      ordered[index] = sorted[position];
    });
  } else {
    ordered = sorted;
  }
  return ordered.reduce(function(flat, group) {
    return flat.concat(group);
  }, []);
}
1079323
def create_group(cls, prefix: str, name: str) -> ErrorGroup:
        """"""
        group = cls.ErrorGroup(prefix, name)
        cls.groups.append(group)
        return group
863399
function processGroupsKeys(){
				var GroupsKeys = [];

				module.groups.forEach(function(table){
					GroupsKeys.push({
						value: table.get('id'),
						text: table.get('name'),
					});
				});

				module.GroupsKeys = GroupsKeys;
			}
693223
function VirtualizeContentsView_createChunk(groups, count, chunkSize) {
                    var that = this;

                    this._listView._writeProfilerMark("createChunk,StartTM");

                    function addToGroup(itemsContainer, groupSize) {
                        var children = itemsContainer.element.children,
                            oldSize = children.length,
                            toAdd = Math.min(groupSize - itemsContainer.items.length, chunkSize);

                        _SafeHtml.insertAdjacentHTMLUnsafe(itemsContainer.element, "beforeend", _Helpers._repeat("<div class='win-container win-backdrop'></div>", toAdd));

                        for (var i = 0; i < toAdd; i++) {
                            var container = children[oldSize + i];
                            itemsContainer.items.push(container);
                            that.containers.push(container);
                        }
                    }

                    function newGroup(group) {
                        var node = {
                            header: that._listView._groupDataSource ? that._createHeaderContainer() : null,
                            itemsContainer: {
                                element: that._createItemsContainer(),
                                items: []
                            }
                        };


                        that.tree.push(node);
                        that.keyToGroupIndex[group.key] = that.tree.length - 1;
                        addToGroup(node.itemsContainer, group.size);
                    }

                    if (this.tree.length && this.tree.length <= groups.length) {
                        var last = this.tree[this.tree.length - 1],
                            finalSize = groups[this.tree.length - 1].size;

                        // check if the last group in the tree already has all items. If not add items to this group
                        if (last.itemsContainer.items.length < finalSize) {
                            addToGroup(last.itemsContainer, finalSize);
                            this._listView._writeProfilerMark("createChunk,StopTM");
                            return;
                        }
                    }

                    if (this.tree.length < groups.length) {
                        newGroup(groups[this.tree.length]);
                    }

                    this._listView._writeProfilerMark("createChunk,StopTM");
                }
574489
protected void appendToString(StringBuilder sb, ValueCountingAnalyzerResult groupResult, int maxEntries) {
        if (maxEntries != 0) {
            Collection<ValueFrequency> valueCounts = groupResult.getValueCounts();
            for (ValueFrequency valueCount : valueCounts) {
                sb.append("\n - ");
                sb.append(valueCount.getName());
                sb.append(": ");
                sb.append(valueCount.getCount());

                maxEntries--;
                if (maxEntries == 0) {
                    sb.append("\n ...");
                    break;
                }
            }
        }
    }
267683
function updateGroups() {
                        function createGroup(groupInfo, itemsContainer) {
                            var GroupType = (groupInfo.enableCellSpanning ?
                                Groups.CellSpanningGroup :
                                Groups.UniformGroup);
                            return new GroupType(that, itemsContainer);
                        }

                        var oldRealizedItemRange = (that._groups.length > 0 ?
                                that._getRealizationRange() :
                                null),
                            newGroups = [],
                            prepared = [],
                            cleanUpDom = {},
                            newGroupMap = {},
                            currentIndex = 0,
                            len = tree.length,
                            i;

                        for (i = 0; i < len; i++) {
                            var oldChangedRealizedRangeInGroup = null,
                                groupInfo = that._getGroupInfo(i),
                                groupKey = that._site.groupFromIndex(i).key,
                                oldGroup = that._groupMap[groupKey],
                                wasCellSpanning = oldGroup instanceof Groups.CellSpanningGroup,
                                isCellSpanning = groupInfo.enableCellSpanning;

                            if (oldGroup) {
                                if (wasCellSpanning !== isCellSpanning) {
                                    // The group has changed types so DOM needs to be cleaned up
                                    cleanUpDom[groupKey] = true;
                                } else {
                                    // Compute the range of changed items that is within the group's realized range
                                    var firstChangedIndexInGroup = Math.max(0, changedRange.firstIndex - oldGroup.startIndex),
                                        oldRealizedItemRangeInGroup = that._rangeForGroup(oldGroup, oldRealizedItemRange);
                                    if (oldRealizedItemRangeInGroup && firstChangedIndexInGroup <= oldRealizedItemRangeInGroup.lastIndex) {
                                        // The old changed realized range is non-empty
                                        oldChangedRealizedRangeInGroup = {
                                            firstIndex: Math.max(firstChangedIndexInGroup, oldRealizedItemRangeInGroup.firstIndex),
                                            lastIndex: oldRealizedItemRangeInGroup.lastIndex
                                        };
                                    }
                                }
                            }
                            var group = createGroup(groupInfo, tree[i].itemsContainer.element);
                            var prepareLayoutPromise;
                            if (group.prepareLayoutWithCopyOfTree) {
                                prepareLayoutPromise = group.prepareLayoutWithCopyOfTree(copyItemsContainerTree(tree[i].itemsContainer), oldChangedRealizedRangeInGroup, oldGroup, {
                                    groupInfo: groupInfo,
                                    startIndex: currentIndex,
                                });
                            } else {
                                prepareLayoutPromise = group.prepareLayout(getItemsContainerLength(tree[i].itemsContainer), oldChangedRealizedRangeInGroup, oldGroup, {
                                    groupInfo: groupInfo,
                                    startIndex: currentIndex,
                                });
                            }
                            prepared.push(prepareLayoutPromise);

                            currentIndex += group.count;

                            newGroups.push(group);
                            newGroupMap[groupKey] = group;
                        }

                        return Promise.join(prepared).then(function () {
                            var currentOffset = 0;
                            for (var i = 0, len = newGroups.length; i < len; i++) {
                                var group = newGroups[i];
                                group.offset = currentOffset;
                                currentOffset += that._getGroupSize(group);
                            }

                            // Clean up deleted groups
                            Object.keys(that._groupMap).forEach(function (deletedKey) {
                                var skipDomCleanUp = !cleanUpDom[deletedKey];
                                that._groupMap[deletedKey].cleanUp(skipDomCleanUp);
                            });

                            that._groups = newGroups;
                            that._groupMap = newGroupMap;
                        });
                    }
793052
function buildContainerGroups(){
            let container = svg
              .append('g')
                .classed('container-group', true)
                .attr('transform', `translate(${margin.left},${margin.top})`);

            container
              .append('g').classed('x-axis-group', true)
              .append('g').classed('axis x', true);
            container.selectAll('.x-axis-group')
              .append('g').classed('month-axis', true);
            container
              .append('g').classed('y-axis-group', true)
              .append('g').classed('axis y', true);
            container
              .append('g').classed('grid-lines-group', true);
            container
              .append('g').classed('chart-group', true);
            container
              .append('g').classed('metadata-group', true);
        }