def create_tree_archive(path, name, load, overwrite=False, archives_leading_dir=True):
    'Given an archive `name`, create under `path` with specified `load` tree\n    '
    from datalad.support.archives import compress_files
    dirname = file_basename(name)
    full_dirname = op.join(path, dirname)
    os.makedirs(full_dirname)
    create_tree(full_dirname, load, archives_leading_dir=archives_leading_dir)
    if archives_leading_dir:
        compress_files([dirname], name, path=path, overwrite=overwrite)
    else:
        compress_files(list(map(basename, glob.glob(op.join(full_dirname, '*')))), op.join(pardir, name), path=op.join(path, dirname), overwrite=overwrite)
    rmtree(full_dirname)
Given an archive `name`, create under `path` with specified `load` tree
def create_tree_archive(path, name, load, overwrite=False, archives_leading_dir=True):
    '\n    '
    from datalad.support.archives import compress_files
    dirname = file_basename(name)
    full_dirname = op.join(path, dirname)
    os.makedirs(full_dirname)
    create_tree(full_dirname, load, archives_leading_dir=archives_leading_dir)
    if archives_leading_dir:
        compress_files([dirname], name, path=path, overwrite=overwrite)
    else:
        compress_files(list(map(basename, glob.glob(op.join(full_dirname, '*')))), op.join(pardir, name), path=op.join(path, dirname), overwrite=overwrite)
    rmtree(full_dirname)