original_docstring: Tries to connect to a running simspark instance. The instance could be started by this class or was started
          externally.
docstring: Tries to connect to a running simspark instance. The instance could be started by this class or was started
  externally.
docstring_tokens: Tries to connect to a running simspark instance . The instance could be started by this class or was started externally .
code: def connect(self):
          """Tries to connect to a running simspark instance. The instance could be started by this class or was started
          externally."""
          if not self.__start_instance or (self.__p and self.__p.poll() is None):
              logging.info("Connecting to simspark")
              try:
                  self.socket = socket.create_connection((self.host, self.port))
                  self.connected.set()
                  logging.info("Connected")
              except Exception as e:
                  print('ERROR! Couldnt connect to simspark', e)
                  if self.__p:
                      print(self.__p.stdout.peek().decode())
          else:
              logging.error("Simspark isn't running!?")
code_tokens: def connect ( self ) : if not self . __start_instance or ( self . __p and self . __p . poll ( ) is None ) : logging . info ( "Connecting to simspark" ) try : self . socket = socket . create_connection ( ( self . host , self . port ) ) self . connected . set ( ) logging . info ( "Connected" ) except Exception as e : print ( 'ERROR! Couldnt connect to simspark' , e ) if self . __p : print ( self . __p . stdout . peek ( ) . decode ( ) ) else : logging . error ( "Simspark isn't running!?" )
short_docstring: Tries to connect to a running simspark instance.
short_docstring_tokens: Tries to connect to a running simspark instance .
comment: """Tries to connect to a running simspark instance. The instance could be started by this class or was started
          externally."""