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

    conf = config[DOMAIN]
    name = conf.get(CONF_NAME)
    whitelist = conf.get(CONF_WHITELIST)
    json_body = {}
    def dweet_event_listener(event):
        'Listen    for    new    messages    on    the    bus    and    sends    them    to    Dweet.io.'
        state = event.data.get('new_state')
        if ((state is None) or (state.state in (STATE_UNKNOWN, '')) or (state.entity_id not in whitelist)):
            return
        try:
            _state = state_helper.state_as_number(state)
        except ValueError:
            _state = state.state
        json_body[state.attributes.get('friendly_name')] = _state
        send_data(name, json_body)
    hass.bus.listen(EVENT_STATE_CHANGED, dweet_event_listener)
    return True

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

def setup(hass, config):