#NEWLINE# def get_owner_arg_list( session , permission , argument , owners_by_arg_by_perm = None ) : #NEWLINE# #INDENT# 'Return the grouper group(s) responsible for approving a request for the\n    given permission + argument along with the actual argument they were\n    granted.\n\n    Args:\n        session(sqlalchemy.orm.session.Session): database session\n        permission(models.Permission): permission in question\n        argument(str): argument for the permission\n    Returns:\n        list of 2-tuple of (group, argument) where group is the models.Group\n        grouper groups responsibile for permimssion+argument and argument is\n        the argument actually granted to that group. can be empty.\n    ' #NEWLINE# if ( owners_by_arg_by_perm is None ) : #NEWLINE# #INDENT# owners_by_arg_by_perm = get_owners_by_grantable_permission ( session ) #NEWLINE# #UNINDENT# all_owner_arg_list = [ ] #NEWLINE# owners_by_arg = owners_by_arg_by_perm [ permission . name ] #NEWLINE# for ( arg , owners ) in owners_by_arg . items ( ) : #NEWLINE# #INDENT# if fnmatch ( argument , arg ) : #NEWLINE# #INDENT# all_owner_arg_list += [ ( owners_by_arg_by_perm , arg ) for owner in owners ] #NEWLINE# #UNINDENT# #UNINDENT# return all_owner_arg_list