code: def auth_connect(host, port=None):
      
      try:
          return connect(host, port)
      except RuntimeError as exc:
          if 'Request SASL authentication' not in str(exc):
              raise
      warnings.warn('Error authenticating against {0}:{1}'.format(host, port),
                    NDSWarning)
      kinit()
      return connect(host, port)
docs: Open an `nds2.connection` handling simple authentication errors
  
      This method will catch exceptions related to kerberos authentication,
      and execute a kinit() for the user before attempting to connect again.
  
      Parameters
      ----------
      host : `str`
          name of server with which to connect
  
      port : `int`, optional
          connection port
  
      Returns
      -------
      connection : `nds2.connection`
          a new open connection to the given NDS host