<s> import pprint <EOL> EXTRA_MIMETYPES = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> FUNCTION_TEMPLATE = """<STR_LIT>""" . lstrip ( ) <EOL> NGINX_CONFIG_FILE = '<STR_LIT>' <EOL> def get_default_types_function ( ) : <EOL> types_map = get_types_map ( ) <EOL> types_map_str = pprint . pformat ( types_map , indent = <NUM_LIT:8> ) . strip ( '<STR_LIT>' ) <EOL> return FUNCTION_TEMPLATE . format ( <EOL> triple_quote = '<STR_LIT>' , <EOL> types_map = types_map_str ) <EOL> def get_types_map ( ) : <EOL> types_map = { } <EOL> with open ( NGINX_CONFIG_FILE , '<STR_LIT:r>' ) as f : <EOL> for line in f : <EOL> line = line . strip ( ) <EOL> if not line . endswith ( '<STR_LIT:;>' ) : <EOL> continue <EOL> line = line . rstrip ( '<STR_LIT:;>' ) <EOL> bits = line . split ( ) <EOL> media_type = bits [ <NUM_LIT:0> ] <EOL> if media_type == '<STR_LIT>' : <EOL> continue <EOL> extensions = bits [ <NUM_LIT:1> : ] <EOL> for extension in extensions : <EOL> types_map [ '<STR_LIT:.>' + extension ] = media_type <EOL> types_map . update ( EXTRA_MIMETYPES ) <EOL> return types_map <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> print get_default_types_function ( ) </s>
