human
I wrote the below code

    from influxdb import InfluxDBClient, exceptions
    conf = config[DOMAIN]
    kwargs = {'database': conf[CONF_DB_NAME], 'verify_ssl': conf[CONF_VERIFY_SSL], 'timeout': TIMEOUT}
    if (CONF_HOST in conf):
        kwargs['host'] = conf[CONF_HOST]
    if (CONF_PORT in conf):
        kwargs['port'] = conf[CONF_PORT]
    if (CONF_USERNAME in conf):
        kwargs['username'] = conf[CONF_USERNAME]
    if (CONF_PASSWORD in conf):
        kwargs['password'] = conf[CONF_PASSWORD]
    if (CONF_SSL in conf):
        kwargs['ssl'] = conf[CONF_SSL]
    include = conf.get(CONF_INCLUDE, {})
    exclude = conf.get(CONF_EXCLUDE, {})
    whitelist_e = set(include.get(CONF_ENTITIES, []))
    whitelist_d = set(include.get(CONF_DOMAINS, []))
    blacklist_e = set(exclude.get(CONF_ENTITIES, []))
    blacklist_d = set(exclude.get(CONF_DOMAINS, []))
    tags = conf.get(CONF_TAGS)
    tags_attributes = conf.get(CONF_TAGS_ATTRIBUTES)
    default_measurement = conf.get(CONF_DEFAULT_MEASUREMENT)
    override_measurement = conf.get(CONF_OVERRIDE_MEASUREMENT)
    component_config = EntityValues(conf[CONF_COMPONENT_CONFIG], conf[CONF_COMPONENT_CONFIG_DOMAIN], conf[CONF_COMPONENT_CONFIG_GLOB])
    try:
        influx = InfluxDBClient(**kwargs)
        influx.query('SHOW    SERIES    LIMIT    1;', database=conf[CONF_DB_NAME])
    except exceptions.InfluxDBClientError as exc:
        _LOGGER.error("Database    host    is    not    accessible    due    to    '%s',    please    check    your    entries    in    the    configuration    file    and    that    the    database    exists    and    is    READ/WRITE.", exc)
        return False
    def influx_event_listener(event):
        'Listen    for    new    messages    on    the    bus    and    sends    them    to    Influx.'
        state = event.data.get('new_state')
        if ((state is None) or (state.state in (STATE_UNKNOWN, '', STATE_UNAVAILABLE)) or (state.entity_id in blacklist_e) or (state.domain in blacklist_d)):
            return
        try:
            if ((whitelist_e and...

What's a good function header?

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

def setup(hass, config):