human
Complete the below
def generate(d, overwrite=True, silent=False):

    ''''Generate project based on values in *d*.'
    '''
 Can you provide a the Python program you requested?
assistant
#Here is the Python program you requested.
    texescape.init()
    indent = ('    ' * 4)
    if ('mastertoctree' not in d):
        d['mastertoctree'] = ''
    if ('mastertocmaxdepth' not in d):
        d['mastertocmaxdepth'] = 2
    d['project_fn'] = make_filename(d['project'])
    d['project_manpage'] = d['project_fn'].lower()
    d['now'] = time.asctime()
    d['project_underline'] = (column_width(d['project']) * '=')
    extensions = (',\n' + indent).join((repr(('sphinx.ext.' + name)) for name in ('autodoc', 'doctest', 'intersphinx', 'todo', 'coverage', 'pngmath', 'mathjax', 'ifconfig', 'viewcode') if d.get(('ext_' + name))))
    if extensions:
        d['extensions'] = ((('\n' + indent) + extensions) + ',\n')
    else:
        d['extensions'] = extensions
    d['copyright'] = ((time.strftime('%Y') + ',    ') + d['author'])
    d['author_texescaped'] = unicode(d['author']).translate(texescape.tex_escape_map)
    d['project_doc'] = (d['project'] + '    Documentation')
    d['project_doc_texescaped'] = unicode((d['project'] + '    Documentation')).translate(texescape.tex_escape_map)
    for key in ('project', 'project_doc', 'project_doc_texescaped', 'author', 'author_texescaped', 'copyright', 'version', 'release', 'master'):
        d[(key + '_str')] = d[key].replace('\\', '\\\\').replace("'", "\\'")
    if (not path.isdir(d['path'])):
        mkdir_p(d['path'])
    srcdir = ((d['sep'] and path.join(d['path'], 'source')) or d['path'])
    mkdir_p(srcdir)
    if d['sep']:
        builddir = path.join(d['path'], 'build')
        d['exclude_patterns'] = ''
    else:
        builddir = path.join(srcdir, (d['dot'] + 'build'))
        d['exclude_patterns'] = repr((d['dot'] + 'build'))
    mkdir_p(builddir)
    mkdir_p(path.join(srcdir, (d['dot'] + 'templates')))
    mkdir_p(path.join(srcdir, (d['dot'] + 'static')))
    def write_file(fpath, content, newline=None):
        if (overwrite or (not path.isfile(fpath))):
            print ('Creating    file    %s.' % fpath)
            f = open(fpath, 'wt', encoding='utf-8', newline=newline)
            try:
 ...