parameters: (capture)
docstring: Replace warning.showwarning with idle_showwarning, or reverse.
docstring_summary: Replace warning.showwarning with idle_showwarning, or reverse.
docstring_tokens: Replace warning . showwarning with idle_showwarning or reverse .
function: def capture_warnings(capture):
      "Replace warning.showwarning with idle_showwarning, or reverse."
  
      global _warnings_showwarning
      if capture:
          if _warnings_showwarning is None:
              _warnings_showwarning = warnings.showwarning
              warnings.showwarning = idle_showwarning
      else:
          if _warnings_showwarning is not None:
              warnings.showwarning = _warnings_showwarning
              _warnings_showwarning = None
function_tokens: def capture_warnings ( capture ) : global _warnings_showwarning if capture : if _warnings_showwarning is None : _warnings_showwarning = warnings . showwarning warnings . showwarning = idle_showwarning else : if _warnings_showwarning is not None : warnings . showwarning = _warnings_showwarning _warnings_showwarning = None