original_docstring: 
          Assign the permissions to their associated users/groups
          
docstring: Assign the permissions to their associated users/groups
docstring_tokens: Assign the permissions to their associated users / groups
code: def assign_permissions(self, permissions_map):
          """
          Assign the permissions to their associated users/groups
          """
          assert isinstance(permissions_map, Mapping), (
              'Expected %s.get_permissions_map to return a dict, got %s instead.'
              % (self.__class__.__name__, type(permissions_map).__name__)
          )
          with transaction.atomic():
              for permission, assignees in permissions_map.items():
                  users = [u for u in assignees if isinstance(u, User)]
                  groups = [g for g in assignees if isinstance(g, Group)]
                  for user in users:
                      assign_perm(permission, user, self.instance)
                  for group in groups:
                      assign_perm(permission, group, self.instance)
code_tokens: def assign_permissions ( self , permissions_map ) : assert isinstance ( permissions_map , Mapping ) , ( 'Expected %s.get_permissions_map to return a dict, got %s instead.' % ( self . __class__ . __name__ , type ( permissions_map ) . __name__ ) ) with transaction . atomic ( ) : for permission , assignees in permissions_map . items ( ) : users = [ u for u in assignees if isinstance ( u , User ) ] groups = [ g for g in assignees if isinstance ( g , Group ) ] for user in users : assign_perm ( permission , user , self . instance ) for group in groups : assign_perm ( permission , group , self . instance )
short_docstring: Assign the permissions to their associated users/groups
short_docstring_tokens: Assign the permissions to their associated users / groups
comment: """
          Assign the permissions to their associated users/groups
          """