def METHOD_NAME(logger):
    """Setup ophyd for use
    Must be called once per session using ophyd
    """
    # It's important to use the same context in the callback _dispatcher
    # as the main thread, otherwise not-so-savvy users will be very
    # confused
    global _dispatcher
    if _dispatcher is not None:
        logger.debug("ophyd already setup")
        return
    pyepics_compat._get_pv = pyepics_compat.get_pv
    pyepics_compat.get_pv = get_pv
    def _cleanup():
        """Clean up the ophyd session"""
        global _dispatcher
        if _dispatcher is None:
            return
        pyepics_compat.get_pv = pyepics_compat._get_pv
        if _dispatcher.is_alive():
            _dispatcher.stop()
        _dispatcher = None
    logger.debug("Installing event dispatcher")
    context = PV._default_context.broadcaster
    _dispatcher = EventDispatcher(
        thread_class=CaprotoCallbackThread, context=context, logger=logger
    )
    atexit.register(_cleanup)
    return _dispatcher