code: def onestep(self, *, direction=FORWARD, style=SINGLE):
          
          # Adjust current steps based on the direction and type of step.
          step_size = 0
          if style == MICROSTEP:
              step_size = 1
          else:
              half_step = self._microsteps // 2
              full_step = self._microsteps
              # Its possible the previous steps were MICROSTEPS so first align with the interleave
              # pattern.
              additional_microsteps = self._current_microstep % half_step
              if additional_microsteps != 0:
                  # We set _current_microstep directly because our step size varies depending on the
                  # direction.
                  if direction == FORWARD:
                      self._current_microstep += half_step - additional_microsteps
                  else:
                      self._current_microstep -= additional_microsteps
                  step_size = 0
              elif style == INTERLEAVE:
                  step_size = half_step
  
              current_interleave = self._current_microstep // half_step
              if ((style == SINGLE and current_interleave % 2 == 1) or
                      (style == DOUBLE and current_interleave % 2 == 0)):
                  step_size = half_step
              elif style in (SINGLE, DOUBLE):
                  step_size = full_step
  
          if direction == FORWARD:
              self._current_microstep += step_size
          else:
              self._current_microstep -= step_size
  
          # Now that we know our target microstep we can determine how to energize the four coils.
          self._update_coils(microstepping=style == MICROSTEP)
  
          return self._current_microstep
docs: Performs one step of a particular style. The actual rotation amount will vary by style.
             `SINGLE` and `DOUBLE` will normal cause a full step rotation. `INTERLEAVE` will normally
             do a half step rotation. `MICROSTEP` will perform the smallest configured step.
  
             When step styles are mixed, subsequent `SINGLE`, `DOUBLE` or `INTERLEAVE` steps may be
             less than normal in order to align to the desired style's pattern.
  
             :param int direction: Either `FORWARD` or `BACKWARD`
             :param int style: `SINGLE`, `DOUBLE`, `INTERLEAVE`