parameters: ()
return_statement: return
docstring: thread worker function
docstring_summary: thread worker function
docstring_tokens: thread worker function
function: def read_thread():
      """thread worker function"""
      global okcnt, errorflg
      flag = 1
      while flag:
          rep = s.readline().decode('latin1')
          n = rep.count("ok")
          if n == 0:
              print("Incoming: " + rep)
              if "error" in rep or "!!" in rep or "ALARM" in rep or "ERROR" in rep:
                  errorflg = True
                  break
          else:
              okcnt += n
  
      print("Read thread exited")
      return
function_tokens: def read_thread ( ) : global okcnt , errorflg flag = 1 while flag : rep = s . readline ( ) . decode ( 'latin1' ) n = rep . count ( "ok" ) if n == 0 : print ( "Incoming: " + rep ) if "error" in rep or "!!" in rep or "ALARM" in rep or "ERROR" in rep : errorflg = True break else : okcnt += n print ( "Read thread exited" ) return