human
Solve the following python programming problem given the following code:
@public
def on(id, event):
assistant
#Here is the Python program you requested.

    """Sets the decorated method to handle indicated event::
    @plugin
    class Hosts (SectionPlugin):
    def init(self):
    self.append(self.ui.inflate(\hosts:main\))
    @on(\save\, \click\)
    def save(self):
    self.config.save()
    :param id: element ID
    :type  id: str
    :param event: event name
    :type  event: str
    :rtype: function
    """
    def decorator(fx):
        fx._event_id = id
        fx._event_name = event
        return fx
    return decorator