def massage_permissions(document):
  read_perms = document.list_permissions(perm='read')
  write_perms = document.list_permissions(perm='write')
  return {
    'perms': {
        'read': {
          'users': [{'id': perm_user.id, 'username': perm_user.username} \
                     for perm_user in read_perms.users.all()],
          'groups': [{'id': perm_group.id, 'name': perm_group.name} \
                     for perm_group in read_perms.groups.all()]
        },
        'write': {
          'users': [{'id': perm_user.id, 'username': perm_user.username} \
                     for perm_user in write_perms.users.all()],
          'groups': [{'id': perm_group.id, 'name': perm_group.name} \
                     for perm_group in write_perms.groups.all()]
        }
      }
    }
Return a 1-tuple: (args list).
dataset/ETHPy150Open cloudera/hue/desktop/core/src/desktop/api.py/massage_permissions--crossover with--dataset/ETHPy150Open yuhaozhang/nnjm-global/code/train_nnjm_gplus.py/process_command_line