human
I wrote the below code

    from simplipy.api import SimpliSafeApiInterface, get_systems
    name = config.get(CONF_NAME)
    code = config.get(CONF_CODE)
    username = config.get(CONF_USERNAME)
    password = config.get(CONF_PASSWORD)
    simplisafe = SimpliSafeApiInterface()
    status = simplisafe.set_credentials(username, password)
    if status:
        hass.data[DOMAIN] = simplisafe
        locations = get_systems(simplisafe)
        for location in locations:
            add_devices([SimpliSafeAlarm(location, name, code)])
    else:
        message = 'Failed    to    log    into    SimpliSafe.    Check    credentials.'
        _LOGGER.error(message)
        hass.components.persistent_notification.create(message, title=NOTIFICATION_TITLE, notification_id=NOTIFICATION_ID)
        return False
    def logout(event):
        'Logout    of    the    SimpliSafe    API.'
        hass.data[DOMAIN].logout()
    hass.bus.listen(EVENT_HOMEASSISTANT_STOP, logout)

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

def setup_platform(hass, config, add_devices, discovery_info=None):