<s> """<STR_LIT>""" <EOL> import os <EOL> import mimetypes <EOL> from werkzeug import Response , wrap_file <EOL> from werkzeug . exceptions import NotFound <EOL> from solace . templating import get_theme <EOL> from solace import settings <EOL> def get_resource ( request , theme , file ) : <EOL> """<STR_LIT>""" <EOL> theme = get_theme ( theme ) <EOL> if theme is None : <EOL> raise NotFound ( ) <EOL> f = theme . open_resource ( file ) <EOL> if f is None : <EOL> raise NotFound ( ) <EOL> resp = Response ( wrap_file ( request . environ , f ) , <EOL> mimetype = mimetypes . guess_type ( file ) [ <NUM_LIT:0> ] or '<STR_LIT>' , <EOL> direct_passthrough = True ) <EOL> resp . add_etag ( ) <EOL> return resp . make_conditional ( request ) </s>
