docstr: Iterate through the corpus.
  
  Yields
  ------
  :class:`~gensim.models.doc2vec.TaggedDocument`
      Document from `source`.
code: def __iter__(self):
      """Iterate through the corpus.
  
      Yields
      ------
      :class:`~gensim.models.doc2vec.TaggedDocument`
          Document from `source`.
  
      """
      for fname in os.listdir(self.dirname):
          fname = os.path.join(self.dirname, fname)
          if not os.path.isfile(fname):
              continue
          with utils.open(fname, "rb") as fin:
              for item_no, line in enumerate(fin):
                  line = utils.to_unicode(line)
                  # each file line is a single document in the Brown corpus
                  # each token is WORD/POS_TAG
                  token_tags = [
                      t.split("/")
                      for t in line.split()
                      if len(t.split("/")) == 2
                  ]
                  # ignore words with non-alphabetic tags like ",", "!" etc (punctuation, weird stuff)
                  words = [
                      "%s/%s" % (token.lower(), tag[:2])
                      for token, tag in token_tags
                      if tag[:2].isalpha()
                  ]
                  if (
                      not words
                  ):  # don't bother sending out empty documents
                      continue
                  yield TaggedDocument(
                      words, ["%s_SENT_%s" % (fname, item_no)]
                  )
  
imports: import logging
  import os
  from collections import namedtuple, defaultdict
  from collections.abc import Iterable
  from timeit import default_timer
  from dataclasses import dataclass
  from numpy import zeros, float32, vstack, integer, dtype
  import numpy
  from gensim import utils, matutils
  from gensim.utils import deprecated
  from gensim.models import Word2Vec, FAST_VERSION
  from gensim.models.keyedvectors import KeyedVectors, pseudorandom_weak_vector
label_desc: Use image node_id 2 for calling the TaggedBrownCorpus obj's underlying member method code with example usage: obj.__iter__() without return types