nodes: 0, module; 1, function_definition; 2, function_name:get_model_perms; 3, parameters; 4, block; 5, identifier:model; 6, expression_statement; 7, import_from_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, return_statement; 13, comment:"""
      Get permission-string list of a specified django model.
  
      Parameters
      ----------
      model : model class
          A model class to specify the particular django model.
  
      Returns
      -------
      set
          A set of perms of the specified django model.
  
      Examples
      --------
      >>> sorted(get_model_perms(Permission)) == [
      ...     'auth.add_permission',
      ...     'auth.change_permission',
      ...     'auth.delete_permission'
      ... ]
      True
      """; 14, dotted_name; 15, dotted_name; 16, assignment; 17, assignment; 18, assignment; 19, assignment; 20, call; 21, identifier:django; 22, identifier:contrib; 23, identifier:auth; 24, identifier:models; 25, identifier:Permission; 26, identifier:app_label; 27, attribute; 28, identifier:model_name; 29, call; 30, identifier:qs; 31, call; 32, identifier:perms; 33, generator_expression; 34, identifier:set; 35, argument_list; 36, attribute; 37, identifier:app_label; 38, attribute; 39, argument_list; 40, attribute; 41, argument_list; 42, binary_operator:'%s.%s' % (app_label, p.codename); 43, for_in_clause; 44, identifier:perms; 45, identifier:model; 46, identifier:_meta; 47, attribute; 48, identifier:lower; 49, attribute; 50, identifier:filter; 51, keyword_argument; 52, keyword_argument; 53, string; 54, tuple; 55, identifier:p; 56, call; 57, attribute; 58, identifier:object_name; 59, identifier:Permission; 60, identifier:objects; 61, identifier:content_type__app_label; 62, identifier:app_label; 63, identifier:content_type__model; 64, identifier:model_name; 65, string_content:%s.%s; 66, identifier:app_label; 67, attribute; 68, attribute; 69, argument_list; 70, identifier:model; 71, identifier:_meta; 72, identifier:p; 73, identifier:codename; 74, identifier:qs; 75, identifier:iterator
code: def get_model_perms(model):
      """
      Get permission-string list of a specified django model.
  
      Parameters
      ----------
      model : model class
          A model class to specify the particular django model.
  
      Returns
      -------
      set
          A set of perms of the specified django model.
  
      Examples
      --------
      >>> sorted(get_model_perms(Permission)) == [
      ...     'auth.add_permission',
      ...     'auth.change_permission',
      ...     'auth.delete_permission'
      ... ]
      True
      """
      from django.contrib.auth.models import Permission
      app_label = model._meta.app_label
      model_name = model._meta.object_name.lower()
      qs = Permission.objects.filter(content_type__app_label=app_label,
                                     content_type__model=model_name)
      perms = ('%s.%s' % (app_label, p.codename) for p in qs.iterator())
      return set(perms)