Python Implementation of Sequential Pattern Mining Algorithm

Hi, can anyone help me with the implementation of CCSpan algorithm in python.

This is the algorithm (in the image below): Algorithm

It has three functions!

The sample input data is :
ID Sequence
1 CAABC
2 ABCB
3 CABC
4 ABBCA

and the desired output is: CA:3, AB:4, BC:4, ABC:3 (given the min_support of 2)

Detailed documentation of the algorithm can be found here : https://sci-hub.se/https://www.researchgate.net/publication/279634279_CCSpan_Mining_Closed_Contiguous_Sequential_Patterns