Are you trying to use len(probs) to the power of (-1/5)? If yes, the symbol "^" is not for the power operation in Python and hence you are getting the error. You need to use "**" for the power operation.
Replace the symbol "^" with "**" and it should fix the error.
return 1.06 * min(np.sqrt(np.var(probs)), h) * len(probs)**(-1/5)