code: def can_vote_in_poll(self, poll, user):
          
          # First we have to check if the poll is curently open
          if poll.duration:
              poll_dtend = poll.created + dt.timedelta(days=poll.duration)
              if poll_dtend < now():
                  return False
  
          # Is this user allowed to vote in polls in the current forum?
          can_vote = (
              self._perform_basic_permission_check(poll.topic.forum, user, 'can_vote_in_polls') and
              not poll.topic.is_locked
          )
  
          # Retrieve the user votes for the considered poll
          user_votes = TopicPollVote.objects.filter(poll_option__poll=poll)
          if user.is_anonymous:
              forum_key = get_anonymous_user_forum_key(user)
              if forum_key:
                  user_votes = user_votes.filter(anonymous_key=forum_key)
              else:
                  # If the forum key of the anonymous user cannot be retrieved, the user should not be
                  # allowed to vote in the considered poll.
                  user_votes = user_votes.none()
                  can_vote = False
          else:
              user_votes = user_votes.filter(voter=user)
  
          # If the user has already voted, they can vote again if the vote changes are allowed
          if user_votes.exists() and can_vote:
              can_vote = poll.user_changes
  
          return can_vote
docs: Given a poll, checks whether the user can answer to it.