def __init__(self, app, host='localhost', port=80, debug=False, log_level=logging.DEBUG, formats=None, timeout=20, error_reporter=None, default_user_id=None, error_callback=format_error, error_decorator=None):
        """Take the flask app, and optionally the http port to listen on, and
        whether flask's debug mode is one or not, which callback to call when
        catching exceptions, and the api's log level"""
        assert app
        self.app = app
        self.port = port
        self.host = host
        self.debug = debug
        self.formats = formats
        self.timeout = timeout
        self.error_callback = error_callback
        self.error_decorator = error_decorator

        if default_user_id:
            self.default_user_id = default_user_id

        set_level(log_level)

        if error_reporter:
            set_error_reporter(error_reporter)

        log.info("Initialized API (%s:%s) (Flask debug:%s)" % (host, port, debug))
def __init__ ( self , app , host = 'localhost' , port = 80 , debug = False , log_level = logging . DEBUG , formats = None , timeout = 20 , error_reporter = None , default_user_id = None , error_callback = format_error , error_decorator = None ) : assert app self . app = app self . port = port self . host = host self . debug = debug self . formats = formats self . timeout = timeout self . error_callback = error_callback self . error_decorator = error_decorator if default_user_id : self . default_user_id = default_user_id set_level ( log_level ) if error_reporter : set_error_reporter ( error_reporter ) log . info ( "Initialized API (%s:%s) (Flask debug:%s)" % ( host , port , debug ) )
Take the flask app, and optionally the http port to listen on, and
        whether flask's debug mode is one or not, which callback to call when
        catching exceptions, and the api's log level