Create a new group
979631
function createGroup(name, done) {
  return getModels(function(m) {
    return m.collections.group.create({ name }, done);
  });
}
118790
def add_to_group(self, devices):
        """"""
        ids = {d.id for d in self.devices_in_group()}
        ids.update(self._device_ids(devices))
        self._set_group(ids)
34340
def _add_group(self, group, attrs):
        
        self.handle.create_group(group)
        if attrs is not None:
            self._add_attributes(group, attrs)
1214464
function CreateGroup(
      $id = '',
      $name = '',
      $description = ''
  ) {
      if ("" != trim($name)) {
          $group_id = $id;
          if (('' == $group_id) || ('0' == $group_id)) {
              $group_id = bigdec2hex((time()-mktime(1,1,1,1,1,2000)).mt_rand(10000,99999));
          }
          if ($this->CheckGroupExists($group_id)) {
              return FALSE; // ERROR: group already exists.
          } else {
              $this->SetGroup($group_id);
              $this->SetGroupName(trim($name));
              $this->SetGroupDescription($description);
              return $this->WriteGroupData();
          }
      } else {
          return TRUE;
      }
  }
1302472
def create_auth_group(sender, instance, created, **kwargs):
    
    if created:
        AuthGroup.objects.create(group=instance)
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`);
  }
}
62757
def add_group(self, number, name, led_type):
        
        group = group_factory(self, number, name, led_type)
        self.groups.append(group)
        return group
1048421
def create(self):
        """"""
        add_button = QPushButton('New')
        add_button.clicked.connect(self.new_group)
        color_button = QPushButton('Color')
        color_button.clicked.connect(self.color_group)
        del_button = QPushButton('Delete')
        del_button.clicked.connect(self.del_group)
        apply_button = QPushButton('Apply')
        apply_button.clicked.connect(self.apply)

        self.button_add = add_button
        self.button_color = color_button
        self.button_del = del_button
        self.button_apply = apply_button

        buttons = QGridLayout()
        buttons.addWidget(add_button, 0, 0)
        buttons.addWidget(color_button, 1, 0)
        buttons.addWidget(del_button, 0, 1)
        buttons.addWidget(apply_button, 1, 1)

        self.tabs = QTabWidget()

        layout = QVBoxLayout()
        layout.addLayout(buttons)
        layout.addWidget(self.tabs)

        self.setLayout(layout)

        self.setEnabled(False)
        self.button_color.setEnabled(False)
        self.button_del.setEnabled(False)
        self.button_apply.setEnabled(False)
289389
def create_group(groupname, gid, system=True):
    
    sudo(addgroup(groupname, gid, system))
1323773
function add_group() {
    server.EntryGroupNew(function(err, path) {
      if (err) {
        sails.log.error('DBus: Could not call org.freedesktop.Avahi.Server.EntryGroupNew');
        return;
      }
      service.getInterface(
        path,
        avahi.DBUS_INTERFACE_ENTRY_GROUP.value,
        function (
          err,
          newGroup
        ) {
          group = newGroup;
          add_service();
        }
      )
    });
  }
401086
def usergroups_create(self, *, name: str, **kwargs) -> SlackResponse:
        
        self._validate_xoxp_token()
        kwargs.update({"name": name})
        return self.api_call("usergroups.create", json=kwargs)
905155
def create_groups(orientations, *groups, **kwargs):
    
    grouped = []
    # Copy all datasets to be safe (this could be bad for
    # memory usage, so can be disabled).
    if kwargs.pop('copy', True):
        orientations = [copy(o) for o in orientations]

    for o in orientations:
        # Get rid of and recreate group membership
        o.member_of = None
        try:
            grouped += o.members
            for a in o.members:
                a.member_of = o
        except AttributeError:
            pass

    def find(uid):
        try:
            val = next(x for x in orientations if x.hash == uid)
            if val in grouped:
                raise GroupedPlaneError("{} is already in a group."
                                           .format(val.hash))
            return val
        except StopIteration:
            raise KeyError("No measurement of with hash {} found"
                           .format(uid))

    for uid_list in groups:
        vals = [find(uid) for uid in uid_list]
        o = GroupedOrientation(*vals, **kwargs)
        orientations.append(o)

    return orientations
981215
def create_usuario_grupo(self):
        """"""
        return UsuarioGrupo(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
542993
def add_group(self, name, desc, status):
        

        existing_group = get_session().query(ResourceGroup).filter(ResourceGroup.name==name, ResourceGroup.network_id==self.id).first()
        if existing_group is not None:
            raise HydraError("A resource group with name %s is already in network %s"%(name, self.id))

        group_i             = ResourceGroup()
        group_i.name        = name
        group_i.description = desc
        group_i.status      = status

        get_session().add(group_i)

        self.resourcegroups.append(group_i)


        return group_i
1057082
@Override
    public CommandGroup createCommandGroup(String groupId, Object[] members) {
		return createCommandGroup(groupId, members, false, null);
	}
955328
def create_groups(self, *names, **kwargs):
        """"""
        return tuple(self.create_group(name, **kwargs) for name in names)
877045
async def create(gc: GroupControl, name, slaves):
    """"""
    click.echo("Creating group %s with slaves: %s" % (name, slaves))
    click.echo(await gc.create(name, slaves))