<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def action(self, action):
 r"""Activate or deactivate an output. Use the <wait> option to activate/deactivate the port for a limited period of time. <Port ID> = Port name. Default: Name from Output.Name <a> = Action character. /=active, \=inactive <wait> = Delay before the next action. Unit: milliseconds Note: The :, / and \ characters must be percent-encoded in the URI. See Percent encoding. Example: To set output 1 to active, use 1:/. In the URI, the action argument becomes action=1%3A%2F """

        if not self.direction == DIRECTION_OUT:
            return

        port_action = quote(
            '{port}:{action}'.format(port=int(self.id)+1, action=action),
            safe=''
        )
        url = URL + ACTION.format(action=port_action)

        self._request('get', url)