code: def extract_documents():
      fname = download_dataset()
  
      index = 0
  
      with tarfile.open(fname, mode="r:gz") as tar:
          for member in tar.getmembers():
              if re.match(
                  r"aclImdb/(train|test)/(pos|neg|unsup)/\d+_\d+.txt$",
                  member.name,
              ):
                  member_bytes = tar.extractfile(member).read()
                  member_text = member_bytes.decode(
                      "utf-8", errors="replace"
                  )
                  assert member_text.count("\n") == 0
                  yield create_sentiment_document(
                      member.name, member_text, index
                  )
                  index += 1
  
imports: import logging
  import collections
  import io
  import re
  import tarfile
  import os.path
  import smart_open
  import gensim.utils
  import multiprocessing
  from collections import OrderedDict
  import gensim.models.doc2vec
  from gensim.models.doc2vec import Doc2Vec
  from gensim.test.test_doc2vec import ConcatenatedDoc2Vec
  import numpy
  import statsmodels.api
  from random import sample
  from collections import defaultdict
  from random import shuffle
  import random
  import random
  from gensim.test.utils import datapath
label_desc: Use image node_id 3 for calling a global function with example usage: extract_documents() without return types