code: def _get_notmuch_thread(self, tid):
          
          query = self.query('thread:' + tid)
          try:
              return next(query.search_threads())
          except StopIteration:
              errmsg = 'no thread with id %s exists!' % tid
              raise NonexistantObjectError(errmsg)
docs: returns :class:`notmuch.database.Thread` with given id