<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def limit_step(self, step):
 """Clip the a step within the maximum allowed range"""

        if self.qmax is None:
            return step
        else:
            return np.clip(step, -self.qmax, self.qmax)