def commit_tree(object_store, blobs):
    trees = {"": {}}
    def add_tree(path):
        if path in trees:
            return trees[path]
        dirname, basename = pathsplit(path)
        t = add_tree(dirname)
        assert isinstance(basename, str)
        newtree = {}
        t[basename] = newtree
        trees[path] = newtree
        return newtree

    for path, sha, mode in blobs:
        tree_path, basename = pathsplit(path)
        tree = add_tree(tree_path)
        tree[basename] = (mode, sha)

    def build_tree(path):
        tree = Tree()
        for basename, entry in trees[path].iteritems():
            if type(entry) == dict:
                mode = stat.S_IFDIR
                sha = build_tree(pathjoin(path, basename))
            else:
                (mode, sha) = entry
            tree.add(mode, basename, sha)
        object_store.add_object(tree)
        return tree.id
    return build_tree("")
Test the _write_auto_filter() method
dataset/ETHPy150Open natestedman/Observatory/observatory/lib/dulwich/index.py/commit_tree--crossover with--dataset/ETHPy150Open jmcnamara/XlsxWriter/xlsxwriter/test/worksheet/test_write_auto_filter.py/TestWriteAutoFilter.test_write_auto_filter_9