<s> import threading <EOL> _thread_local = threading . local ( ) <EOL> def get_request ( ) : <EOL> try : <EOL> return _thread_local . request <EOL> except AttributeError : <EOL> return None <EOL> def set_request ( request ) : <EOL> _thread_local . request = request <EOL> def get_request_domain ( ) : <EOL> return getattr ( get_request ( ) , '<STR_LIT>' , None ) </s>
