Get a single group membership.

        Returns the group membership with the given membership id or user id.
338453
def get_single_group_membership_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("GET /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("GET", "/api/v1/groups/{group_id}/memberships/{membership_id}".format(**path), data=data, params=params, single_item=True)
975367
def get_members(self, sort='id_asc'):
        
        return self._session.fetch_items("groups.getMembers", User.from_json, 1000, group_id=self.id, sort=sort, fields=User.__slots__ + User.USER_FIELDS)
601662
def GetGroupUUID(group,alias=None,location=None):
		
		if alias is None:  alias = clc.v1.Account.GetAlias()
		if location is None:  location = clc.v1.Account.GetLocation()
		r = Group.GetGroups(location,alias)
		for row in r:
			if row['Name'] == group:  return(row['UUID'])
		else:
			if clc.args:  clc.v1.output.Status("ERROR",3,"Group %s not found in account %s datacenter %s" % (group,alias,location))
			raise Exception("Group not found")
399590
def get_member(self, username, api=None):
        
        member = Transform.to_automation_member(username)
        api = api or self._API
        return AutomationMember.get(
            id=member, automation=self.id, api=api
        )
402846
def get_groups_by_userid(cls, userid, request):
        
        try:
            cache_request_user(cls, request, userid)
        except Exception as ex:
            log.error(str(ex))
            forget(request)
        else:
            if request._user:
                return ['g:%s' % g for g in request._user.groups]
648834
public List<OrganizationMembership> getOrganizationMembershipByUser(long user_id) {
	return complete(submit(req("GET", tmpl("/users/{user_id}/organization_memberships.json").set("user_id", user_id)),
		handleList(OrganizationMembership.class, "organization_memberships")));
    }
548515
public function member($group_id, $user = null)
	{
		// if it's not a group id, fetch it from the object
		if ( ! is_numeric($group_id))
		{
			$group_id = $group_id->id;
		}

		// do we know this group?
		if (isset(static::$_valid_groups[$group_id]))
		{
			// if no user is given
			if ($user === null)
			{
				// get the groups of the logged-in user
				$groups = \Auth::instance()->get_groups();
			}
			else
			{
				// get the groups if the given user instance
				$groups = \Auth::instance($user[0])->get_groups();
			}

			// if no group info could be retrieved, the user can't be a member
			if ( ! $groups)
			{
				return false;
			}

			// check for membership
			foreach($groups as $group)
			{
				if ($group[0] === $this->id and $group_id === (int) $group[1]->id)
				{
					return true;
				}
			}
		}

		return false;
	}
739316
def user_group_membership_show(self, user_id, id, **kwargs):
        ""
        api_path = "/api/v2/users/{user_id}/group_memberships/{id}.json"
        api_path = api_path.format(user_id=user_id, id=id)
        return self.call(api_path, **kwargs)
420632
@SuppressWarnings("unchecked")
    @Override
	public <T extends ApiUser> List<T> getUsersInGroup(String groupId) {
	    Collection<User> sfsUsers = getZone().getUsersInGroup(groupId);
	    List<T> anwser = new ArrayList<>();
	    for(User sfsUser : sfsUsers)
	        if(sfsUser.containsProperty(APIKey.USER))
	            anwser.add((T) sfsUser.getProperty(APIKey.USER));
	    return anwser;
	}
496711
def get_group_by_id(self, group_id) -> typing.Optional['Group']:
        
        VALID_POSITIVE_INT.validate(group_id, 'get_group_by_id')
        for group in self.groups:

            if group.group_id == group_id:
                return group

        return None
1352415
private Collection<Membership> findMembershipsByUserAndGroup(Session session, String userName, String groupId) throws Exception
   {
      Node groupNode;
      Node refUserNode;

      try
      {
         groupNode = utils.getGroupNode(session, groupId);
         refUserNode = groupNode.getNode(JCROrganizationServiceImpl.JOS_MEMBERSHIP).getNode(userName);
      }
      catch (PathNotFoundException e)
      {
         return new ArrayList<Membership>();
      }

      return findMembershipsByUserAndGroup(session, refUserNode, groupNode);
   }
1190919
public User getUserById(Integer userId) throws RedmineException {
        return transport.getObject(User.class, userId, new BasicNameValuePair(
                "include", "memberships,groups"));
    }
1088740
@RequestMapping(value = "/{groupId}/users", method = RequestMethod.GET)
    public ResponseEntity<Set<User>> findUsersOfGroup(@PathVariable Integer groupId) {

        try {
            Set<User> groupUsersSet = this.service.getUsersOfGroup(groupId);
            return new ResponseEntity<Set<User>>(groupUsersSet, HttpStatus.OK);
        } catch (Exception e) {
            LOG.error("Error finding group with id " + groupId + ": "
                + e.getMessage());
            return new ResponseEntity<Set<User>>(HttpStatus.NOT_FOUND);
        }
    }
710907
def get_group(self, group_name):
        
        response = self.client.get_group(GroupName=group_name,
                                         UserPoolId=self.user_pool_id)
        return self.get_group_obj(response.get('Group'))
100542
def get_group(self, group_id):
        
        response = self._do_request(
            'GET', '/v2/groups/{group_id}'.format(group_id=group_id))
        return self._parse_response(response, MarathonGroup)
505322
def get_group_members(self, group):
        

        conn = self.bind
        try:
            records = conn.search_s(
                current_app.config['LDAP_BASE_DN'], ldap.SCOPE_SUBTREE,
                ldap_filter.filter_format(
                    current_app.config['LDAP_GROUP_OBJECT_FILTER'], (group,)),
                [current_app.config['LDAP_GROUP_MEMBERS_FIELD']])
            conn.unbind_s()
            if records:
                if current_app.config['LDAP_GROUP_MEMBERS_FIELD'] in \
                        records[0][1]:
                    members = records[0][1][
                        current_app.config['LDAP_GROUP_MEMBERS_FIELD']]
                    if sys.version_info[0] > 2:
                        members = [m.decode('utf-8') for m in members]
                    return members
        except ldap.LDAPError as e:
            raise LDAPException(self.error(e.args))
246942
public ManagementVertex getGroupMember(final int index) {

		if (index < this.groupMembers.size()) {
			return this.groupMembers.get(index);
		}

		return null;
	}