For example i am using pwm, so the example given in read the docs is:
def set_pwm_duty_cycle(self, io_line, cycle):
if not io_line.has_pwm_capability():
raise ValueError("%s has no PWM capability." % io_line)
if cycle < 0 or cycle > 100:
raise ValueError("Cycle must be between 0% and 100%.")
duty_cycle = int(round(cycle * 1023.00 / 100.00))
self.set_parameter(io_line.pwm_at_command, bytearray(utils.int_to_bytes(duty_cycle)))