# Path: api.py
# def _call(fn):
# def call(fn, data=None):
#     def bytesbuf_to_str(s):
#     def escape_quotes(s):
#     def break_strings(N, m):
#     def nrep_string_expr(s, m=64):
# def authenticated():
# def api_error_handler(error):
# 
# Path: datarequest/datarequest.py
# def index():
# 
# Path: deposit/deposit.py
# def create_new_deposit():
# def index():
# def data():
# def metadata():
# def submit():
# def thankyou():
# 
# Path: general/general.py
# def index():
# def csrf_error(e):
# def access_forbidden(e):
# def page_not_found(e):
# def internal_error(e):
# 
# Path: group_manager/group_manager.py
# def index():
# def get_categories():
# def get_subcategories():
# def get_users():
# def group_create():
# def group_update():
# def group_delete():
# def user_create():
# def user_update():
# def user_delete():
# 
# Path: intake/intake.py
# def index():
# def get_intake_study_permissions(study_id):
# def get_dataset_detail_view():
# def export():
# def reports():
# 
# Path: research/research.py
# def index():
# def download():
#     def read_file_chunks(path):
# def build_object_path(path, relative_path, filename):
# def upload_get():
# def upload_post():
# def form():
#     READ_BUFFER_SIZE = 1024 * io.DEFAULT_BUFFER_SIZE
# 
# Path: search/search.py
# def index():
# 
# Path: stats/stats.py
# def index():
# def get_tiers():
# def get_resource_details():
# def export():
# 
# Path: user/user.py
# def gate():
# def login():
# def logout():
# def notifications():
# def settings():
# def data_access():
# def callback():
#     def token_request():
#     def userinfo_request(token):
# def should_redirect_to_oidc(username):
# def oidc_authorize_url(username):
# def irods_login(username, password):
# def escape_irods_pam_password(password):
# def original_destination():
# def prepare_user():
# def release_session(response):
#     class UserinfoSubMismatchError(Exception):
# 
# Path: vault/vault.py
# def index():
# def download():
#     def read_file_chunks(path):
# def form():
# def access():
# def metadata(reference):
#     READ_BUFFER_SIZE = 1024 * io.DEFAULT_BUFFER_SIZE


from os import path
from flask import Flask, g, redirect, request, send_from_directory, url_for
from flask_session import Session
from flask_wtf.csrf import CSRFProtect
from jinja2 import ChoiceLoader, FileSystemLoader
from api import api_bp
from datarequest.datarequest import datarequest_bp
from deposit.deposit import deposit_bp
from general.general import general_bp
from group_manager.group_manager import group_manager_bp
from intake.intake import intake_bp
from research.research import research_bp
from search.search import search_bp
from stats.stats import stats_bp
from user.user import user_bp
from vault.vault import vault_bp
# general/templates/general/base.html
app.config['modules'] = []

if app.config.get('RESEARCH_ENABLED'):
    app.config['modules'].append(
        {'name': 'Research', 'function': 'research_bp.index'}
    )
if app.config.get('DEPOSIT_ENABLED'):
    app.config['modules'].append(
        {'name': 'Deposit', 'function': 'deposit_bp.index'}
    )
if app.config.get('INTAKE_ENABLED'):
    app.config['modules'].append(
        {'name': 'Intake', 'function': 'intake_bp.index'}
    )
if app.config.get('DATAREQUEST_ENABLED'):
    app.config['modules'].append(
        {'name': 'Datarequest', 'function': 'datarequest_bp.index'}
    )

app.config['modules'].append(
    {'name': 'Vault', 'function': 'vault_bp.index'},
)
app.config['modules'].append(
    {'name': 'Statistics', 'function': 'stats_bp.index'},
)
app.config['modules'].append(
    {'name': 'Group Manager', 'function': 'group_manager_bp.index'},
)


# Path: api.py
# def _call(fn):
# def call(fn, data=None):
#     def bytesbuf_to_str(s):
#     def escape_quotes(s):
#     def break_strings(N, m):
#     def nrep_string_expr(s, m=64):
# def authenticated():
# def api_error_handler(error):
# 
# Path: datarequest/datarequest.py
# def index():
# 
# Path: deposit/deposit.py
# def create_new_deposit():
# def index():
# def data():
# def metadata():
# def submit():
# def thankyou():
# 
# Path: general/general.py
# def index():
# def csrf_error(e):
# def access_forbidden(e):
# def page_not_found(e):
# def internal_error(e):
# 
# Path: group_manager/group_manager.py
# def index():
# def get_categories():
# def get_subcategories():
# def get_users():
# def group_create():
# def group_update():
# def group_delete():
# def user_create():
# def user_update():
# def user_delete():
# 
# Path: intake/intake.py
# def index():
# def get_intake_study_permissions(study_id):
# def get_dataset_detail_view():
# def export():
# def reports():
# 
# Path: research/research.py
# def index():
# def download():
#     def read_file_chunks(path):
# def build_object_path(path, relative_path, filename):
# def upload_get():
# def upload_post():
# def form():
#     READ_BUFFER_SIZE = 1024 * io.DEFAULT_BUFFER_SIZE
# 
# Path: search/search.py
# def index():
# 
# Path: stats/stats.py
# def index():
# def get_tiers():
# def get_resource_details():
# def export():
# 
# Path: user/user.py
# def gate():
# def login():
# def logout():
# def notifications():
# def settings():
# def data_access():
# def callback():
#     def token_request():
#     def userinfo_request(token):
# def should_redirect_to_oidc(username):
# def oidc_authorize_url(username):
# def irods_login(username, password):
# def escape_irods_pam_password(password):
# def original_destination():
# def prepare_user():
# def release_session(response):
#     class UserinfoSubMismatchError(Exception):
# 
# Path: vault/vault.py
# def index():
# def download():
#     def read_file_chunks(path):
# def form():
# def access():
# def metadata(reference):
#     READ_BUFFER_SIZE = 1024 * io.DEFAULT_BUFFER_SIZE


# Path: app.py
from os import path
from flask import Flask, g, redirect, request, send_from_directory, url_for
from flask_session import Session
from flask_wtf.csrf import CSRFProtect
from jinja2 import ChoiceLoader, FileSystemLoader
from api import api_bp
from datarequest.datarequest import datarequest_bp
from deposit.deposit import deposit_bp
from general.general import general_bp
from group_manager.group_manager import group_manager_bp
from intake.intake import intake_bp
from research.research import research_bp
from search.search import search_bp
from stats.stats import stats_bp
from user.user import user_bp
from vault.vault import vault_bp

# general/templates/general/base.html
app.config['modules'] = []

if app.config.get('RESEARCH_ENABLED'):
    app.config['modules'].append(
        {'name': 'Research', 'function': 'research_bp.index'}
    )
if app.config.get('DEPOSIT_ENABLED'):
    app.config['modules'].append(
        {'name': 'Deposit', 'function': 'deposit_bp.index'}
    )
if app.config.get('INTAKE_ENABLED'):
    app.config['modules'].append(
        {'name': 'Intake', 'function': 'intake_bp.index'}
    )
if app.config.get('DATAREQUEST_ENABLED'):
    app.config['modules'].append(
        {'name': 'Datarequest', 'function': 'datarequest_bp.index'}
    )

app.config['modules'].append(
    {'name': 'Vault', 'function': 'vault_bp.index'},
)
app.config['modules'].append(
    {'name': 'Statistics', 'function': 'stats_bp.index'},
)
app.config['modules'].append(
    {'name': 'Group Manager', 'function': 'group_manager_bp.index'},
)


app.config['modules_list'] = [module['name'] for module in app.config['modules']]