def get_project_groups_roles(request, project):
 groups_roles = collections.defaultdict(list)
 project_role_assignments = role_assignments_list(request, project=project)
 for role_assignment in project_role_assignments:
  if (not hasattr(role_assignment, 'group')):
   continue
  group_id = role_assignment.group['id']
  role_id = role_assignment.role['id']
  if (('project' in role_assignment.scope) and (role_assignment.scope['project']['id'] == project)):
   groups_roles[group_id].append(role_id)
 return groups_roles

def get_project_groups_roles ( request , project ) : groups_roles = collections . defaultdict ( list ) project_role_assignments = role_assignments_list ( request , project = project ) for role_assignment in project_role_assignments : if ( not hasattr ( role_assignment , 'group' ) ) : continue group_id = role_assignment . group [ 'id' ] role_id = role_assignment . role [ 'id' ] if ( ( 'project' in role_assignment . scope ) and ( role_assignment . scope [ 'project' ] [ 'id' ] == project ) ) : groups_roles [ group_id ] . append ( role_id ) return groups_roles
gets the groups roles in a given project .