code: def stop_patching(name=None):
      # type: (Optional[str]) -> None
      
      global _patchers, _mocks
      if not _patchers:
          warnings.warn('stop_patching() called again, already stopped')
  
      if name is not None:
          items = [(name, _patchers[name])]
      else:
          items = list(_patchers.items())
  
      for name, patcher in items:
          patcher.stop()
          del _patchers[name]
          del _mocks[name]
docs: Finish the mocking initiated by `start_patching`
  
      Kwargs:
          name (Optional[str]): if given, only unpatch the specified path, else all
              defined default mocks