human
I wrote the below code

    import Adafruit_BBIO.GPIO as GPIO
    def cleanup_gpio(event):
        'Stuff    to    do    before    stopping.'
        GPIO.cleanup()
    def prepare_gpio(event):
        'Stuff    to    do    when    home    assistant    starts.'
        hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, cleanup_gpio)
    hass.bus.listen_once(EVENT_HOMEASSISTANT_START, prepare_gpio)
    return True

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

def setup(hass, config):