# Path: dokomoforms/options.py
# def inject_options(**kwargs):
# def parse_options():


import os
import textwrap
import signal
import subprocess
import sys
import logging
import mimetypes
import tornado.log
import tornado.httpserver
import tornado.web
import dokomoforms.handlers as handlers
from time import sleep
from sqlalchemy import DDL
from sqlalchemy.orm import sessionmaker
from tornado.web import url
from dokomoforms.options import options
    from dokomoforms.options import parse_options
from dokomoforms.models import create_engine, Base, UUID_REGEX
from dokomoforms.handlers.api.v0 import (
    SurveyResource, SubmissionResource, PhotoResource, NodeResource,
    UserResource
)
            from dokomoforms.handlers.debug import revisit_debug
        # Debug
        if settings['debug']:  # pragma: no cover
            revisit_debug()
            urls += [
                url(r'/debug/create/(.+)/?',
                    handlers.DebugUserCreationHandler),
                url(r'/debug/login/(.+)/?', handlers.DebugLoginHandler),
                url(r'/debug/logout/?', handlers.DebugLogoutHandler),
                url(r'/debug/persona_verify/?', handlers.DebugPersonaHandler),
                url(r'/debug/facilities/?', handlers.DebugRevisitHandler),
                url(r'/debug/toggle_facilities/?',
                    handlers.DebugToggleRevisitHandler),
                url(r'/debug/toggle_revisit_slow/?',
                    handlers.DebugToggleRevisitSlowModeHandler),
            ]

        # Demo
        if options.demo:
            urls += [
                url(r'/demo/login/?', handlers.DemoUserCreationHandler),
                url(r'/demo/logout/?', handlers.DemoLogoutHandler),
            ]
            options.organization = 'Demo Mode'

        super().__init__(urls, **settings)

        # Database setup
        if session is None:
            engine = create_engine()
            if options.kill:

# Path: dokomoforms/options.py
# def inject_options(**kwargs):
# def parse_options():


# Path: webapp.py
import os
import textwrap
import signal
import subprocess
import sys
import logging
import mimetypes
import tornado.log
import tornado.httpserver
import tornado.web
import dokomoforms.handlers as handlers
from time import sleep
from sqlalchemy import DDL
from sqlalchemy.orm import sessionmaker
from tornado.web import url
from dokomoforms.options import options
    from dokomoforms.options import parse_options
from dokomoforms.models import create_engine, Base, UUID_REGEX
from dokomoforms.handlers.api.v0 import (
    SurveyResource, SubmissionResource, PhotoResource, NodeResource,
    UserResource
)
            from dokomoforms.handlers.debug import revisit_debug

        # Debug
        if settings['debug']:  # pragma: no cover
            revisit_debug()
            urls += [
                url(r'/debug/create/(.+)/?',
                    handlers.DebugUserCreationHandler),
                url(r'/debug/login/(.+)/?', handlers.DebugLoginHandler),
                url(r'/debug/logout/?', handlers.DebugLogoutHandler),
                url(r'/debug/persona_verify/?', handlers.DebugPersonaHandler),
                url(r'/debug/facilities/?', handlers.DebugRevisitHandler),
                url(r'/debug/toggle_facilities/?',
                    handlers.DebugToggleRevisitHandler),
                url(r'/debug/toggle_revisit_slow/?',
                    handlers.DebugToggleRevisitSlowModeHandler),
            ]

        # Demo
        if options.demo:
            urls += [
                url(r'/demo/login/?', handlers.DemoUserCreationHandler),
                url(r'/demo/logout/?', handlers.DemoLogoutHandler),
            ]
            options.organization = 'Demo Mode'

        super().__init__(urls, **settings)

        # Database setup
        if session is None:
            engine = create_engine()
            if options.kill:

                logging.info('Dropping schema {}.'.format(options.schema))