Leave a group.

        Leave a group if you are allowed to leave (some groups, such as sets of
        course groups created by teachers, cannot be left). You may also use 'self'
        in place of a membership_id.
186958
def leave_group_memberships(self, group_id, membership_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - group_id
        """ID"""
        path["group_id"] = group_id

        # REQUIRED - PATH - membership_id
        """ID"""
        path["membership_id"] = membership_id

        self.logger.debug("DELETE /api/v1/groups/{group_id}/memberships/{membership_id} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("DELETE", "/api/v1/groups/{group_id}/memberships/{membership_id}".format(**path), data=data, params=params, no_data=True)
218023
def remove_user_from_group(self, username, groupname):
        
        url = self._options['server'] + '/rest/api/latest/group/user'
        x = {'groupname': groupname,
             'username': username}

        self._session.delete(url, params=x)

        return True
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)
1077240
def _delUserFromGroup(self, username, group="Clients"):
        
        portal_groups = api.portal.get_tool("portal_groups")
        group = portal_groups.getGroupById(group)
        group.removeMember(username)
1168878
def groups_close(self, room_id, **kwargs):
        """"""
        return self.__call_api_post('groups.close', roomId=room_id, kwargs=kwargs)
501494
public final void mGROUP() throws RecognitionException {
		try {
			int _type = GROUP;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// hql.g:31:7: ( 'group' )
			// hql.g:31:9: 'group'
			{
			match("group"); if (state.failed) return;

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
1082852
public boolean deleteGroup(String name)
	{
		if (ADMINISTRATOR_GROUP_ID.equals(name))
		{
			throw new SystemException(String.format("Cannot delete '%s' group.", ADMINISTRATOR_GROUP_ID));
		}

		if (USER_GROUP_ID.equals(name))
		{
			throw new SystemException(String.format("Cannot delete '%s' group.", USER_GROUP_ID));
		}

		if (!isGroupExist(name))
		{
			throw new SystemException(String.format("Group '%s' does not exist.", name));
		}

		if (getGroupUserCount(name) > 0)
		{
			throw new SystemException("Cannot delete a group containing users.");
		}

		return allGroups.remove(name);
	}
950985
def remove_group(self, group):
        
        if not isinstance(group, Group):
            raise TypeError("group must be Group")
        if group not in self.groups:
            raise ValueError("Group doesn't exist / is not bound to this database.")
        
        #save num entries and children before removal to avoid for loop problems
        num_entries = len(group.entries)
        for i in xrange(num_entries):
            self.remove_entry(group.entries[0])

        # Recurse down to remove sub-groups
        num_children = len(group.children)
        for i in xrange(num_children): # We may need to copy this to avoid CME (see below)
            self.remove_group(group.children[0])
        
        # Finally remove group from the parent's list.
        group.parent.children.remove(group) # Concurrent modification exception? Parent in recursive stack is iterating ...
        self.groups.remove(group)
917300
public void removeGroup(int removed) {
        List<L> cards = getGroups();
        if (removed >= 0 && removed < cards.size()) {
            boolean changed = cards.remove(removed) != null;
            if (changed) {
                setData(cards);
            }
        }
    }
64457
private function adminDeleteGroup()
    {
        $id = arg('group_delete', 'int');
        /* @var Gallery_Entity_Table_Group $table */
        $table = ORM::getTable($this, 'Group');
        $group = $table->find($id);
        $table->delete($group);

        HTTP::goback();
    }
984437
public void removeGroup(@Nullable L group) {
        if (group == null) {
            return;
        }
        List<L> cards = getGroups();
        boolean changed = cards.remove(group);
        if (changed) {
            setData(cards);
        }
    }
18857
def move_group(self, group = None, parent = None):
        

        if group is None or type(group) is not v1Group:
            raise KPError("A valid group must be given.")
        elif parent is not None and type(parent) is not v1Group:
            raise KPError("parent must be a v1Group.")
        elif group is parent:
            raise KPError("group and parent must not be the same group")
        if parent is None:
            parent = self.root_group
        if group in self.groups:
            self.groups.remove(group)
            group.parent.children.remove(group)
            group.parent = parent
            if parent.children:
                if parent.children[-1] is self.groups[-1]:
                    self.groups.append(group)
                else:
                    new_index = self.groups.index(parent.children[-1]) + 1
                    self.groups.insert(new_index, group)
            else:
                new_index = self.groups.index(parent) + 1
                self.groups.insert(new_index, group)
            parent.children.append(group)
            if parent is self.root_group:
                group.level = 0
            else:
                group.level = parent.level + 1
            if group.children:
                self._move_group_helper(group)
            group.last_mod = datetime.now().replace(microsecond=0)
            return True
        else:
            raise KPError("Didn't find given group.")
377829
void doGroupEnd(String group, Object args) {
    checkOpen();
    JsonObject message = createMessage(args)
        .putString("action", "endGroup")
        .putString("group", group);
    if (open && !paused) {
      if (log.isDebugEnabled()) {
        log.debug(String.format("%s - Group end: Group[group=%s, args=%s]", this, group, args));
      }
      eventBus.send(inAddress, message);
    }
    groups.remove(group);
  }
1142371
def remove_member(self, member_id):
        
        member_rm_request = etcdrpc.MemberRemoveRequest(ID=member_id)
        self.clusterstub.MemberRemove(
            member_rm_request,
            self.timeout,
            credentials=self.call_credentials,
            metadata=self.metadata
        )
1185166
def remove_groups_from_user(id, group_list = [])
      wf_user_id?(id)
      validate_usergroup_list(group_list)
      api.post([id, 'removeUserGroups'].uri_concat, group_list,
               'application/json')
    end
932437
def group_memberships_assignable(self, group_id, **kwargs):
        ""
        api_path = "/api/v2/groups/{group_id}/memberships/assignable.json"
        api_path = api_path.format(group_id=group_id)
        return self.call(api_path, **kwargs)
1199812
public function leaveGroup($groupId)
	{
		$token = $this->oauth->getToken();

		// Set parameters.
		$parameters = array(
			'oauth_token' => $token['key'],
		);

		// Set the success response code.
		$this->oauth->setOption('success_code', 204);

		// Set the API base
		$base = '/v1/people/~/group-memberships/' . $groupId;

		// Build the request path.
		$path = $this->getOption('api.url') . $base;

		// Send the request.
		$response = $this->oauth->oauthRequest($path, 'DELETE', $parameters);

		return $response;
	}