<s> import pkg_resources <EOL> import logging <EOL> from pyramid . config import Configurator <EOL> from pyramid . settings import asbool <EOL> import cliquet <EOL> __version__ = pkg_resources . get_distribution ( __package__ ) . version <EOL> API_VERSION = '<STR_LIT>' % __version__ . split ( '<STR_LIT:.>' ) [ <NUM_LIT:0> ] <EOL> logger = logging . getLogger ( __name__ ) <EOL> DEFAULT_SETTINGS = { <EOL> '<STR_LIT>' : <NUM_LIT:100> <EOL> } <EOL> def patch_gevent ( settings ) : <EOL> if asbool ( settings . get ( '<STR_LIT>' , False ) ) : <EOL> import gevent <EOL> import gevent . monkey <EOL> gevent . monkey . patch_socket ( ) <EOL> import psycogreen . gevent <EOL> psycogreen . gevent . patch_psycopg ( ) <EOL> def main ( global_config , ** settings ) : <EOL> config = Configurator ( settings = settings ) <EOL> patch_gevent ( settings ) <EOL> cliquet . initialize ( config , version = __version__ , <EOL> default_settings = DEFAULT_SETTINGS ) <EOL> config . scan ( "<STR_LIT>" ) <EOL> app = config . make_wsgi_app ( ) <EOL> return cliquet . install_middlewares ( app , settings ) </s>
