def load_app(self, app_path, app_full_name):
        if app_full_name:
            return import_object(app_full_name)

        dirs = [d for d in os.listdir(app_path) if os.path.isdir(os.path.join(app_path, d))]

        # A normal pyroutes application should have only 3 folders: templates/ tests/ <app-name>/
        # Here we do: "import <app-name>"
        app_dir = filter(lambda d: d not in ('templates', 'tests'), dirs)
        __import__(app_dir[0])  # This should import all @routes from the app
        __import__(app_dir[0], fromlist='pyroutes_settings')
        import pyroutes
        return pyroutes.application
dataset/ETHPy150Open daltonmatos/wsgid/wsgid/loaders/__init__.py/PyRoutesLoader.load_app/original