<s> """<STR_LIT>""" <EOL> from flask import Flask , jsonify <EOL> from appmetrics import metrics <EOL> app = Flask ( __name__ ) <EOL> @ app . route ( '<STR_LIT>' ) <EOL> @ metrics . with_meter ( "<STR_LIT>" ) <EOL> @ metrics . with_histogram ( "<STR_LIT>" ) <EOL> @ metrics . with_meter ( "<STR_LIT>" ) <EOL> def factorial ( n ) : <EOL> f = <NUM_LIT:1> <EOL> for i in xrange ( <NUM_LIT:2> , n + <NUM_LIT:1> ) : <EOL> f *= i <EOL> return jsonify ( factorial = str ( f ) ) <EOL> @ app . route ( '<STR_LIT>' ) <EOL> @ metrics . with_meter ( "<STR_LIT>" ) <EOL> @ metrics . with_histogram ( "<STR_LIT>" ) <EOL> @ metrics . with_meter ( "<STR_LIT>" ) <EOL> def is_prime ( n ) : <EOL> result = True <EOL> if n % <NUM_LIT:2> == <NUM_LIT:0> : <EOL> result = False <EOL> else : <EOL> for i in xrange ( <NUM_LIT:3> , int ( n ** <NUM_LIT:0.5> ) + <NUM_LIT:1> , <NUM_LIT:2> ) : <EOL> if n % i == <NUM_LIT:0> : <EOL> result = False <EOL> return jsonify ( is_prime = result ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> from appmetrics . wsgi import AppMetricsMiddleware <EOL> app . wsgi_app = AppMetricsMiddleware ( app . wsgi_app ) <EOL> app . run ( threaded = True , debug = True ) </s>
