class_docstr: A Thread for running a zmq Authenticator
  
  This is run in the background by ThreadedAuthenticator
class_docstr_tok: ["A","Thread","for","running","a","zmq","Authenticator","This","is","run","in","the","background","by","ThreadedAuthenticator"]
code: def __init__(
      self,
      context,
      endpoint,
      encoding="utf-8",
      log=None,
      authenticator=None,
  ):
      super(AuthenticationThread, self).__init__()
      self.context = context or zmq.Context.instance()
      self.encoding = encoding
      self.log = log = log or logging.getLogger("zmq.auth")
      self.started = Event()
      self.authenticator = authenticator or Authenticator(
          context, encoding=encoding, log=log
      )
  
      # create a socket to communicate back to main thread.
      self.pipe = context.socket(zmq.PAIR)
      self.pipe.linger = 1
      self.pipe.connect(endpoint)
  
imports: import time
  import logging
  from threading import Thread, Event
  import zmq
  from zmq.utils import jsonapi
  from zmq.utils.strtypes import bytes, unicode, b, u
  import sys
  from .base import Authenticator
label_desc: Use image node_id 1 to create a new AuthenticationThread object from inherited base classes: Thread with example: obj = AuthenticationThread(context, endpoint, encoding, log, authenticator)