code: def _set_duty(self, motor_duty_file, duty, friction_offset,
                    voltage_comp):
          
          # Compensate for nominal voltage and round the input
          duty_int = int(round(duty*voltage_comp))
  
          # Add or subtract offset and clamp the value between -100 and 100
          if duty_int > 0:
              duty_int = min(100, duty_int + friction_offset)
          elif duty_int < 0:
              duty_int = max(-100, duty_int - friction_offset)
  
          # Apply the signal to the motor
          self._fast_write(motor_duty_file, duty_int)
docs: Function to set the duty cycle of the motors.