parameters: ()
docstring: In a context, remove and restore os.link if it exists
docstring_summary: In a context, remove and restore os.link if it exists
docstring_tokens: In a context remove and restore os . link if it exists
function: def _remove_os_link():
          """
          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)
function_tokens: def _remove_os_link ( ) : 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 )