We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[BUG] [CV] typo in context prediction validation
**Describe the bug**
it says batch_to_images instead of infer_on_batch
![Screen Shot 2022-03-30 at 17 56 08](https://user-images.githubusercontent.com/26321553/160865194-9c29434c-3644-44d3-913c-15ef3aab2375.png)



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `deepchecks/vision/context.py`
Content:
```
1 # ----------------------------------------------------------------------------
2 # Copyright (C) 2021-2022 Deepchecks (https://www.deepchecks.com)
3 #
4 # This file is part of Deepchecks.
5 # Deepchecks is distributed under the terms of the GNU Affero General
6 # Public License (version 3 or later).
7 # You should have received a copy of the GNU Affero General Public License
8 # along with Deepchecks.  If not, see <http://www.gnu.org/licenses/>.
9 # ----------------------------------------------------------------------------
10 #
11 """Module for base vision context."""
12 import logging
13 from typing import Mapping, Union
14 
15 import torch
16 from torch import nn
17 from ignite.metrics import Metric
18 
19 from deepchecks.core import DatasetKind
20 from deepchecks.vision.vision_data import VisionData, TaskType
21 from deepchecks.core.errors import (
22     DatasetValidationError, DeepchecksNotImplementedError, ModelValidationError,
23     DeepchecksNotSupportedError, DeepchecksValueError, ValidationError
24 )
25 
26 
27 __all__ = ['Context']
28 
29 
30 logger = logging.getLogger('deepchecks')
31 
32 
33 class Context:
34     """Contains all the data + properties the user has passed to a check/suite, and validates it seamlessly.
35 
36     Parameters
37     ----------
38     train : VisionData , default: None
39         Dataset or DataFrame object, representing data an estimator was fitted on
40     test : VisionData , default: None
41         Dataset or DataFrame object, representing data an estimator predicts on
42     model : BasicModel , default: None
43         A scikit-learn-compatible fitted estimator instance
44     model_name: str , default: ''
45         The name of the model
46     scorers : Mapping[str, Metric] , default: None
47         dict of scorers names to a Metric
48     scorers_per_class : Mapping[str, Metric] , default: None
49         dict of scorers for classification without averaging of the classes.
50         See <a href=
51         "https://scikit-learn.org/stable/modules/model_evaluation.html#from-binary-to-multiclass-and-multilabel">
52         scikit-learn docs</a>
53     device : Union[str, torch.device], default: 'cpu'
54         processing unit for use
55     random_state : int
56         A seed to set for pseudo-random functions
57     n_samples : int, default: None
58     """
59 
60     def __init__(self,
61                  train: VisionData = None,
62                  test: VisionData = None,
63                  model: nn.Module = None,
64                  model_name: str = '',
65                  scorers: Mapping[str, Metric] = None,
66                  scorers_per_class: Mapping[str, Metric] = None,
67                  device: Union[str, torch.device, None] = 'cpu',
68                  random_state: int = 42,
69                  n_samples: int = None
70                  ):
71         # Validations
72         if train is None and test is None and model is None:
73             raise DeepchecksValueError('At least one dataset (or model) must be passed to the method!')
74         if test and not train:
75             raise DatasetValidationError('Can\'t initialize context with only test. if you have single dataset, '
76                                          'initialize it as train')
77         if train and test:
78             train.validate_shared_label(test)
79 
80         self._device = torch.device(device) if isinstance(device, str) else (device if device else torch.device('cpu'))
81         self._prediction_formatter_error = {}
82 
83         if model is not None:
84             if not isinstance(model, nn.Module):
85                 logger.warning('Model is not a torch.nn.Module. Deepchecks can\'t validate that model is in '
86                                'evaluation state.')
87             elif model.training:
88                 raise DatasetValidationError('Model is not in evaluation state. Please set model training '
89                                              'parameter to False or run model.eval() before passing it.')
90 
91             for dataset, dataset_type in zip([train, test], [DatasetKind.TRAIN, DatasetKind.TEST]):
92                 if dataset is not None:
93                     try:
94                         dataset.validate_prediction(next(iter(dataset.data_loader)), model, self._device)
95                         msg = None
96                     except DeepchecksNotImplementedError:
97                         msg = f'infer_on_batch() was not implemented in {dataset_type} ' \
98                            f'dataset, some checks will not run'
99                     except ValidationError as ex:
100                         msg = f'batch_to_images() was not implemented correctly in {dataset_type}, the ' \
101                            f'validation has failed with the error: {ex}. To test your prediction formatting use the ' \
102                            f'function `vision_data.validate_prediction(batch, model, device)`'
103 
104                     if msg:
105                         self._prediction_formatter_error[dataset_type] = msg
106                         logger.warning(msg)
107 
108         # The copy does 2 things: Sample n_samples if parameter exists, and shuffle the data.
109         # we shuffle because the data in VisionData is set to be sampled in a fixed order (in the init), so if the user
110         # wants to run without random_state we need to forcefully shuffle (to have different results on different runs
111         # from the same VisionData object), and if there is a random_state the shuffle will always have same result
112         if train:
113             train = train.copy(shuffle=True, n_samples=n_samples, random_state=random_state)
114         if test:
115             test = test.copy(shuffle=True, n_samples=n_samples, random_state=random_state)
116 
117         self._train = train
118         self._test = test
119         self._model = model
120         self._user_scorers = scorers
121         self._user_scorers_per_class = scorers_per_class
122         self._model_name = model_name
123         self.random_state = random_state
124 
125     # Properties
126     # Validations note: We know train & test fit each other so all validations can be run only on train
127 
128     @property
129     def train(self) -> VisionData:
130         """Return train if exists, otherwise raise error."""
131         if self._train is None:
132             raise DeepchecksNotSupportedError('Check is irrelevant for Datasets without train dataset')
133         return self._train
134 
135     @property
136     def test(self) -> VisionData:
137         """Return test if exists, otherwise raise error."""
138         if self._test is None:
139             raise DeepchecksNotSupportedError('Check is irrelevant for Datasets without test dataset')
140         return self._test
141 
142     @property
143     def model(self) -> nn.Module:
144         """Return & validate model if model exists, otherwise raise error."""
145         if self._model is None:
146             raise DeepchecksNotSupportedError('Check is irrelevant for Datasets without model')
147         return self._model
148 
149     @property
150     def model_name(self):
151         """Return model name."""
152         return self._model_name
153 
154     @property
155     def device(self) -> torch.device:
156         """Return device specified by the user."""
157         return self._device
158 
159     def have_test(self):
160         """Return whether there is test dataset defined."""
161         return self._test is not None
162 
163     def assert_task_type(self, *expected_types: TaskType):
164         """Assert task_type matching given types."""
165         if self.train.task_type not in expected_types:
166             raise ModelValidationError(
167                 f'Check is irrelevant for task of type {self.train.task_type}')
168         return True
169 
170     def assert_predictions_valid(self, kind: DatasetKind = None):
171         """Assert that for given DatasetKind the model & dataset infer_on_batch return predictions in right format."""
172         error = self._prediction_formatter_error.get(kind)
173         if error:
174             raise DeepchecksValueError(error)
175 
176     def get_data_by_kind(self, kind: DatasetKind):
177         """Return the relevant VisionData by given kind."""
178         if kind == DatasetKind.TRAIN:
179             return self.train
180         elif kind == DatasetKind.TEST:
181             return self.test
182         else:
183             raise DeepchecksValueError(f'Unexpected dataset kind {kind}')
184
```
--- 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/deepchecks/vision/context.py b/deepchecks/vision/context.py
--- a/deepchecks/vision/context.py
+++ b/deepchecks/vision/context.py
@@ -97,7 +97,7 @@
                         msg = f'infer_on_batch() was not implemented in {dataset_type} ' \
                            f'dataset, some checks will not run'
                     except ValidationError as ex:
-                        msg = f'batch_to_images() was not implemented correctly in {dataset_type}, the ' \
+                        msg = f'infer_on_batch() was not implemented correctly in {dataset_type}, the ' \
                            f'validation has failed with the error: {ex}. To test your prediction formatting use the ' \
                            f'function `vision_data.validate_prediction(batch, model, device)`'

{"golden_diff": "diff --git a/deepchecks/vision/context.py b/deepchecks/vision/context.py\n--- a/deepchecks/vision/context.py\n+++ b/deepchecks/vision/context.py\n@@ -97,7 +97,7 @@\n                         msg = f'infer_on_batch() was not implemented in {dataset_type} ' \\\n                            f'dataset, some checks will not run'\n                     except ValidationError as ex:\n-                        msg = f'batch_to_images() was not implemented correctly in {dataset_type}, the ' \\\n+                        msg = f'infer_on_batch() was not implemented correctly in {dataset_type}, the ' \\\n                            f'validation has failed with the error: {ex}. To test your prediction formatting use the ' \\\n                            f'function `vision_data.validate_prediction(batch, model, device)`'\n", "issue": "[BUG] [CV] typo in context prediction validation\n**Describe the bug**\r\nit says batch_to_images instead of infer_on_batch\r\n![Screen Shot 2022-03-30 at 17 56 08](https://user-images.githubusercontent.com/26321553/160865194-9c29434c-3644-44d3-913c-15ef3aab2375.png)\r\n\r\n\n", "before_files": [{"content": "# ----------------------------------------------------------------------------\n# Copyright (C) 2021-2022 Deepchecks (https://www.deepchecks.com)\n#\n# This file is part of Deepchecks.\n# Deepchecks is distributed under the terms of the GNU Affero General\n# Public License (version 3 or later).\n# You should have received a copy of the GNU Affero General Public License\n# along with Deepchecks.  If not, see <http://www.gnu.org/licenses/>.\n# ----------------------------------------------------------------------------\n#\n\"\"\"Module for base vision context.\"\"\"\nimport logging\nfrom typing import Mapping, Union\n\nimport torch\nfrom torch import nn\nfrom ignite.metrics import Metric\n\nfrom deepchecks.core import DatasetKind\nfrom deepchecks.vision.vision_data import VisionData, TaskType\nfrom deepchecks.core.errors import (\n    DatasetValidationError, DeepchecksNotImplementedError, ModelValidationError,\n    DeepchecksNotSupportedError, DeepchecksValueError, ValidationError\n)\n\n\n__all__ = ['Context']\n\n\nlogger = logging.getLogger('deepchecks')\n\n\nclass Context:\n    \"\"\"Contains all the data + properties the user has passed to a check/suite, and validates it seamlessly.\n\n    Parameters\n    ----------\n    train : VisionData , default: None\n        Dataset or DataFrame object, representing data an estimator was fitted on\n    test : VisionData , default: None\n        Dataset or DataFrame object, representing data an estimator predicts on\n    model : BasicModel , default: None\n        A scikit-learn-compatible fitted estimator instance\n    model_name: str , default: ''\n        The name of the model\n    scorers : Mapping[str, Metric] , default: None\n        dict of scorers names to a Metric\n    scorers_per_class : Mapping[str, Metric] , default: None\n        dict of scorers for classification without averaging of the classes.\n        See <a href=\n        \"https://scikit-learn.org/stable/modules/model_evaluation.html#from-binary-to-multiclass-and-multilabel\">\n        scikit-learn docs</a>\n    device : Union[str, torch.device], default: 'cpu'\n        processing unit for use\n    random_state : int\n        A seed to set for pseudo-random functions\n    n_samples : int, default: None\n    \"\"\"\n\n    def __init__(self,\n                 train: VisionData = None,\n                 test: VisionData = None,\n                 model: nn.Module = None,\n                 model_name: str = '',\n                 scorers: Mapping[str, Metric] = None,\n                 scorers_per_class: Mapping[str, Metric] = None,\n                 device: Union[str, torch.device, None] = 'cpu',\n                 random_state: int = 42,\n                 n_samples: int = None\n                 ):\n        # Validations\n        if train is None and test is None and model is None:\n            raise DeepchecksValueError('At least one dataset (or model) must be passed to the method!')\n        if test and not train:\n            raise DatasetValidationError('Can\\'t initialize context with only test. if you have single dataset, '\n                                         'initialize it as train')\n        if train and test:\n            train.validate_shared_label(test)\n\n        self._device = torch.device(device) if isinstance(device, str) else (device if device else torch.device('cpu'))\n        self._prediction_formatter_error = {}\n\n        if model is not None:\n            if not isinstance(model, nn.Module):\n                logger.warning('Model is not a torch.nn.Module. Deepchecks can\\'t validate that model is in '\n                               'evaluation state.')\n            elif model.training:\n                raise DatasetValidationError('Model is not in evaluation state. Please set model training '\n                                             'parameter to False or run model.eval() before passing it.')\n\n            for dataset, dataset_type in zip([train, test], [DatasetKind.TRAIN, DatasetKind.TEST]):\n                if dataset is not None:\n                    try:\n                        dataset.validate_prediction(next(iter(dataset.data_loader)), model, self._device)\n                        msg = None\n                    except DeepchecksNotImplementedError:\n                        msg = f'infer_on_batch() was not implemented in {dataset_type} ' \\\n                           f'dataset, some checks will not run'\n                    except ValidationError as ex:\n                        msg = f'batch_to_images() was not implemented correctly in {dataset_type}, the ' \\\n                           f'validation has failed with the error: {ex}. To test your prediction formatting use the ' \\\n                           f'function `vision_data.validate_prediction(batch, model, device)`'\n\n                    if msg:\n                        self._prediction_formatter_error[dataset_type] = msg\n                        logger.warning(msg)\n\n        # The copy does 2 things: Sample n_samples if parameter exists, and shuffle the data.\n        # we shuffle because the data in VisionData is set to be sampled in a fixed order (in the init), so if the user\n        # wants to run without random_state we need to forcefully shuffle (to have different results on different runs\n        # from the same VisionData object), and if there is a random_state the shuffle will always have same result\n        if train:\n            train = train.copy(shuffle=True, n_samples=n_samples, random_state=random_state)\n        if test:\n            test = test.copy(shuffle=True, n_samples=n_samples, random_state=random_state)\n\n        self._train = train\n        self._test = test\n        self._model = model\n        self._user_scorers = scorers\n        self._user_scorers_per_class = scorers_per_class\n        self._model_name = model_name\n        self.random_state = random_state\n\n    # Properties\n    # Validations note: We know train & test fit each other so all validations can be run only on train\n\n    @property\n    def train(self) -> VisionData:\n        \"\"\"Return train if exists, otherwise raise error.\"\"\"\n        if self._train is None:\n            raise DeepchecksNotSupportedError('Check is irrelevant for Datasets without train dataset')\n        return self._train\n\n    @property\n    def test(self) -> VisionData:\n        \"\"\"Return test if exists, otherwise raise error.\"\"\"\n        if self._test is None:\n            raise DeepchecksNotSupportedError('Check is irrelevant for Datasets without test dataset')\n        return self._test\n\n    @property\n    def model(self) -> nn.Module:\n        \"\"\"Return & validate model if model exists, otherwise raise error.\"\"\"\n        if self._model is None:\n            raise DeepchecksNotSupportedError('Check is irrelevant for Datasets without model')\n        return self._model\n\n    @property\n    def model_name(self):\n        \"\"\"Return model name.\"\"\"\n        return self._model_name\n\n    @property\n    def device(self) -> torch.device:\n        \"\"\"Return device specified by the user.\"\"\"\n        return self._device\n\n    def have_test(self):\n        \"\"\"Return whether there is test dataset defined.\"\"\"\n        return self._test is not None\n\n    def assert_task_type(self, *expected_types: TaskType):\n        \"\"\"Assert task_type matching given types.\"\"\"\n        if self.train.task_type not in expected_types:\n            raise ModelValidationError(\n                f'Check is irrelevant for task of type {self.train.task_type}')\n        return True\n\n    def assert_predictions_valid(self, kind: DatasetKind = None):\n        \"\"\"Assert that for given DatasetKind the model & dataset infer_on_batch return predictions in right format.\"\"\"\n        error = self._prediction_formatter_error.get(kind)\n        if error:\n            raise DeepchecksValueError(error)\n\n    def get_data_by_kind(self, kind: DatasetKind):\n        \"\"\"Return the relevant VisionData by given kind.\"\"\"\n        if kind == DatasetKind.TRAIN:\n            return self.train\n        elif kind == DatasetKind.TEST:\n            return self.test\n        else:\n            raise DeepchecksValueError(f'Unexpected dataset kind {kind}')\n", "path": "deepchecks/vision/context.py"}], "after_files": [{"content": "# ----------------------------------------------------------------------------\n# Copyright (C) 2021-2022 Deepchecks (https://www.deepchecks.com)\n#\n# This file is part of Deepchecks.\n# Deepchecks is distributed under the terms of the GNU Affero General\n# Public License (version 3 or later).\n# You should have received a copy of the GNU Affero General Public License\n# along with Deepchecks.  If not, see <http://www.gnu.org/licenses/>.\n# ----------------------------------------------------------------------------\n#\n\"\"\"Module for base vision context.\"\"\"\nimport logging\nfrom typing import Mapping, Union\n\nimport torch\nfrom torch import nn\nfrom ignite.metrics import Metric\n\nfrom deepchecks.core import DatasetKind\nfrom deepchecks.vision.vision_data import VisionData, TaskType\nfrom deepchecks.core.errors import (\n    DatasetValidationError, DeepchecksNotImplementedError, ModelValidationError,\n    DeepchecksNotSupportedError, DeepchecksValueError, ValidationError\n)\n\n\n__all__ = ['Context']\n\n\nlogger = logging.getLogger('deepchecks')\n\n\nclass Context:\n    \"\"\"Contains all the data + properties the user has passed to a check/suite, and validates it seamlessly.\n\n    Parameters\n    ----------\n    train : VisionData , default: None\n        Dataset or DataFrame object, representing data an estimator was fitted on\n    test : VisionData , default: None\n        Dataset or DataFrame object, representing data an estimator predicts on\n    model : BasicModel , default: None\n        A scikit-learn-compatible fitted estimator instance\n    model_name: str , default: ''\n        The name of the model\n    scorers : Mapping[str, Metric] , default: None\n        dict of scorers names to a Metric\n    scorers_per_class : Mapping[str, Metric] , default: None\n        dict of scorers for classification without averaging of the classes.\n        See <a href=\n        \"https://scikit-learn.org/stable/modules/model_evaluation.html#from-binary-to-multiclass-and-multilabel\">\n        scikit-learn docs</a>\n    device : Union[str, torch.device], default: 'cpu'\n        processing unit for use\n    random_state : int\n        A seed to set for pseudo-random functions\n    n_samples : int, default: None\n    \"\"\"\n\n    def __init__(self,\n                 train: VisionData = None,\n                 test: VisionData = None,\n                 model: nn.Module = None,\n                 model_name: str = '',\n                 scorers: Mapping[str, Metric] = None,\n                 scorers_per_class: Mapping[str, Metric] = None,\n                 device: Union[str, torch.device, None] = 'cpu',\n                 random_state: int = 42,\n                 n_samples: int = None\n                 ):\n        # Validations\n        if train is None and test is None and model is None:\n            raise DeepchecksValueError('At least one dataset (or model) must be passed to the method!')\n        if test and not train:\n            raise DatasetValidationError('Can\\'t initialize context with only test. if you have single dataset, '\n                                         'initialize it as train')\n        if train and test:\n            train.validate_shared_label(test)\n\n        self._device = torch.device(device) if isinstance(device, str) else (device if device else torch.device('cpu'))\n        self._prediction_formatter_error = {}\n\n        if model is not None:\n            if not isinstance(model, nn.Module):\n                logger.warning('Model is not a torch.nn.Module. Deepchecks can\\'t validate that model is in '\n                               'evaluation state.')\n            elif model.training:\n                raise DatasetValidationError('Model is not in evaluation state. Please set model training '\n                                             'parameter to False or run model.eval() before passing it.')\n\n            for dataset, dataset_type in zip([train, test], [DatasetKind.TRAIN, DatasetKind.TEST]):\n                if dataset is not None:\n                    try:\n                        dataset.validate_prediction(next(iter(dataset.data_loader)), model, self._device)\n                        msg = None\n                    except DeepchecksNotImplementedError:\n                        msg = f'infer_on_batch() was not implemented in {dataset_type} ' \\\n                           f'dataset, some checks will not run'\n                    except ValidationError as ex:\n                        msg = f'infer_on_batch() was not implemented correctly in {dataset_type}, the ' \\\n                           f'validation has failed with the error: {ex}. To test your prediction formatting use the ' \\\n                           f'function `vision_data.validate_prediction(batch, model, device)`'\n\n                    if msg:\n                        self._prediction_formatter_error[dataset_type] = msg\n                        logger.warning(msg)\n\n        # The copy does 2 things: Sample n_samples if parameter exists, and shuffle the data.\n        # we shuffle because the data in VisionData is set to be sampled in a fixed order (in the init), so if the user\n        # wants to run without random_state we need to forcefully shuffle (to have different results on different runs\n        # from the same VisionData object), and if there is a random_state the shuffle will always have same result\n        if train:\n            train = train.copy(shuffle=True, n_samples=n_samples, random_state=random_state)\n        if test:\n            test = test.copy(shuffle=True, n_samples=n_samples, random_state=random_state)\n\n        self._train = train\n        self._test = test\n        self._model = model\n        self._user_scorers = scorers\n        self._user_scorers_per_class = scorers_per_class\n        self._model_name = model_name\n        self.random_state = random_state\n\n    # Properties\n    # Validations note: We know train & test fit each other so all validations can be run only on train\n\n    @property\n    def train(self) -> VisionData:\n        \"\"\"Return train if exists, otherwise raise error.\"\"\"\n        if self._train is None:\n            raise DeepchecksNotSupportedError('Check is irrelevant for Datasets without train dataset')\n        return self._train\n\n    @property\n    def test(self) -> VisionData:\n        \"\"\"Return test if exists, otherwise raise error.\"\"\"\n        if self._test is None:\n            raise DeepchecksNotSupportedError('Check is irrelevant for Datasets without test dataset')\n        return self._test\n\n    @property\n    def model(self) -> nn.Module:\n        \"\"\"Return & validate model if model exists, otherwise raise error.\"\"\"\n        if self._model is None:\n            raise DeepchecksNotSupportedError('Check is irrelevant for Datasets without model')\n        return self._model\n\n    @property\n    def model_name(self):\n        \"\"\"Return model name.\"\"\"\n        return self._model_name\n\n    @property\n    def device(self) -> torch.device:\n        \"\"\"Return device specified by the user.\"\"\"\n        return self._device\n\n    def have_test(self):\n        \"\"\"Return whether there is test dataset defined.\"\"\"\n        return self._test is not None\n\n    def assert_task_type(self, *expected_types: TaskType):\n        \"\"\"Assert task_type matching given types.\"\"\"\n        if self.train.task_type not in expected_types:\n            raise ModelValidationError(\n                f'Check is irrelevant for task of type {self.train.task_type}')\n        return True\n\n    def assert_predictions_valid(self, kind: DatasetKind = None):\n        \"\"\"Assert that for given DatasetKind the model & dataset infer_on_batch return predictions in right format.\"\"\"\n        error = self._prediction_formatter_error.get(kind)\n        if error:\n            raise DeepchecksValueError(error)\n\n    def get_data_by_kind(self, kind: DatasetKind):\n        \"\"\"Return the relevant VisionData by given kind.\"\"\"\n        if kind == DatasetKind.TRAIN:\n            return self.train\n        elif kind == DatasetKind.TEST:\n            return self.test\n        else:\n            raise DeepchecksValueError(f'Unexpected dataset kind {kind}')\n", "path": "deepchecks/vision/context.py"}]}