<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def mode(self, mode):
 """Set Arlo camera mode. :param mode: arm, disarm """

        modes = self.available_modes
        if (not modes) or (mode not in modes):
            return
        self.publish(
            action='set',
            resource='modes' if mode != 'schedule' else 'schedule',
            mode=mode,
            publish_response=True)
        self.update()