telethon/helpers.py
async def _cancel(log, **tasks):
    """
    Helper to cancel one or more tasks gracefully, logging exceptions.
    """
    for name, task in tasks.items():
        if not task:
            continue

        task.cancel()
        try:
            await task
        except asyncio.CancelledError:
            pass
        except Exception:
            log.exception('Unhandled exception from %s after cancel', name)

    Helper to cancel one or more tasks gracefully, logging exceptions.
    
Helper to cancel one or more tasks gracefully, logging exceptions.
Helper to cancel one or more tasks gracefully logging exceptions .
async def _cancel(log, **tasks):
    for name, task in tasks.items():
        if not task:
            continue
        task.cancel()
        try:
            await task
        except asyncio.CancelledError:
            pass
        except Exception:
            log.exception('Unhandled exception from %s after cancel', name)
async def _cancel ( log , ** tasks ) : for name , task in tasks . items ( ) : if not task : continue task . cancel ( ) try : await task except asyncio . CancelledError : pass except Exception : log . exception ( 'Unhandled exception from %s after cancel' , name )
Helper to cancel one or more tasks gracefully, logging exceptions.
Helper to cancel one or more tasks gracefully logging exceptions .
"""
    Helper to cancel one or more tasks gracefully, logging exceptions.
    """
log