TdiShr emulation in Python