Args:
            group_id: group ID

        Returns: Group
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
647576
def groupfinder(userid, request):
    
    if userid and hasattr(request, "user") and request.user:
        groups = ["group:%s" % g.id for g in request.user.groups]
        return groups
    return []
1067833
def has_obsgroup_id(self, group_id):
        
        self.con.execute('SELECT 1 FROM archive_obs_groups WHERE publicId = %s', (group_id,))
        return len(self.con.fetchall()) > 0
1048419
def get_group_id(groupname):
    
    gid = single_line_stdout('id -g {0}'.format(groupname), expected_errors=(1,), shell=False)
    return check_int(gid)
583900
def get_securitygroup(self, group_id, **kwargs):
        
        if 'mask' not in kwargs:
            kwargs['mask'] = (
                'id,'
                'name,'
                'description,'
                '''rules[id, remoteIp, remoteGroupId,
                         direction, ethertype, portRangeMin,
                         portRangeMax, protocol, createDate, modifyDate],'''
                '''networkComponentBindings[
                    networkComponent[
                        id,
                        port,
                        guest[
                            id,
                            hostname,
                            primaryBackendIpAddress,
                            primaryIpAddress
                        ]
                    ]
                ]'''
            )

        return self.security_group.getObject(id=group_id, **kwargs)
590071
def GroupsDelete(self, group_id):
        
        if self.__SenseApiCall__('/groups/{0}.json'.format(group_id), 'DELETE'):
            return True
        else:
            self.__error__ = "api call unsuccessful"
            return False
831678
def cli(ctx, group_id, new_name):
    
    return ctx.gi.groups.update_group(group_id, new_name)
302730
def get_group(group_or_groupname):
    
    if not group_or_groupname:

        return None
    if hasattr(group_or_groupname, "_getGroup"):
        return group_or_groupname
    gtool = get_tool("portal_groups")
    return gtool.getGroupById(group_or_groupname)
942481
def gid
      return group.kind_of?(Integer) ? group : Etc.getgrnam(group.to_s).gid if group
      return Etc.getpwuid(uid).gid if using_login?
      nil
    end
1289702
def getgroupmembers(self, group_id, page=1, per_page=20):
        
        data = {'page': page, 'per_page': per_page}

        request = requests.get(
            '{0}/{1}/members'.format(self.groups_url, group_id), params=data,
            headers=self.headers, verify=self.verify_ssl, auth=self.auth, timeout=self.timeout)

        if request.status_code == 200:
            return request.json()
        else:
            return False
886976
def delete_group(self, group_id):
        
        route_values = {}
        if group_id is not None:
            route_values['groupId'] = self._serialize.url('group_id', group_id, 'str')
        self._send(http_method='DELETE',
                   location_id='5966283b-4196-4d57-9211-1b68f41ec1c2',
                   version='5.0',
                   route_values=route_values)
632111
def group(group_id)
      data = request("/group/show", id: group_id)
      Hashie::Mash.new(data["group"])
    end
391876
def getReadGroup(self, id_):
        
        if id_ not in self._readGroupIdMap:
            raise exceptions.ReadGroupNotFoundException(id_)
        return self._readGroupIdMap[id_]
1348790
def get_folder_groups(self, id, group_id):
        
        path = {}
        data = {}
        params = {}

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

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

        self.logger.debug("GET /api/v1/groups/{group_id}/folders/{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}/folders/{id}".format(**path), data=data, params=params, single_item=True)
1359308
def get_security_group_id(self, name):
        
        # Memoize entire list of groups
        if not hasattr(self, '_security_groups'):
            self._security_groups = {}
            for group in self.get_all_security_groups():
                self._security_groups[group.name] = group.id
        return self._security_groups[name]
1030604
function set_group($group_id)
    {
        if ($group_id) {
            $this->group_id = $group_id;
            $this->group_data = $this->get_group_entry($group_id);
        }
        else {
            $this->group_id = 0;
            $this->group_data = null;
        }
    }
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'))