human
I wrote the below code

    conf = config[DOMAIN]
    host = conf.get(CONF_HOST)
    port = conf.get(CONF_PORT)
    from pymochad import exceptions
    global CONTROLLER
    try:
        CONTROLLER = MochadCtrl(host, port)
    except exceptions.ConfigurationError:
        _LOGGER.exception()
        return False
    def stop_mochad(event):
        'Stop    the    Mochad    service.'
        CONTROLLER.disconnect()
    def start_mochad(event):
        'Start    the    Mochad    service.'
        hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, stop_mochad)
    hass.bus.listen_once(EVENT_HOMEASSISTANT_START, start_mochad)
    return True

What's a good function header?

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

def setup(hass, config):