human
I wrote the below code

    import nest
    if ('nest' in _CONFIGURING):
        return
    conf = config[DOMAIN]
    client_id = conf[CONF_CLIENT_ID]
    client_secret = conf[CONF_CLIENT_SECRET]
    filename = config.get(CONF_FILENAME, NEST_CONFIG_FILE)
    access_token_cache_file = hass.config.path(filename)
    nest = nest.Nest(access_token_cache_file=access_token_cache_file, client_id=client_id, client_secret=client_secret)
    setup_nest(hass, nest, config)
    def set_mode(service):
        'Set    the    home/away    mode    for    a    Nest    structure.'
        if (ATTR_STRUCTURE in service.data):
            structures = service.data[ATTR_STRUCTURE]
        else:
            structures = hass.data[DATA_NEST].local_structure
        for structure in nest.structures:
            if (structure.name in structures):
                _LOGGER.info('Setting    mode    for    %s', structure.name)
                structure.away = service.data[ATTR_HOME_MODE]
            else:
                _LOGGER.error('Invalid    structure    %s', service.data[ATTR_STRUCTURE])
    hass.services.register(DOMAIN, 'set_mode', set_mode, schema=AWAY_SCHEMA)
    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):