# Generalized sierpinski graph construction

How do we construct the generalised sierpinski graph $S[n,k]$ which has order $nk$ and size $\frac{(k+1)n(n-1)}{2}$ in SageMath. The `graphs.SierpinskiGasketGraph`

is just the graph $S[3,k]$. But I want to generalise this. Is there any direct command available? Thanks beforehand.