human
Complete the below
@contextmanager
def maybe_exclude_notebooks():

    ''''Skip building the notebooks if pandoc is not installed.
    This assumes that nbsphinx is installed.'
    '''

=====
Give me a the Python program you requested?
assistant
#Here is the Python program you requested.
    base = os.path.dirname(__file__)
    notebooks = [os.path.join(base, 'source', nb) for nb in ['style.ipynb']]
    contents = {}
    def _remove_notebooks():
        for nb in notebooks:
            with open(nb, 'rt') as f:
                contents[nb] = f.read()
            os.remove(nb)
    try:
        import nbconvert
    except ImportError:
        print('Warning:    nbconvert    not    installed.    Skipping    notebooks.')
        _remove_notebooks()
    else:
        try:
            nbconvert.utils.pandoc.get_pandoc_version()
        except nbconvert.utils.pandoc.PandocMissing:
            print('Warning:    Pandoc    is    not    installed.    Skipping    notebooks.')
            _remove_notebooks()
    (yield)
    for (nb, content) in contents.items():
        with open(nb, 'wt') as f:
            f.write(content)