code: def get_corpus_line(self, item):
          
          t1 = ""
          t2 = ""
          assert item < self.corpus_lines
          if self.on_memory:
              sample = self.sample_to_doc[item]
              t1 = self.all_docs[sample["doc_id"]][sample["line"]]
              t2 = self.all_docs[sample["doc_id"]][sample["line"]+1]
              # used later to avoid random nextSentence from same doc
              self.current_doc = sample["doc_id"]
              return t1, t2
          else:
              if self.line_buffer is None:
                  # read first non-empty line of file
                  while t1 == "" :
                      t1 = next(self.file).strip()
                      t2 = next(self.file).strip()
              else:
                  # use t2 from previous iteration as new t1
                  t1 = self.line_buffer
                  t2 = next(self.file).strip()
                  # skip empty rows that are used for separating documents and keep track of current doc id
                  while t2 == "" or t1 == "":
                      t1 = next(self.file).strip()
                      t2 = next(self.file).strip()
                      self.current_doc = self.current_doc+1
              self.line_buffer = t2
  
          assert t1 != ""
          assert t2 != ""
          return t1, t2
docs: Get one sample from corpus consisting of a pair of two subsequent lines from the same doc.
          :param item: int, index of sample.
          :return: (str, str), two subsequent sentences from corpus