def METHOD_NAME(event_handlers):
  """Wraps the event handler and registers it as a callback for the js side.
  Wraps the event handler and registers it as a callback for js. Keep count and
  use it as aprt of the callback name to ensure uniqueness.
  Args:
    event_handlers: The hadnler for the js events.
  Returns:
    The name of the js callback, safe to render as HTML or JS.
  """
  trusted_name = 'tfma_eventCallback' + str(int(METHOD_NAME.count))
  METHOD_NAME.count += 1
  def wrapped_function(name='', detail=None):
    if event_handlers and name in event_handlers:
      event_handlers[name](detail)
  output.register_callback(trusted_name, wrapped_function)
  return trusted_name