human
I wrote the below code

    import pywemo
    global SUBSCRIPTION_REGISTRY
    SUBSCRIPTION_REGISTRY = pywemo.SubscriptionRegistry()
    SUBSCRIPTION_REGISTRY.start()
    def stop_wemo(event):
        'Shutdown    Wemo    subscriptions    and    subscription    thread    on    exit.'
        _LOGGER.info('Shutting    down    subscriptions.')
        SUBSCRIPTION_REGISTRY.stop()
    hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, stop_wemo)
    def discovery_dispatch(service, discovery_info):
        'Dispatcher    for    WeMo    discovery    events.'
        model_name = discovery_info.get('model_name')
        serial = discovery_info.get('serial')
        if (serial in KNOWN_DEVICES):
            return
        _LOGGER.debug('Discovered    unique    device    %s', serial)
        KNOWN_DEVICES.append(serial)
        component = WEMO_MODEL_DISPATCH.get(model_name, 'switch')
        discovery.load_platform(hass, component, DOMAIN, discovery_info, config)
    discovery.listen(hass, SERVICE_WEMO, discovery_dispatch)
    _LOGGER.info('Scanning    for    WeMo    devices.')
    devices = [(device.host, device) for device in pywemo.discover_devices()]
    devices.extend(((address, None) for address in config.get(DOMAIN, {}).get(CONF_STATIC, [])))
    for (address, device) in devices:
        port = pywemo.ouimeaux_device.probe_wemo(address)
        if (not port):
            _LOGGER.warning('Unable    to    probe    wemo    at    %s', address)
            continue
        _LOGGER.info('Adding    wemo    at    %s:%i', address, port)
        url = ('http://%s:%i/setup.xml' % (address, port))
        if (device is None):
            device = pywemo.discovery.device_from_description(url, None)
        discovery_info = {'model_name': device.model_name, 'serial': device.serialnumber, 'mac_address': device.mac, 'ssdp_description': url}
        discovery.discover(hass, SERVICE_WEMO, discovery_info)
    return True

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

def setup(hass, config):