def register_handler(self, event_name, event_handler, run_on_main_loop=False, request_handler=None, persist=False):
    '''Register ``event_handler`` to run when ``event_name`` is received. Handlers are meant to respond to
    a single event matching ``event_name`` only. If ``run_on_main_loop`` is ``True`` the handler will be executed
    on Tornado's main ``IOLoop`` (required if the handler will write to a response stream). If ``request_handler``
    is set, ``event_handler`` will not fire once ``request_handler`` has finished. Set ``persist`` to ``True``
    to automatically requeue ``event_handler`` each time it is executed.
    '''
    if not self.__handlers in event_name:
      self.__handlers[event_name] = set()
    handler_tuple = (event_handler, run_on_main_loop, request_handler, persist)
    self.__handlers[event_name].add(handler_tuple)
    return (event_name, handler_tuple)
dataset/ETHPy150Open JeremyOT/Toto/toto/events.py/EventManager.register_handler/swapped operands of `in`