def myTakeStep2(x):
 s = 0.5
 x += np.random.uniform((- s), s, np.shape(x))
 return x

def myTakeStep2 ( x ) : s = 0.5 x += np . random . uniform ( ( - s ) , s , np . shape ( x ) ) return x
redo randomdisplacement in function form without the attribute stepsize to make sure still everything works ok .