<s> from functools import wraps <EOL> from htmlmin . minify import html_minify <EOL> def minified_response ( f ) : <EOL> @ wraps ( f ) <EOL> def minify ( * args , ** kwargs ) : <EOL> response = f ( * args , ** kwargs ) <EOL> minifiable_status = response . status_code == <NUM_LIT:200> <EOL> minifiable_content = '<STR_LIT>' in response [ '<STR_LIT:Content-Type>' ] <EOL> if minifiable_status and minifiable_content : <EOL> response . content = html_minify ( response . content ) <EOL> return response <EOL> return minify <EOL> def not_minified_response ( f ) : <EOL> @ wraps ( f ) <EOL> def not_minify ( * args , ** kwargs ) : <EOL> response = f ( * args , ** kwargs ) <EOL> response . minify_response = False <EOL> return response <EOL> return not_minify </s>
