docstr: Iterate over a file that contains documents:
  one line = :class:`~gensim.models.doc2vec.TaggedDocument` object.
  
  Words are expected to be already preprocessed and separated by whitespace. Document tags are constructed
  automatically from the document line number (each document gets a unique integer tag).
  
  Parameters
  ----------
  source : string or a file-like object
      Path to the file on disk, or an already-open file object (must support `seek(0)`).
  
  Examples
  --------
  .. sourcecode:: pycon
  
      >>> from gensim.test.utils import datapath
      >>> from gensim.models.doc2vec import TaggedLineDocument
      >>>
      >>> for document in TaggedLineDocument(datapath("head500.noblanks.cor")):
      ...     pass
code: def __init__(self, source):
      """Iterate over a file that contains documents:
      one line = :class:`~gensim.models.doc2vec.TaggedDocument` object.
  
      Words are expected to be already preprocessed and separated by whitespace. Document tags are constructed
      automatically from the document line number (each document gets a unique integer tag).
  
      Parameters
      ----------
      source : string or a file-like object
          Path to the file on disk, or an already-open file object (must support `seek(0)`).
  
      Examples
      --------
      .. sourcecode:: pycon
  
          >>> from gensim.test.utils import datapath
          >>> from gensim.models.doc2vec import TaggedLineDocument
          >>>
          >>> for document in TaggedLineDocument(datapath("head500.noblanks.cor")):
          ...     pass
  
      """
      self.source = source
  
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 1 to create a new TaggedLineDocument object  with example: obj = TaggedLineDocument(source)