async def METHOD_NAME(event_loop, storage):
    obj = MagicMock()
    service = ManualService("id", Protocol.DMAP, 0, {})
    config = AppleTV("Apple TV", "127.0.0.1")
    config.add_service(service)
    zeroconf = zeroconf_stub.stub(pairing)
    async def _start(
        pin_code=PIN_CODE, pairing_guid=PAIRING_GUID, name=REMOTE_NAME, addresses=None
    ):
        options = {"zeroconf": zeroconf}
        if pairing_guid:
            options["pairing_guid"] = pairing_guid
        if name:
            options["name"] = name
        if addresses:
            options["addresses"] = addresses
        settings = await storage.get_settings(config)
        core = await create_core(config, service, settings=settings, loop=event_loop)
        obj.pairing = pairing.DmapPairingHandler(core, **options)
        await obj.pairing.begin()
        obj.pairing.pin(pin_code)
        return obj.pairing, zeroconf, service
    yield _start
    await obj.pairing.finish()
    await obj.pairing.close()