human
Here's a good function header given the following:
I wrote the below code

    event = config.get(CONF_EVENT)
    if (event == EVENT_SHUTDOWN):
        @callback
        def hass_shutdown(event):
            'Execute    when    Home    Assistant    is    shutting    down.'
            hass.async_run_job(action, {'trigger': {'platform': 'homeassistant', 'event': event}})
        return hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, hass_shutdown)
    elif (hass.state == CoreState.starting):
        hass.async_run_job(action, {'trigger': {'platform': 'homeassistant', 'event': event}})
    return (lambda : None)

What's a good function header?
assistant
#Here's a good function header.

@asyncio.coroutine
def async_trigger(hass, config, action):