persistent homology python code