def allowed(uid):
 global voters
 for (_uid, _timestamp) in voters.items():
  if ((time.time() - _timestamp) >= TIME_LIMIT):
   del voters[_uid]
 if (uid in voters):
  last_voted = voters[uid]
  return (False, timeformat.time_until(last_voted, now=(time.time() - TIME_LIMIT)))
 else:
  voters[uid] = time.time()
  return (True, 0)

def allowed ( uid ) : global voters for ( _uid , _timestamp ) in voters . items ( ) : if ( ( time . time ( ) - _timestamp ) >= TIME_LIMIT ) : del voters [ _uid ] if ( uid in voters ) : last_voted = voters [ uid ] return ( False , timeformat . time_until ( last_voted , now = ( time . time ( ) - TIME_LIMIT ) ) ) else : voters [ uid ] = time . time ( ) return ( True , 0 )
checks if a user is allowed to vote .