<s> from django . contrib . auth . models import User <EOL> from django . contrib . sessions . models import Session <EOL> def get_user ( request ) : <EOL> sessions = Session . objects . filter ( session_key = request . COOKIES . get ( '<STR_LIT>' ) ) <EOL> if not sessions : <EOL> return None <EOL> uid = sessions [ <NUM_LIT:0> ] . get_decoded ( ) . get ( '<STR_LIT>' ) <EOL> if not uid : <EOL> return None <EOL> users = User . objects . filter ( pk = uid ) <EOL> if not users : <EOL> return None <EOL> return users [ <NUM_LIT:0> ] </s>
