def _lstree(files, dirs):
    for f, sha1 in files:
        yield "100644 blob {}\t{}\0".format(sha1, f)

    for d, sha1 in dirs:
        yield "040000 tree {}\t{}\0".format(sha1, d)
Make git ls-tree like output.
dataset/ETHPy150Open larsmans/seqlearn/doc/hash-tree.py/_lstree