parameters: (self)
docstring: Close port
docstring_summary: Close port
docstring_tokens: Close port
function: def close(self):
          """Close port"""
          if self._isOpen:
              if self.fd is not None:
                  os.close(self.fd)
                  self.fd = None
              self._isOpen = False
function_tokens: def close ( self ) : if self . _isOpen : if self . fd is not None : os . close ( self . fd ) self . fd = None self . _isOpen = False