parameters: (self)
docstring: Close port
docstring_summary: Close port
docstring_tokens: Close port
function: def close(self):
          """Close port"""
          if self.is_open:
              self._close()
              self.is_open = False
function_tokens: def close ( self ) : if self . is_open : self . _close ( ) self . is_open = False