docstr: Update the model's neural weights.
  
  To support linear learning-rate decay from (initial) `alpha` to `min_alpha`, and accurate
  progress-percentage logging, either `total_examples` (count of documents) or `total_words` (count of
  raw words in documents) **MUST** be provided. If `documents` is the same corpus
  that was provided to :meth:`~gensim.models.word2vec.Word2Vec.build_vocab` earlier,
  you can simply use `total_examples=self.corpus_count`.
  
  To avoid common mistakes around the model's ability to do multiple training passes itself, an
  explicit `epochs` argument **MUST** be provided. In the common and recommended case
  where :meth:`~gensim.models.word2vec.Word2Vec.train` is only called once,
  you can set `epochs=self.iter`.
  
  Parameters
  ----------
  corpus_iterable : iterable of list of :class:`~gensim.models.doc2vec.TaggedDocument`, optional
      Can be simply a list of elements, but for larger corpora,consider an iterable that streams
      the documents directly from disk/network. If you don't supply `documents` (or `corpus_file`), the model is
      left uninitialized -- use if you plan to initialize it in some other way.
  corpus_file : str, optional
      Path to a corpus file in :class:`~gensim.models.word2vec.LineSentence` format.
      You may use this argument instead of `documents` to get performance boost. Only one of `documents` or
      `corpus_file` arguments need to be passed (not both of them). Documents' tags are assigned automatically
      and are equal to line number, as in :class:`~gensim.models.doc2vec.TaggedLineDocument`.
  total_examples : int, optional
      Count of documents.
  total_words : int, optional
      Count of raw words in documents.
  epochs : int, optional
      Number of iterations (epochs) over the corpus.
  start_alpha : float, optional
      Initial learning rate. If supplied, replaces the starting `alpha` from the constructor,
      for this one call to `train`.
      Use only if making multiple calls to `train`, when you want to manage the alpha learning-rate yourself
      (not recommended).
  end_alpha : float, optional
      Final learning rate. Drops linearly from `start_alpha`.
      If supplied, this replaces the final `min_alpha` from the constructor, for this one call to
      :meth:`~gensim.models.doc2vec.Doc2Vec.train`.
      Use only if making multiple calls to :meth:`~gensim.models.doc2vec.Doc2Vec.train`, when you want to manage
      the alpha learning-rate yourself (not recommended).
  word_count : int, optional
      Count of words already trained. Set this to 0 for the usual
      case of training on all words in documents.
  queue_factor : int, optional
      Multiplier for size of queue (number of workers * queue_factor).
  report_delay : float, optional
      Seconds to wait before reporting progress.
  callbacks : :obj: `list` of :obj: `~gensim.models.callbacks.CallbackAny2Vec`, optional
      List of callbacks that need to be executed/run at specific stages during training.
code: def train(
      self,
      corpus_iterable=None,
      corpus_file=None,
      total_examples=None,
      total_words=None,
      epochs=None,
      start_alpha=None,
      end_alpha=None,
      word_count=0,
      queue_factor=2,
      report_delay=1.0,
      callbacks=(),
      **kwargs,
  ):
      """Update the model's neural weights.
  
      To support linear learning-rate decay from (initial) `alpha` to `min_alpha`, and accurate
      progress-percentage logging, either `total_examples` (count of documents) or `total_words` (count of
      raw words in documents) **MUST** be provided. If `documents` is the same corpus
      that was provided to :meth:`~gensim.models.word2vec.Word2Vec.build_vocab` earlier,
      you can simply use `total_examples=self.corpus_count`.
  
      To avoid common mistakes around the model's ability to do multiple training passes itself, an
      explicit `epochs` argument **MUST** be provided. In the common and recommended case
      where :meth:`~gensim.models.word2vec.Word2Vec.train` is only called once,
      you can set `epochs=self.iter`.
  
      Parameters
      ----------
      corpus_iterable : iterable of list of :class:`~gensim.models.doc2vec.TaggedDocument`, optional
          Can be simply a list of elements, but for larger corpora,consider an iterable that streams
          the documents directly from disk/network. If you don't supply `documents` (or `corpus_file`), the model is
          left uninitialized -- use if you plan to initialize it in some other way.
      corpus_file : str, optional
          Path to a corpus file in :class:`~gensim.models.word2vec.LineSentence` format.
          You may use this argument instead of `documents` to get performance boost. Only one of `documents` or
          `corpus_file` arguments need to be passed (not both of them). Documents' tags are assigned automatically
          and are equal to line number, as in :class:`~gensim.models.doc2vec.TaggedLineDocument`.
      total_examples : int, optional
          Count of documents.
      total_words : int, optional
          Count of raw words in documents.
      epochs : int, optional
          Number of iterations (epochs) over the corpus.
      start_alpha : float, optional
          Initial learning rate. If supplied, replaces the starting `alpha` from the constructor,
          for this one call to `train`.
          Use only if making multiple calls to `train`, when you want to manage the alpha learning-rate yourself
          (not recommended).
      end_alpha : float, optional
          Final learning rate. Drops linearly from `start_alpha`.
          If supplied, this replaces the final `min_alpha` from the constructor, for this one call to
          :meth:`~gensim.models.doc2vec.Doc2Vec.train`.
          Use only if making multiple calls to :meth:`~gensim.models.doc2vec.Doc2Vec.train`, when you want to manage
          the alpha learning-rate yourself (not recommended).
      word_count : int, optional
          Count of words already trained. Set this to 0 for the usual
          case of training on all words in documents.
      queue_factor : int, optional
          Multiplier for size of queue (number of workers * queue_factor).
      report_delay : float, optional
          Seconds to wait before reporting progress.
      callbacks : :obj: `list` of :obj: `~gensim.models.callbacks.CallbackAny2Vec`, optional
          List of callbacks that need to be executed/run at specific stages during training.
  
      """
      if corpus_file is None and corpus_iterable is None:
          raise TypeError(
              "Either one of corpus_file or corpus_iterable value must be provided"
          )
  
      if corpus_file is not None and corpus_iterable is not None:
          raise TypeError(
              "Both corpus_file and corpus_iterable must not be provided at the same time"
          )
  
      if corpus_iterable is None and not os.path.isfile(corpus_file):
          raise TypeError(
              "Parameter corpus_file must be a valid path to a file, got %r instead"
              % corpus_file
          )
  
      if corpus_iterable is not None and not isinstance(
          corpus_iterable, Iterable
      ):
          raise TypeError(
              "corpus_iterable must be an iterable of TaggedDocument, got %r instead"
              % corpus_iterable
          )
  
      if corpus_file is not None:
          # Calculate offsets for each worker along with initial doctags (doctag ~ document/line number in a file)
          (
              offsets,
              start_doctags,
          ) = self._get_offsets_and_start_doctags_for_corpusfile(
              corpus_file, self.workers
          )
          kwargs["offsets"] = offsets
          kwargs["start_doctags"] = start_doctags
  
      super(Doc2Vec, self).train(
          corpus_iterable=corpus_iterable,
          corpus_file=corpus_file,
          total_examples=total_examples,
          total_words=total_words,
          epochs=epochs,
          start_alpha=start_alpha,
          end_alpha=end_alpha,
          word_count=word_count,
          queue_factor=queue_factor,
          report_delay=report_delay,
          callbacks=callbacks,
          **kwargs,
      )
  
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 11 for calling the Doc2Vec obj's underlying member method code with example usage: obj.train(corpus_iterable, corpus_file, total_examples, total_words, epochs, start_alpha, end_alpha, word_count, queue_factor, report_delay, callbacks) without return types