docstr: Returns all docs sorted by relevance to <topic_id>.
  Unlike get_docs, this ranks documents by the supplied topic_id rather
  than the topic_id to which document is most relevant.
docstr_tok: ["Returns","all","docs","sorted","by","relevance","to","<","topic_id",">",".","Unlike","get_docs",",","this","ranks","documents","by","the","supplied","topic_id","rather","than","the","topic_id","to","which","document","is","most","relevant","."]
code: def get_sorted_docs(self, topic_id):
      """
      Returns all docs sorted by relevance to <topic_id>.
      Unlike get_docs, this ranks documents by the supplied topic_id rather
      than the topic_id to which document is most relevant.
      """
      docs = self.get_docs()
      d = {}
      for doc in docs:
          d[doc["doc_id"]] = doc
      m = self.get_document_topic_distribution()
      doc_ids = (-m[:, topic_id]).argsort()
      return [d[doc_id] for doc_id in doc_ids]
  
imports: import time
  from ..None import utils
  from ..imports import *
  from .None import preprocessor
  from .None import textutils
label_desc: Use image node_id 5 for calling the TopicModel obj's underlying member method code with example usage: obj.get_sorted_docs(topic_id) and returns: unknown