Create a group.

        :type group_name: string
        :param group_name: The name of the new group

        :type path: string
        :param path: The path to the group (Optional).  Defaults to /.
436844
def create_group(self, group_name, path='/'):
        
        params = {'GroupName' : group_name,
                  'Path' : path}
        return self.get_response('CreateGroup', params)
940235
public GitlabGroup createGroup(String name, String path) throws IOException {
        return createGroup(name, path, null, null, null);
    }
956939
def create_group(self, name):
        
        parameters = {
            'name': name
        }

        url = self.TEAM_GROUPS_URL

        connection = Connection(self.token)
        connection.set_url(self.production, url)
        connection.add_params(parameters)

        return connection.post_request()
1233996
def update_group(self, group_id, new_name):
        
        data = {
            'id': group_id,
            'name': new_name,
        }
        try:
            response = self.post('updateGroup', data)
        except Exception:
            pass

        # Apollo returns a 404 here for some unholy reason, despite actually
        # renaming the group.
        response = self.post('loadGroups', {'groupId': group_id})[0]
        return _fix_group(response)
1296556
def xgroup_setid(self, name, groupname, id):
        
        return self.execute_command('XGROUP SETID', name, groupname, id)
1081862
def create_group(self, **kwargs):
        
        response = self.__requester.request(
            'POST',
            'groups',
            _kwargs=combine_kwargs(**kwargs)
        )
        return Group(self.__requester, response.json())
1259448
def add_group(self, groupname, statements):
		
		msg = OmapiMessage.open(b"group")
		msg.message.append(("create", struct.pack("!I", 1)))
		msg.obj.append(("name", groupname))
		msg.obj.append(("statements", statements))
		response = self.query_server(msg)
		if response.opcode != OMAPI_OP_UPDATE:
			raise OmapiError("add group failed")
1052725
def group_membership_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/group_memberships.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
1306162
def path(self, path: str):
        

        path = path if path else ''
        self.pathName = os.path.join(path, self.name)
293081
def create_securitygroup(self, name=None, description=None):
        

        create_dict = {'name': name, 'description': description}
        return self.security_group.createObject(create_dict)
1126917
def set_group_name(self, group, old_name, new_name):
        
        lgroup = self._get_group(old_name)
        rename(lgroup, database=self._database, cn=new_name)
176891
def setGroups(self, *args, **kwargs):
        

        requests = 0
        groups = []
        try:
            for gk in self['groupKeys']:
                try:
                    g = self.mambugroupclass(entid=gk, *args, **kwargs)
                except AttributeError as ae:
                    from .mambugroup import MambuGroup
                    self.mambugroupclass = MambuGroup
                    g = self.mambugroupclass(entid=gk, *args, **kwargs)
                requests += 1
                groups.append(g)
        except KeyError:
            pass

        self['groups'] = groups

        return requests
1187161
def add_group(self, name, devices):
        
        device = self.add_device(name, "group")
        device.add_to_group(devices)
        return device
831678
def cli(ctx, group_id, new_name):
    
    return ctx.gi.groups.update_group(group_id, new_name)
1212073
def _groupname():
    '''
    
    '''
    if grp:
        try:
            groupname = grp.getgrgid(os.getgid()).gr_name
        except KeyError:
            groupname = ''
    else:
        groupname = ''

    return groupname
796267
def create(cls, api, default_name=None, description=None):
        
        path = 'group'

        data = {}
        if default_name:
            data['default_group_name'] = default_name
        if description:
            data['description'] = description
        if api.domain:
            data['domain'] = api.domain

        response_data = api.request(path, data=data)

        id = response_data['group_id']
        group = cls(api, id)
        group.default_name = response_data['default_group_name']

        return group
646593
def add_user_to_group(self, user, group_name):
        
        group, _ = Group.objects.get_or_create(name = group_name)
        group.user_set.add(user)