code: def _get_random_sentence(all_baskets, forbidden_doc):
      """
      Get random line from another document for nextSentence task.
  
      :return: str, content of one line
      """
      # Similar to original BERT tf repo: This outer loop should rarely go for more than one iteration for large
      # corpora. However, just to be careful, we try to make sure that
      # the random document is not the same as the document we're processing.
      sentence = None
      for _ in range(100):
          rand_doc_idx = random.randrange(len(all_baskets))
          rand_doc = all_baskets[rand_doc_idx]
  
          # check if our picked random doc is really different to our initial doc
          if rand_doc != forbidden_doc:
              rand_sent_idx = random.randrange(len(rand_doc))
              sentence = rand_doc[rand_sent_idx]
              break
      if sentence is None:
          raise Exception(
              "Failed to pick out a suitable random substitute for next sentence"
          )
      return sentence
  
imports: import hashlib
  import json
  import logging
  import os
  import random
  import tarfile
  import tempfile
  import string
  import uuid
  from contextlib import ExitStack
  from itertools import islice
  from pathlib import Path
  import pandas
  from requests import get
  from tqdm import tqdm
  from typing import List
  from farm.file_utils import http_get
  from farm.modeling.tokenization import tokenize_with_metadata
label_desc: Use image node_id 17 for calling a global function with example usage: _get_random_sentence(all_baskets, forbidden_doc) and returns: sentence