def METHOD_NAME(loader):
    """
    A context manager that sets and un-sets the loader context
    """
    tok = loader_ctxvar.set(loader)
    try:
        yield
    finally:
        loader_ctxvar.reset(tok)