@invoke.task
def notebook_static():
    if os.path.exists(NOTEBOOK_STATIC_PATH):
        return
    fname = 'notebook-%s.tar.gz' % NOTEBOOK_VERSION
    nb_tgz = os.path.join(APP_ROOT, fname)
    nb_url = 'https://pypi.python.org/packages/source/n/notebook/' + fname
    if not os.path.exists(nb_tgz):
        print("Downloading %s -> %s" % (nb_url, nb_tgz))
        urlretrieve(nb_url, nb_tgz)
    with open(nb_tgz, 'rb') as f:
        checksum = hashlib.sha256(f.read()).hexdigest()
    if checksum != NOTEBOOK_CHECKSUM:
        print("Notebook tarball checksum mismatch (%s)" % nb_url, file=sys.stderr)
        print("Expected: %s" % NOTEBOOK_CHECKSUM, file=sys.stderr)
        print("Got: %s" % checksum, file=sys.stderr)
        sys.exit(1)
    invoke.run("tar -xzf '{}'".format(nb_tgz))
dataset/ETHPy150Open jupyter/nbviewer/tasks.py/notebook_static/original