code: def read_docs_from_txt(
      filename,
      delimiter="",
      encoding="utf-8",
      max_docs=None,
      proxies=None,
      disable_tqdm=True,
  ):
      """Reads a text file with one sentence per line and a delimiter between docs (default: empty lines) ."""
      if not (os.path.exists(filename)):
          _download_extract_downstream_data(filename, proxies)
  
      doc_count = 0
      doc = []
      prev_doc = None
      corpus_lines = 0
  
      with open(filename, "r", encoding=encoding) as f:
          for line_num, line in enumerate(
              tqdm(
                  f,
                  desc="Loading Dataset",
                  total=corpus_lines,
                  disable=disable_tqdm,
              )
          ):
              line = line.strip()
              if line == delimiter:
                  if len(doc) > 0:
                      yield {"doc": doc}
                      doc_count += 1
                      prev_doc = doc
                      doc = []
                      if max_docs:
                          if doc_count >= max_docs:
                              logger.info(
                                  f"Reached number of max_docs ({max_docs}). Skipping rest of file ..."
                              )
                              break
                  else:
                      logger.warning(
                          f"Found empty document in '{filename}' (line {line_num}). "
                          f"Make sure that you comply with the format: "
                          f"One sentence per line and exactly *one* empty line between docs. "
                          f"You might have multiple subsequent empty lines."
                      )
              else:
                  doc.append(line)
  
          # if last row in file is not empty, we add the last parsed doc manually to all_docs
          if len(doc) > 0:
              if doc_count > 0:
                  if doc != prev_doc:
                      yield {"doc": doc}
                      doc_count += 1
              else:
                  yield {"doc": doc}
                  doc_count += 1
  
          if doc_count < 2:
              raise ValueError(
                  f"Found only {doc_count} docs in {filename}). You need at least 2! \n"
                  f"Make sure that you comply with the format: \n"
                  f"-> One sentence per line and exactly *one* empty line between docs. \n"
                  f"You might have a single block of text without empty lines inbetween."
              )
  
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 13 for calling a global function with example usage: read_docs_from_txt(filename, delimiter, encoding, max_docs, proxies, disable_tqdm) without return types