def init_scaffolding(_path, appname="main.py", **kwargs):

    def build_static():
        """Builds a static/ directory within the project
        with subdirs: static/css, static/js, and static/imgs"""
        from waltz.static import style
        path = _path + '/static'
        if not os.path.exists(path):
            os.makedirs(path)
        for subdir in ['css', 'js', 'imgs']:
            subpath = '%s/%s' % (path, subdir)
            if not os.path.exists(subpath):
                os.makedirs(subpath)
        stylecss = path + "/css/style.css"
        if not os.path.exists(stylecss):
            with open(stylecss, 'w') as f:
                f.write(style)

    def build_routes():
        """Creates directories + __init__ files for route logic"""
        for d in ['routes', 'subapps', 'test']:
            path = '%s/%s' % (_path, d)
            if not os.path.exists(path):
                os.makedirs(path)
                fname = '%s/%s' % (path, '__init__.py')
                with open(fname, 'w') as f: f.close()

    def build_templates():
        """Builds the templates/ directory"""
        from waltz.static import base, index
        path = '%s/templates' % _path
        if not os.path.exists(path):
            os.makedirs(path)
        for fname, content in [('base', base), ('index', index)]:
            base = '%s/%s.html' % (path, fname)
            if not os.path.exists(base): 
                with open(base, 'w') as f:
                    f.write(content)
    
    def build_app(appname):
        from waltz.static import mainpy, homepy
        appname += ".py" if appname[-3:] != ".py" else ""
        homepypath = '%s/routes/home.py' % _path
        mainpypath = '%s/%s' % (_path, appname)
        for fname, content in [(mainpypath, mainpy),
                               (homepypath, homepy)]:
            if not os.path.exists(fname): 
                with open(fname, 'w') as f:
                    f.write(content)            

    build_static()
    build_routes()
    build_templates()
    build_app(appname)
Hessian of NB2 model.
dataset/ETHPy150Open mekarpeles/waltz/waltz/setup.py/init_scaffolding--crossover with--dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/discrete/discrete_model.py/NegativeBinomial._hessian_nb2