<s> import os <EOL> from flask import Flask , jsonify <EOL> from flask_restful import Api <EOL> from dns . resolver import Resolver <EOL> from flask_cors import CORS <EOL> dns_resolver = Resolver ( ) <EOL> def create_app ( config_name ) : <EOL> app = Flask ( __name__ ) <EOL> if config_name == '<STR_LIT>' : <EOL> app . config . from_object ( '<STR_LIT>' ) <EOL> else : <EOL> app . config . from_object ( '<STR_LIT>' ) <EOL> if os . environ . get ( '<STR_LIT>' ) : <EOL> app . config [ '<STR_LIT>' ] = [ addr . strip ( ) for addr in os . environ . get ( '<STR_LIT>' ) . split ( '<STR_LIT:U+002C>' ) ] <EOL> if os . environ . get ( '<STR_LIT>' ) : <EOL> CORS ( app , origins = os . environ . get ( '<STR_LIT>' ) ) <EOL> dns_resolver . lifetime = <NUM_LIT> <EOL> from resolverapi . endpoints import ReverseLookup <EOL> from resolverapi . endpoints import LookupRecordType <EOL> api = Api ( app ) <EOL> api . add_resource ( ReverseLookup , '<STR_LIT>' ) <EOL> api . add_resource ( LookupRecordType , '<STR_LIT>' ) <EOL> @ app . route ( '<STR_LIT:/>' ) <EOL> def root ( ) : <EOL> """<STR_LIT>""" <EOL> return jsonify ( { '<STR_LIT:message>' : "<STR_LIT>" } ) , <NUM_LIT:200> <EOL> return app </s>
