docstr: Iterate through the lines in the source.
  
  Yields
  ------
  :class:`~gensim.models.doc2vec.TaggedDocument`
      Document from `source` specified in the constructor.
code: def __iter__(self):
      """Iterate through the lines in the source.
  
      Yields
      ------
      :class:`~gensim.models.doc2vec.TaggedDocument`
          Document from `source` specified in the constructor.
  
      """
      try:
          # Assume it is a file-like object and try treating it as such
          # Things that don't have seek will trigger an exception
          self.source.seek(0)
          for item_no, line in enumerate(self.source):
              yield TaggedDocument(
                  utils.to_unicode(line).split(), [item_no]
              )
      except AttributeError:
          # If it didn't work like a file, use it as a string filename
          with utils.open(self.source, "rb") as fin:
              for item_no, line in enumerate(fin):
                  yield TaggedDocument(
                      utils.to_unicode(line).split(), [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 TaggedLineDocument obj's underlying member method code with example usage: obj.__iter__() without return types