/*
Group Support
552301
function (key, devices) {
    if (_.isUndefined(devices)) { // Just create group without any device.
      refs.userGroups.child(key).set(false, function (err) {
        if (!err) debug('Empty group created: ', key);
      });
    } else {
      refs.userGroups.child(key).set(devices);
    }
  }
1221028
function (conf) {
        var slot, set;
        try {
            if (!conf.preserveId) {
                conf = scrubConf(conf);
            }
            slot = Slot(conf);
            masterGroup.add(slot);
            if (slot.group) {
                set = [].concat(slot.group);
                set.forEach(function (groupName) {
                    var group = GroupFactory.create(groupName);
                    group.add(slot);
                });
            }
        } catch (err) {
            log('error', {
                conf: conf,
                msg: err.message
            });
        } finally {
            return slot || null;
        }
    }
170326
function(groupName, resources, callback) {
        this.resourceGroupExists(groupName, function onGroupExistsResponse(err, exists) {
            if (err) {
                return callback(err);
            }

            if (exists) {
                return callback(new Error(
                    'Resource group `' + groupName + '` already exists'
                ));
            }

            this.editResourceGroup(groupName, resources, callback);
        }.bind(this));

        return this;
    }
116077
function(bottomGroup) {
		var selectedGroups = [];
		this.selectedGroups = selectedGroups;
	
		var display = this.display;
		display.groupSelect.innerHTML = "";
		var selectedGroup = this.selectedGroup;
	
		WireIt.GroupUtils.getOuterGroup(bottomGroup, function(current) {
			var option = WireIt.cn("option", {value: "N" + selectedGroups.length}, {}, "N" + selectedGroups.length);
			selectedGroups.push(current);
		
			display.groupSelect.appendChild(option);
		
			if (selectedGroup == current)
		    	option.selected = true;
	    	}
	    );
   }
838675
function callbackGroupStatusChange(?\CharlotteDunois\Yasmin\Models\Guild $guild, \CharlotteDunois\Livia\Commands\CommandGroup $group, bool $enabled) {
        if(!empty($this->setup[$this->getGuildID($guild)])) {
            return;
        }
        
        $this->set($guild, 'group-'.$group->id, $enabled);
    }
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`);
  }
}
609553
function parseItemOrGroup(tokenizer) {
  var tkn = tokenizer.next();
  if (!tkn) return null;
  if (tkn.typ == '{') {
    return parseGroup(tokenizer);
  }
  return {tag: tkn.typ, children: tkn.txt};
}
579339
function (handler, group, callback) {

    if (typeof group === 'function') {
      callback = group;
      group = undefined;
    }

    const validation = cache.get(constant.SYSTEM_DB_VALIDATOR).filter(item => {
      return item.group === (group || handler.req.path);
    });

    async.mapSeries(validation, (item, next) => {

      const func = rule[item.rule];
      if (func) {
        return func.call(this, handler, item, next);
      }

      log.debug('Rule does not define : ' + item.rule);
      next();
    }, (err, result) => {
      if (err) {
        return callback(err);
      }

      result = _.compact(_.flatten(result));
      if (_.isEmpty(result)) {
        return callback();
      }

      log.info(result);
      callback(new error.ParamError(), result);
    });
  }
1222293
function isGroupResult(item) {
  log.trace('isGroupResult(%j)', item);

  if (! item) return(false);
  if (item.groupType) return(true);
  if (item.objectCategory) {
    re.isGroupResult.lastIndex = 0; // Reset the regular expression
    return(re.isGroupResult.test(item.objectCategory));
  }
  if ((item.objectClass) && (item.objectClass.length > 0)) {
    return(_.any(item.objectClass, function(c) { return(c.toLowerCase() === 'group'); }));
  }
  return(false);
}
846171
function ButtonGroup({ children, className, ...rest }) {
  const classes = cx(buttonGroupClassName, className)
  return (
    <div className={classes} {...rest}>
      {children}
    </div>
  )
}
133840
def group_show(self, id, **kwargs):
        ""
        api_path = "/api/v2/groups/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
637973
function resetGroup(groupName) {

    var vivalidGroup = groupNameToVivalidGroup[groupName];

    if (vivalidGroup) {
        vivalidGroup.reset();
    } else {
        console.log('could not find group named ' + groupName);
    }

}
1368457
private boolean updateGroup(String groupId, GroupConfig groupConfig) {
        return client
            .updateGroup(
                groupId,
                converter.createUpdateGroupRequest(
                    groupConfig,
                    groupConfig.getParentGroup() != null ? idByRef(groupConfig.getParentGroup()) : null,
                    groupConfig.getCustomFields() == null || groupConfig.getCustomFields().size() == 0 ?
                        null : client.getCustomFields())
            );
    }
249832
function composeAddRemoveGroupMember({ action="add", roles="members" }) {
  /**
   * Add/Remove user from group
   *
   * @param {String} username
   * @param {String} groupname
   * @param {Function} done - done(err)
   */
   return function(username, groupname, done) {
     return getGroup(groupname, function(getGroupErr, group) {
       if (getGroupErr) {
         return done(getGroupErr);
       }

       if (!group) {
         return done(new Error(`group '${groupname}' not found`));
       }

       return getUser(username, function(getUserErr, user) {
         if (getUserErr) {
           return done(getUserErr);
         }

         if (!user) {
           return done(new Error(`user '${username}' not found`));
         }

         group[roles][action](user.id);
         return group.save(done);
       });
     });
   };
}
338527
public function group($name, $settings = null, $callback = null)
    {
        if($this->cacheLoaded) {
            return true;
        }

        $groupName = trim($name, '/');
        $group = [];
        $group['route'] = '/' . $groupName;
        $group['before'] = $group['after'] = null;

        if (is_null($callback)) {
            $callback = $settings;
        } else {
            $group['before'][] = (!isset($settings['before']) ? null : $settings['before']);
            $group['after'][]  = (!isset($settings['after']) ? null : $settings['after']);
        }

        $groupCount = count($this->groups);
        if ($groupCount > 0) {
            $list = [];
            foreach ($this->groups as $key => $value) {
                if (is_array($value['before'])) {
                    foreach ($value['before'] as $k => $v) {
                        $list['before'][] = $v;
                    }
                    foreach ($value['after'] as $k => $v) {
                        $list['after'][] = $v;
                    }
                }
            }

            if (! is_null($group['before'])) {
                $list['before'][] = $group['before'][0];
            }

            if (! is_null($group['after'])) {
                $list['after'][] = $group['after'][0];
            }

            $group['before'] = $list['before'];
            $group['after'] = $list['after'];
        }

        $group['before'] = array_values(array_unique( (array) $group['before']));
        $group['after'] = array_values(array_unique( (array) $group['after']));

        array_push($this->groups, $group);

        if (is_object($callback)) {
            call_user_func_array($callback, [$this]);
        }

        $this->endGroup();

        return true;
    }
191471
function startGroup(&$group, $required, $error) 
    {
        $this->_currentGroup = $this->_elementToObject($group, $required, $error);
        if(!empty($error)) {
            $name = $this->_currentGroup->name;
            $this->_obj->errors->$name = $error;
        }
    }
296136
public function group()
    {
        $args = func_get_args();
        $route = array_shift($args);
        $callable = array_pop($args);
        if (is_string($route) && is_callable($callable)) {
            call_user_func($callable, $route);
        }
    }