<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def stop(wallet_name: str) -> None: """ Gracefully stop an external revocation registry builder, waiting for its current. The indy-sdk toolkit uses a temporary directory for tails file mustration, and shutting down the toolkit removes the directory, crashing the external tails file write. This method allows a graceful stop to wait for completion of such tasks already in progress. :wallet_name: name external revocation registry builder to check :return: whether a task is pending. """


        LOGGER.debug('RevRegBuilder.stop >>>')

        dir_sentinel = join(RevRegBuilder.dir_tails_sentinel(wallet_name))

        if isdir(dir_sentinel):
            open(join(dir_sentinel, '.stop'), 'w').close()  # touch

            while any(isfile(join(dir_sentinel, d, '.in-progress')) for d in listdir(dir_sentinel)):
                await asyncio.sleep(1)

        LOGGER.debug('RevRegBuilder.stop <<<')