<s> from __future__ import division <EOL> from datetime import datetime <EOL> from django import template <EOL> from django . utils . translation import ugettext as _ <EOL> register = template . Library ( ) <EOL> @ register . filter <EOL> def from_sakai_timestamp ( value ) : <EOL> return datetime . fromtimestamp ( value / <NUM_LIT:1000> ) <EOL> @ register . filter <EOL> def places_left ( value ) : <EOL> return ( value [ "<STR_LIT>" ] - len ( value [ "<STR_LIT>" ] ) ) <EOL> @ register . filter <EOL> def signup_status ( ts , event ) : <EOL> if ts [ "<STR_LIT>" ] : <EOL> return '<STR_LIT>' <EOL> elif not places_left ( ts ) : <EOL> if event [ "<STR_LIT>" ] : <EOL> if ts [ "<STR_LIT>" ] : <EOL> return '<STR_LIT>' <EOL> else : <EOL> return '<STR_LIT>' <EOL> else : <EOL> return '<STR_LIT>' <EOL> else : <EOL> return '<STR_LIT>' <EOL> @ register . filter <EOL> def signup_status_human ( value ) : <EOL> return { <EOL> '<STR_LIT>' : _ ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : _ ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : _ ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : _ ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : _ ( '<STR_LIT>' ) <EOL> } [ value ] </s>
