We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
sklearn_api.d2vmodel.D2VTransformer uses deprecated arguments size and iter
#### Description
The D2VTransformer in `sklearn_api.d2vmodel` uses the deprecated arguments `size` instead of `vector_size` and `iter` instead of `epochs`. According to the warnings this will be breaking in version 4.0.0.

#### Code to Reproduce
```
from gensim.sklearn_api.d2vmodel import D2VTransformer
from gensim.models.doc2vec import TaggedDocument
d2v = D2VTransformer(size=1, iter=1).fit([TaggedDocument(['a','a','a','a','a'], [0])]) # gives warnings
d2v = D2VTransformer(vector_size=1, epochs=1).fit([TaggedDocument(['a','a','a','a','a'], [0])]) #gives errors
```

#### Resulting warnings and errors:
```
/lib/python3.6/site-packages/gensim/models/doc2vec.py:355: UserWarning: The parameter `iter` is deprecated, will be removed in 4.0.0, use `epochs` instead.
  warnings.warn("The parameter `iter` is deprecated, will be removed in 4.0.0, use `epochs` instead.")
/lib/python3.6/site-packages/gensim/models/doc2vec.py:359: UserWarning: The parameter `size` is deprecated, will be removed in 4.0.0, use `vector_size` instead.
  warnings.warn("The parameter `size` is deprecated, will be removed in 4.0.0, use `vector_size` instead.")
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-108-561949d569bd> in <module>()
      2 from gensim.models.doc2vec import TaggedDocument
      3 d2v = D2VTransformer(size=1, iter=1).fit([TaggedDocument(['a','a','a','a','a'], [0])])
----> 4 d2v = D2VTransformer(vector_size=1, epochs=1).fit([TaggedDocument(['a','a','a','a','a'], [0])])

TypeError: __init__() got an unexpected keyword argument 'vector_size'
```

#### Versions
```
Linux-4.13.0-36-generic-x86_64-with-Ubuntu-17.10-artful
Python 3.6.3 (default, Oct  3 2017, 21:45:48) 
[GCC 7.2.0]
NumPy 1.14.1
SciPy 1.0.0
gensim 3.3.0
FAST_VERSION 1
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `gensim/sklearn_api/d2vmodel.py`
Content:
```
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 #
4 # Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>
5 # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
6 
7 """
8 Scikit learn interface for gensim for easy use of gensim with scikit-learn
9 Follows scikit-learn API conventions
10 """
11 
12 import numpy as np
13 from six import string_types
14 from sklearn.base import TransformerMixin, BaseEstimator
15 from sklearn.exceptions import NotFittedError
16 
17 from gensim import models
18 from gensim.models import doc2vec
19 
20 
21 class D2VTransformer(TransformerMixin, BaseEstimator):
22     """
23     Base Doc2Vec module
24     """
25 
26     def __init__(self, dm_mean=None, dm=1, dbow_words=0, dm_concat=0, dm_tag_count=1, docvecs=None,
27                  docvecs_mapfile=None, comment=None, trim_rule=None, size=100, alpha=0.025, window=5, min_count=5,
28                  max_vocab_size=None, sample=1e-3, seed=1, workers=3, min_alpha=0.0001, hs=0, negative=5, cbow_mean=1,
29                  hashfxn=hash, iter=5, sorted_vocab=1, batch_words=10000):
30         """
31         Sklearn api for Doc2Vec model. See gensim.models.Doc2Vec and gensim.models.Word2Vec for parameter details.
32         """
33         self.gensim_model = None
34         self.dm_mean = dm_mean
35         self.dm = dm
36         self.dbow_words = dbow_words
37         self.dm_concat = dm_concat
38         self.dm_tag_count = dm_tag_count
39         self.docvecs = docvecs
40         self.docvecs_mapfile = docvecs_mapfile
41         self.comment = comment
42         self.trim_rule = trim_rule
43 
44         # attributes associated with gensim.models.Word2Vec
45         self.size = size
46         self.alpha = alpha
47         self.window = window
48         self.min_count = min_count
49         self.max_vocab_size = max_vocab_size
50         self.sample = sample
51         self.seed = seed
52         self.workers = workers
53         self.min_alpha = min_alpha
54         self.hs = hs
55         self.negative = negative
56         self.cbow_mean = int(cbow_mean)
57         self.hashfxn = hashfxn
58         self.iter = iter
59         self.sorted_vocab = sorted_vocab
60         self.batch_words = batch_words
61 
62     def fit(self, X, y=None):
63         """
64         Fit the model according to the given training data.
65         Calls gensim.models.Doc2Vec
66         """
67         if isinstance(X[0], doc2vec.TaggedDocument):
68             d2v_sentences = X
69         else:
70             d2v_sentences = [doc2vec.TaggedDocument(words, [i]) for i, words in enumerate(X)]
71         self.gensim_model = models.Doc2Vec(
72             documents=d2v_sentences, dm_mean=self.dm_mean, dm=self.dm,
73             dbow_words=self.dbow_words, dm_concat=self.dm_concat, dm_tag_count=self.dm_tag_count,
74             docvecs=self.docvecs, docvecs_mapfile=self.docvecs_mapfile, comment=self.comment,
75             trim_rule=self.trim_rule, size=self.size, alpha=self.alpha, window=self.window,
76             min_count=self.min_count, max_vocab_size=self.max_vocab_size, sample=self.sample,
77             seed=self.seed, workers=self.workers, min_alpha=self.min_alpha, hs=self.hs,
78             negative=self.negative, cbow_mean=self.cbow_mean, hashfxn=self.hashfxn,
79             iter=self.iter, sorted_vocab=self.sorted_vocab, batch_words=self.batch_words
80         )
81         return self
82 
83     def transform(self, docs):
84         """
85         Return the vector representations for the input documents.
86         The input `docs` should be a list of lists like
87         [['calculus', 'mathematical'],
88         ['geometry', 'operations', 'curves']]
89         or a single document like : ['calculus', 'mathematical']
90         """
91         if self.gensim_model is None:
92             raise NotFittedError(
93                 "This model has not been fitted yet. Call 'fit' with appropriate arguments before using this method."
94             )
95 
96         # The input as array of array
97         if isinstance(docs[0], string_types):
98             docs = [docs]
99         vectors = [self.gensim_model.infer_vector(doc) for doc in docs]
100         return np.reshape(np.array(vectors), (len(docs), self.gensim_model.vector_size))
101
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/gensim/sklearn_api/d2vmodel.py b/gensim/sklearn_api/d2vmodel.py
--- a/gensim/sklearn_api/d2vmodel.py
+++ b/gensim/sklearn_api/d2vmodel.py
@@ -72,11 +72,11 @@
             documents=d2v_sentences, dm_mean=self.dm_mean, dm=self.dm,
             dbow_words=self.dbow_words, dm_concat=self.dm_concat, dm_tag_count=self.dm_tag_count,
             docvecs=self.docvecs, docvecs_mapfile=self.docvecs_mapfile, comment=self.comment,
-            trim_rule=self.trim_rule, size=self.size, alpha=self.alpha, window=self.window,
+            trim_rule=self.trim_rule, vector_size=self.size, alpha=self.alpha, window=self.window,
             min_count=self.min_count, max_vocab_size=self.max_vocab_size, sample=self.sample,
             seed=self.seed, workers=self.workers, min_alpha=self.min_alpha, hs=self.hs,
             negative=self.negative, cbow_mean=self.cbow_mean, hashfxn=self.hashfxn,
-            iter=self.iter, sorted_vocab=self.sorted_vocab, batch_words=self.batch_words
+            epochs=self.iter, sorted_vocab=self.sorted_vocab, batch_words=self.batch_words
         )
         return self

{"golden_diff": "diff --git a/gensim/sklearn_api/d2vmodel.py b/gensim/sklearn_api/d2vmodel.py\n--- a/gensim/sklearn_api/d2vmodel.py\n+++ b/gensim/sklearn_api/d2vmodel.py\n@@ -72,11 +72,11 @@\n             documents=d2v_sentences, dm_mean=self.dm_mean, dm=self.dm,\n             dbow_words=self.dbow_words, dm_concat=self.dm_concat, dm_tag_count=self.dm_tag_count,\n             docvecs=self.docvecs, docvecs_mapfile=self.docvecs_mapfile, comment=self.comment,\n-            trim_rule=self.trim_rule, size=self.size, alpha=self.alpha, window=self.window,\n+            trim_rule=self.trim_rule, vector_size=self.size, alpha=self.alpha, window=self.window,\n             min_count=self.min_count, max_vocab_size=self.max_vocab_size, sample=self.sample,\n             seed=self.seed, workers=self.workers, min_alpha=self.min_alpha, hs=self.hs,\n             negative=self.negative, cbow_mean=self.cbow_mean, hashfxn=self.hashfxn,\n-            iter=self.iter, sorted_vocab=self.sorted_vocab, batch_words=self.batch_words\n+            epochs=self.iter, sorted_vocab=self.sorted_vocab, batch_words=self.batch_words\n         )\n         return self\n", "issue": "sklearn_api.d2vmodel.D2VTransformer uses deprecated arguments size and iter\n#### Description\r\nThe D2VTransformer in `sklearn_api.d2vmodel` uses the deprecated arguments `size` instead of `vector_size` and `iter` instead of `epochs`. According to the warnings this will be breaking in version 4.0.0.\r\n\r\n#### Code to Reproduce\r\n```\r\nfrom gensim.sklearn_api.d2vmodel import D2VTransformer\r\nfrom gensim.models.doc2vec import TaggedDocument\r\nd2v = D2VTransformer(size=1, iter=1).fit([TaggedDocument(['a','a','a','a','a'], [0])]) # gives warnings\r\nd2v = D2VTransformer(vector_size=1, epochs=1).fit([TaggedDocument(['a','a','a','a','a'], [0])]) #gives errors\r\n```\r\n\r\n#### Resulting warnings and errors:\r\n```\r\n/lib/python3.6/site-packages/gensim/models/doc2vec.py:355: UserWarning: The parameter `iter` is deprecated, will be removed in 4.0.0, use `epochs` instead.\r\n  warnings.warn(\"The parameter `iter` is deprecated, will be removed in 4.0.0, use `epochs` instead.\")\r\n/lib/python3.6/site-packages/gensim/models/doc2vec.py:359: UserWarning: The parameter `size` is deprecated, will be removed in 4.0.0, use `vector_size` instead.\r\n  warnings.warn(\"The parameter `size` is deprecated, will be removed in 4.0.0, use `vector_size` instead.\")\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n<ipython-input-108-561949d569bd> in <module>()\r\n      2 from gensim.models.doc2vec import TaggedDocument\r\n      3 d2v = D2VTransformer(size=1, iter=1).fit([TaggedDocument(['a','a','a','a','a'], [0])])\r\n----> 4 d2v = D2VTransformer(vector_size=1, epochs=1).fit([TaggedDocument(['a','a','a','a','a'], [0])])\r\n\r\nTypeError: __init__() got an unexpected keyword argument 'vector_size'\r\n```\r\n\r\n#### Versions\r\n```\r\nLinux-4.13.0-36-generic-x86_64-with-Ubuntu-17.10-artful\r\nPython 3.6.3 (default, Oct  3 2017, 21:45:48) \r\n[GCC 7.2.0]\r\nNumPy 1.14.1\r\nSciPy 1.0.0\r\ngensim 3.3.0\r\nFAST_VERSION 1\r\n```\r\n\n", "before_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>\n# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html\n\n\"\"\"\nScikit learn interface for gensim for easy use of gensim with scikit-learn\nFollows scikit-learn API conventions\n\"\"\"\n\nimport numpy as np\nfrom six import string_types\nfrom sklearn.base import TransformerMixin, BaseEstimator\nfrom sklearn.exceptions import NotFittedError\n\nfrom gensim import models\nfrom gensim.models import doc2vec\n\n\nclass D2VTransformer(TransformerMixin, BaseEstimator):\n    \"\"\"\n    Base Doc2Vec module\n    \"\"\"\n\n    def __init__(self, dm_mean=None, dm=1, dbow_words=0, dm_concat=0, dm_tag_count=1, docvecs=None,\n                 docvecs_mapfile=None, comment=None, trim_rule=None, size=100, alpha=0.025, window=5, min_count=5,\n                 max_vocab_size=None, sample=1e-3, seed=1, workers=3, min_alpha=0.0001, hs=0, negative=5, cbow_mean=1,\n                 hashfxn=hash, iter=5, sorted_vocab=1, batch_words=10000):\n        \"\"\"\n        Sklearn api for Doc2Vec model. See gensim.models.Doc2Vec and gensim.models.Word2Vec for parameter details.\n        \"\"\"\n        self.gensim_model = None\n        self.dm_mean = dm_mean\n        self.dm = dm\n        self.dbow_words = dbow_words\n        self.dm_concat = dm_concat\n        self.dm_tag_count = dm_tag_count\n        self.docvecs = docvecs\n        self.docvecs_mapfile = docvecs_mapfile\n        self.comment = comment\n        self.trim_rule = trim_rule\n\n        # attributes associated with gensim.models.Word2Vec\n        self.size = size\n        self.alpha = alpha\n        self.window = window\n        self.min_count = min_count\n        self.max_vocab_size = max_vocab_size\n        self.sample = sample\n        self.seed = seed\n        self.workers = workers\n        self.min_alpha = min_alpha\n        self.hs = hs\n        self.negative = negative\n        self.cbow_mean = int(cbow_mean)\n        self.hashfxn = hashfxn\n        self.iter = iter\n        self.sorted_vocab = sorted_vocab\n        self.batch_words = batch_words\n\n    def fit(self, X, y=None):\n        \"\"\"\n        Fit the model according to the given training data.\n        Calls gensim.models.Doc2Vec\n        \"\"\"\n        if isinstance(X[0], doc2vec.TaggedDocument):\n            d2v_sentences = X\n        else:\n            d2v_sentences = [doc2vec.TaggedDocument(words, [i]) for i, words in enumerate(X)]\n        self.gensim_model = models.Doc2Vec(\n            documents=d2v_sentences, dm_mean=self.dm_mean, dm=self.dm,\n            dbow_words=self.dbow_words, dm_concat=self.dm_concat, dm_tag_count=self.dm_tag_count,\n            docvecs=self.docvecs, docvecs_mapfile=self.docvecs_mapfile, comment=self.comment,\n            trim_rule=self.trim_rule, size=self.size, alpha=self.alpha, window=self.window,\n            min_count=self.min_count, max_vocab_size=self.max_vocab_size, sample=self.sample,\n            seed=self.seed, workers=self.workers, min_alpha=self.min_alpha, hs=self.hs,\n            negative=self.negative, cbow_mean=self.cbow_mean, hashfxn=self.hashfxn,\n            iter=self.iter, sorted_vocab=self.sorted_vocab, batch_words=self.batch_words\n        )\n        return self\n\n    def transform(self, docs):\n        \"\"\"\n        Return the vector representations for the input documents.\n        The input `docs` should be a list of lists like\n        [['calculus', 'mathematical'],\n        ['geometry', 'operations', 'curves']]\n        or a single document like : ['calculus', 'mathematical']\n        \"\"\"\n        if self.gensim_model is None:\n            raise NotFittedError(\n                \"This model has not been fitted yet. Call 'fit' with appropriate arguments before using this method.\"\n            )\n\n        # The input as array of array\n        if isinstance(docs[0], string_types):\n            docs = [docs]\n        vectors = [self.gensim_model.infer_vector(doc) for doc in docs]\n        return np.reshape(np.array(vectors), (len(docs), self.gensim_model.vector_size))\n", "path": "gensim/sklearn_api/d2vmodel.py"}], "after_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>\n# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html\n\n\"\"\"\nScikit learn interface for gensim for easy use of gensim with scikit-learn\nFollows scikit-learn API conventions\n\"\"\"\n\nimport numpy as np\nfrom six import string_types\nfrom sklearn.base import TransformerMixin, BaseEstimator\nfrom sklearn.exceptions import NotFittedError\n\nfrom gensim import models\nfrom gensim.models import doc2vec\n\n\nclass D2VTransformer(TransformerMixin, BaseEstimator):\n    \"\"\"\n    Base Doc2Vec module\n    \"\"\"\n\n    def __init__(self, dm_mean=None, dm=1, dbow_words=0, dm_concat=0, dm_tag_count=1, docvecs=None,\n                 docvecs_mapfile=None, comment=None, trim_rule=None, size=100, alpha=0.025, window=5, min_count=5,\n                 max_vocab_size=None, sample=1e-3, seed=1, workers=3, min_alpha=0.0001, hs=0, negative=5, cbow_mean=1,\n                 hashfxn=hash, iter=5, sorted_vocab=1, batch_words=10000):\n        \"\"\"\n        Sklearn api for Doc2Vec model. See gensim.models.Doc2Vec and gensim.models.Word2Vec for parameter details.\n        \"\"\"\n        self.gensim_model = None\n        self.dm_mean = dm_mean\n        self.dm = dm\n        self.dbow_words = dbow_words\n        self.dm_concat = dm_concat\n        self.dm_tag_count = dm_tag_count\n        self.docvecs = docvecs\n        self.docvecs_mapfile = docvecs_mapfile\n        self.comment = comment\n        self.trim_rule = trim_rule\n\n        # attributes associated with gensim.models.Word2Vec\n        self.size = size\n        self.alpha = alpha\n        self.window = window\n        self.min_count = min_count\n        self.max_vocab_size = max_vocab_size\n        self.sample = sample\n        self.seed = seed\n        self.workers = workers\n        self.min_alpha = min_alpha\n        self.hs = hs\n        self.negative = negative\n        self.cbow_mean = int(cbow_mean)\n        self.hashfxn = hashfxn\n        self.iter = iter\n        self.sorted_vocab = sorted_vocab\n        self.batch_words = batch_words\n\n    def fit(self, X, y=None):\n        \"\"\"\n        Fit the model according to the given training data.\n        Calls gensim.models.Doc2Vec\n        \"\"\"\n        if isinstance(X[0], doc2vec.TaggedDocument):\n            d2v_sentences = X\n        else:\n            d2v_sentences = [doc2vec.TaggedDocument(words, [i]) for i, words in enumerate(X)]\n        self.gensim_model = models.Doc2Vec(\n            documents=d2v_sentences, dm_mean=self.dm_mean, dm=self.dm,\n            dbow_words=self.dbow_words, dm_concat=self.dm_concat, dm_tag_count=self.dm_tag_count,\n            docvecs=self.docvecs, docvecs_mapfile=self.docvecs_mapfile, comment=self.comment,\n            trim_rule=self.trim_rule, vector_size=self.size, alpha=self.alpha, window=self.window,\n            min_count=self.min_count, max_vocab_size=self.max_vocab_size, sample=self.sample,\n            seed=self.seed, workers=self.workers, min_alpha=self.min_alpha, hs=self.hs,\n            negative=self.negative, cbow_mean=self.cbow_mean, hashfxn=self.hashfxn,\n            epochs=self.iter, sorted_vocab=self.sorted_vocab, batch_words=self.batch_words\n        )\n        return self\n\n    def transform(self, docs):\n        \"\"\"\n        Return the vector representations for the input documents.\n        The input `docs` should be a list of lists like\n        [['calculus', 'mathematical'],\n        ['geometry', 'operations', 'curves']]\n        or a single document like : ['calculus', 'mathematical']\n        \"\"\"\n        if self.gensim_model is None:\n            raise NotFittedError(\n                \"This model has not been fitted yet. Call 'fit' with appropriate arguments before using this method.\"\n            )\n\n        # The input as array of array\n        if isinstance(docs[0], string_types):\n            docs = [docs]\n        vectors = [self.gensim_model.infer_vector(doc) for doc in docs]\n        return np.reshape(np.array(vectors), (len(docs), self.gensim_model.vector_size))\n", "path": "gensim/sklearn_api/d2vmodel.py"}]}