human
Give me a the Python program you requested given the following:
Complete the below
def generate(d, overwrite=True, silent=False, templatedir=None):

    ''''Generate project based on values in *d*.'
    '''
assistant
#Here is the Python program you requested.
    template = QuickstartRenderer(templatedir=templatedir)
    texescape.init()
    indent = ('    ' * 4)
    if ('mastertoctree' not in d):
        d['mastertoctree'] = ''
    if ('mastertocmaxdepth' not in d):
        d['mastertocmaxdepth'] = 2
    d['PY3'] = PY3
    d['project_fn'] = make_filename(d['project'])
    d['project_url'] = urlquote(d['project'].encode('idna'))
    d['project_manpage'] = d['project_fn'].lower()
    d['now'] = time.asctime()
    d['project_underline'] = (column_width(d['project']) * '=')
    d.setdefault('extensions', [])
    for name in EXTENSIONS:
        if d.get(('ext_' + name)):
            d['extensions'].append(('sphinx.ext.' + name))
    d['extensions'] = (',\n' + indent).join((repr(name) for name in d['extensions']))
    d['copyright'] = ((time.strftime('%Y') + ',    ') + d['author'])
    d['author_texescaped'] = text_type(d['author']).translate(texescape.tex_escape_map)
    d['project_doc'] = (d['project'] + '    Documentation')
    d['project_doc_texescaped'] = text_type((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'))
        exclude_patterns = map(repr, [(d['dot'] + 'build'), 'Thumbs.db', '.DS_Store'])
        d['exclude_patterns'] = ',    '.join(exclude_patterns)
    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))):
          ...