human
I wrote the below code

    import pykira
    sensors = config.get(DOMAIN, {}).get(CONF_SENSORS, [])
    remotes = config.get(DOMAIN, {}).get(CONF_REMOTES, [])
    if (not (sensors or remotes)):
        sensors.append({})
    codes = load_codes(hass.config.path(CODES_YAML))
    hass.data[DOMAIN] = {CONF_SENSOR: {}, CONF_REMOTE: {}}
    def load_module(platform, idx, module_conf):
        'Set    up    Kira    module    and    load    platform.'
        module_name = (('%s_%d' % (DOMAIN, idx)) if idx else DOMAIN)
        device_name = module_conf.get(CONF_NAME, DOMAIN)
        port = module_conf.get(CONF_PORT, DEFAULT_PORT)
        host = module_conf.get(CONF_HOST, DEFAULT_HOST)
        if (platform == CONF_SENSOR):
            module = pykira.KiraReceiver(host, port)
            module.start()
        else:
            module = pykira.KiraModule(host, port)
        hass.data[DOMAIN][platform][module_name] = module
        for code in codes:
            code_tuple = (code.get(CONF_NAME), code.get(CONF_DEVICE, STATE_UNKNOWN))
            module.registerCode(code_tuple, code.get(CONF_CODE))
        discovery.load_platform(hass, platform, DOMAIN, {'name': module_name, 'device': device_name}, config)
    for (idx, module_conf) in enumerate(sensors):
        load_module(CONF_SENSOR, idx, module_conf)
    for (idx, module_conf) in enumerate(remotes):
        load_module(CONF_REMOTE, idx, module_conf)
    def _stop_kira(_event):
        for receiver in hass.data[DOMAIN][CONF_SENSOR].values():
            receiver.stop()
        _LOGGER.info('Terminated    receivers')
    hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, _stop_kira)
    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):