Discover and register all post import hooks named in the
    'AUTOWRAPT_BOOTSTRAP' environment variable. The value of the
    environment variable must be a comma separated list.

def register_bootstrap_functions():
    '''Discover and register all post import hooks named in the
    'AUTOWRAPT_BOOTSTRAP' environment variable. The value of the
    environment variable must be a comma separated list.

    '''

    # This can be called twice if '.pth' file bootstrapping works and
    # the 'autowrapt' wrapper script is still also used. We therefore
    # protect ourselves just in case it is called a second time as we
    # only want to force registration once.

    global _registered

    if _registered:
        return 

    _registered = True

    # It should be safe to import wrapt at this point as this code will
    # be executed after all Python module search directories have been
    # added to the module search path.

    from wrapt import discover_post_import_hooks

    for name in os.environ.get('AUTOWRAPT_BOOTSTRAP', '').split(','):
        discover_post_import_hooks(name)