@@ -0,0 +1,2904 @@
+# Based on altair tutorial loader:%0A# https://github.com/altair-viz/altair/blob/273a1fcf9cec1956474af755d5fe32f0e3f0aee8/altair/tutorial.py%0A%0A# Copyright (c) 2015, Brian E. Granger and Jake Vanderplas%0A# All rights reserved.%0A#%0A# Redistribution and use in source and binary forms, with or without%0A# modification, are permitted provided that the following conditions are met:%0A#%0A# * Redistributions of source code must retain the above copyright notice, this%0A#   list of conditions and the following disclaimer.%0A#%0A# * Redistributions in binary form must reproduce the above copyright notice,%0A#   this list of conditions and the following disclaimer in the documentation%0A#   and/or other materials provided with the distribution.%0A#%0A# * Neither the name of altair nor the names of its%0A#   contributors may be used to endorse or promote products derived from%0A#   this software without specific prior written permission.%0A#%0A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS %22AS IS%22%0A# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE%0A# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE%0A# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE%0A# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL%0A# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR%0A# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER%0A# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,%0A# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE%0A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.%0A%0Aimport os%0Aimport shutil%0A%0ASRC_PATH = os.path.join(%0A    os.path.split(os.path.abspath(__file__)%0A)%5B0%5D, 'tutorial')%0A%0ADEST_PATH = os.path.relpath('DatabakerTutorial')%0A%0Adef copy_tutorial(overwrite=False):%0A    %22%22%22Copy the Databaker tutorial notebooks into ./DatabakerTutorial.%22%22%22%0A    if os.path.isdir(DEST_PATH) and overwrite:%0A        print('Removing old tutorial directory: %7B%7D'.format(DEST_PATH))%0A        shutil.rmtree(DEST_PATH, ignore_errors=True)%0A    if os.path.isdir(DEST_PATH):%0A        raise RuntimeError('%7B%7D already exists, run with overwrite=True to discard *all* existing files in tutorial directory'.format(DEST_PATH))%0A    print('Copying notebooks into fresh tutorial directory: %7B%7D'.format(DEST_PATH))%0A    shutil.copytree(SRC_PATH, DEST_PATH)%0A%0A%0Adef tutorial(overwrite=False):%0A    %22%22%22Copy the Databaker tutorial notebooks into ./DatabakerTutorial and show a link in the notebook.%22%22%22%0A    copy_tutorial(overwrite=overwrite)%0A    print('Click on the following notebooks to explore the tutorial:')%0A    from IPython.display import FileLinks, display%0A    file_links = FileLinks(path=DEST_PATH,%0A                           included_suffixes=%5B'.ipynb'%5D,%0A                           recursive=False)%0A    display(file_links)%0A

Add tutorial loader script based on one in altair