original_docstring:  Handles deleting an event forwarding target. 
docstring: Handles deleting an event forwarding target.
docstring_tokens: Handles deleting an event forwarding target .
code: def _handle_delete_api_event_forward(handler, path_match, data):
      """ Handles deleting an event forwarding target. """
  
      try:
          host = data['host']
      except KeyError:
          handler.write_json_message("No host received.", HTTP_BAD_REQUEST)
          return
  
      try:
          port = int(data['port']) if 'port' in data else None
      except ValueError:
          handler.write_json_message(
              "Invalid value received for port", HTTP_UNPROCESSABLE_ENTITY)
          return
  
      if handler.server.event_forwarder is not None:
          api = rem.API(host, None, port)
  
          handler.server.event_forwarder.disconnect(api)
  
      handler.write_json_message("Event forwarding cancelled.")
code_tokens: def _handle_delete_api_event_forward ( handler , path_match , data ) : try : host = data [ 'host' ] except KeyError : handler . write_json_message ( "No host received." , HTTP_BAD_REQUEST ) return try : port = int ( data [ 'port' ] ) if 'port' in data else None except ValueError : handler . write_json_message ( "Invalid value received for port" , HTTP_UNPROCESSABLE_ENTITY ) return if handler . server . event_forwarder is not None : api = rem . API ( host , None , port ) handler . server . event_forwarder . disconnect ( api ) handler . write_json_message ( "Event forwarding cancelled." )
short_docstring: Handles deleting an event forwarding target.
short_docstring_tokens: Handles deleting an event forwarding target .
comment: """ Handles deleting an event forwarding target. """