def METHOD_NAME():
    """
    In a context, remove and restore os.link if it exists
    """
    class NoValue:
        pass
    orig_val = getattr(os, 'link', NoValue)
    try:
        del os.link
    except Exception:
        pass
    try:
        yield
    finally:
        if orig_val is not NoValue:
            setattr(os, 'link', orig_val)