docs: def handle_sap(q):
      question_votes = votes = Answer.objects.filter(question=q)
      users = q.get_users_voted()
      num_users_votes = {u.id: votes.filter(user=u).count() for u in users}
      user_scale = {u.id: (1 / num_users_votes[u.id]) for u in users}
      choices = []
      for c in q.choice_set.all().order_by("num"):
          votes = question_votes.filter(choice=c)
          vote_users = set([v.user for v in votes])
          choice = {
              "choice": c,
              "votes": {
                  "total": {
                      "all": len(vote_users),
                      "all_percent": perc(len(vote_users), users.count()),
                      "male": fmt(sum([v.user.is_male * user_scale[v.user.id] for v in votes])),
                      "female": fmt(sum([v.user.is_female * user_scale[v.user.id] for v in votes]))
                  }
              },
              "users": [v.user for v in votes]
          }
          for yr in range(9, 14):
              yr_votes = [v.user if v.user.grade and v.user.grade.number == yr else None for v in votes]
              yr_votes = list(filter(None, yr_votes))
              choice["votes"][yr] = {
                  "all": len(set(yr_votes)),
                  "male": fmt(sum([u.is_male * user_scale[u.id] for u in yr_votes])),
                  "female": fmt(sum([u.is_female * user_scale[u.id] for u in yr_votes])),
              }
  
          choices.append(choice)
      """ Clear vote """
      votes = question_votes.filter(clear_vote=True)
      clr_users = set([v.user for v in votes])
      choice = {
          "choice": "Clear vote",
          "votes": {
              "total": {
                  "all": len(clr_users),
                  "all_percent": perc(len(clr_users), users.count()),
                  "male": fmt(sum([v.user.is_male * user_scale[v.user.id] for v in votes])),
                  "female": fmt(sum([v.user.is_female * user_scale[v.user.id] for v in votes]))
              }
          },
          "users": clr_users
      }
      for yr in range(9, 14):
          yr_votes = [v.user if v.user.grade and v.user.grade.number == yr else None for v in votes]
          yr_votes = list(filter(None, yr_votes))
          choice["votes"][yr] = {
              "all": len(yr_votes),
              "male": fmt(sum([u.is_male * user_scale[u.id] for u in yr_votes])),
              "female": fmt(sum([u.is_female * user_scale[u.id] for u in yr_votes]))
          }
  
      choices.append(choice)
  
      choice = {
          "choice": "Total",
          "votes": {
              "total": {
                  "all": users.count(),
                  "votes_all": question_votes.count(),
                  "all_percent": perc(users.count(), users.count()),
                  "male": users.filter(gender=True).count(),
                  "female": users.filter(gender__isnull=False, gender=False).count()
              }
          }
      }
      for yr in range(9, 14):
          yr_votes = [u if u.grade and u.grade.number == yr else None for u in users]
          yr_votes = list(filter(None, yr_votes))
          choice["votes"][yr] = {
              "all": len(set(yr_votes)),
              "male": fmt(sum([u.is_male * user_scale[u.id] for u in yr_votes])),
              "female": fmt(sum([u.is_female * user_scale[u.id] for u in yr_votes]))
          }
  
      choices.append(choice)
  
      return {"question": q, "choices": choices, "user_scale": user_scale}