parameters: (self)
docstring: Closes the stream.
docstring_summary: Closes the stream.
docstring_tokens: Closes the stream .
function: def close(self):
          """
          Closes the stream.
          """
          self.acquire()
          try:
              if self.stream:
                  self.flush()
                  if hasattr(self.stream, "close"):
                      self.stream.close()
                  StreamHandler.close(self)
                  self.stream = None
          finally:
              self.release()
function_tokens: def close ( self ) : self . acquire ( ) try : if self . stream : self . flush ( ) if hasattr ( self . stream , "close" ) : self . stream . close ( ) StreamHandler . close ( self ) self . stream = None finally : self . release ( )