def bootstrap_from_archive(path, skeleton):
    if os.path.isfile(skeleton) or os.path.isdir(skeleton):
        # Is is a local file?
        skeleton_file = skeleton
    else:
        # Assume it's an URL
        skeleton_file, headers = urllib.request.urlretrieve(skeleton)

    for opener, test in SUPPORTED_ARCHIVES:
        try:
            if test(skeleton_file):
                archive = opener(skeleton_file)
                break
        except IOError:
            pass
    else:
        raise Exception("Unsupported skeleton file type. Only .tar and .zip are supported at this time.")

    os.mkdir(path)
    archive.extractall(path=path)
    archive.close()
dataset/ETHPy150Open koenbok/Cactus/cactus/bootstrap/archive.py/bootstrap_from_archive/original