original_docstring:  Forwards events to the open request. 
docstring: Forwards events to the open request.
docstring_tokens: Forwards events to the open request .
code: def forward_events(event):
          """ Forwards events to the open request. """
          nonlocal gracefully_closed
  
          if block.is_set() or event.event_type == EVENT_TIME_CHANGED or \
             restrict and event.event_type not in restrict:
              return
          elif event.event_type == EVENT_HOMEASSISTANT_STOP:
              gracefully_closed = True
              block.set()
              return
  
          write_message(json.dumps(event, cls=rem.JSONEncoder))
code_tokens: def forward_events ( event ) : nonlocal gracefully_closed if block . is_set ( ) or event . event_type == EVENT_TIME_CHANGED or restrict and event . event_type not in restrict : return elif event . event_type == EVENT_HOMEASSISTANT_STOP : gracefully_closed = True block . set ( ) return write_message ( json . dumps ( event , cls = rem . JSONEncoder ) )
short_docstring: Forwards events to the open request.
short_docstring_tokens: Forwards events to the open request .
comment: """ Forwards events to the open request. """