prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [TYPO] Label ambiguity explanation
  Current explanation: "Each row in the table shows an example of a data sample and the it's observed labels as a found in the dataset."
  
  --- 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/checks/integrity/label_ambiguity.py`
  Content:
  ```
  1 # ----------------------------------------------------------------------------
  2 # Copyright (C) 2021 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 contains Data Duplicates check."""
  12 from typing import Union, List
  13 
  14 import pandas as pd
  15 
  16 from deepchecks import Dataset, ConditionResult
  17 from deepchecks.base.check import CheckResult, SingleDatasetBaseCheck
  18 from deepchecks.errors import DeepchecksValueError
  19 from deepchecks.utils.metrics import task_type_validation, ModelType
  20 from deepchecks.utils.strings import format_percent
  21 from deepchecks.utils.typing import Hashable
  22 
  23 
  24 __all__ = ['LabelAmbiguity']
  25 
  26 
  27 class LabelAmbiguity(SingleDatasetBaseCheck):
  28     """Find samples with multiple labels.
  29 
  30     Args:
  31         columns (Hashable, List[Hashable]):
  32             List of columns to check, if none given checks
  33             all columns Except ignored ones.
  34         ignore_columns (Hashable, List[Hashable]):
  35             List of columns to ignore, if none given checks
  36             based on columns variable.
  37         n_to_show (int):
  38             number of most common ambiguous samples to show.
  39     """
  40 
  41     def __init__(
  42         self,
  43         columns: Union[Hashable, List[Hashable], None] = None,
  44         ignore_columns: Union[Hashable, List[Hashable], None] = None,
  45         n_to_show: int = 5
  46     ):
  47         super().__init__()
  48         self.columns = columns
  49         self.ignore_columns = ignore_columns
  50         self.n_to_show = n_to_show
  51 
  52     def run(self, dataset: Dataset, model=None) -> CheckResult:
  53         """Run check.
  54 
  55         Args:
  56             dataset(Dataset): any dataset.
  57             model (any): used to check task type (default: None)
  58 
  59         Returns:
  60             (CheckResult): percentage of ambiguous samples and display of the top n_to_show most ambiguous.
  61         """
  62         dataset: Dataset = Dataset.validate_dataset(dataset)
  63         dataset = dataset.select(self.columns, self.ignore_columns)
  64 
  65         if model:
  66             task_type_validation(model, dataset, [ModelType.MULTICLASS, ModelType.BINARY])
  67         elif dataset.label_type == 'regression_label':
  68             raise DeepchecksValueError('Task type cannot be regression')
  69 
  70         label_col = dataset.label_name
  71 
  72         # HACK: pandas have bug with groupby on category dtypes, so until it fixed, change dtypes manually
  73         df = dataset.data
  74         category_columns = df.dtypes[df.dtypes == 'category'].index.tolist()
  75         if category_columns:
  76             df = df.astype({c: 'object' for c in category_columns})
  77 
  78         group_unique_data = df.groupby(dataset.features, dropna=False)
  79         group_unique_labels = group_unique_data.nunique()[label_col]
  80 
  81         num_ambiguous = 0
  82         ambiguous_label_name = 'Observed Labels'
  83         display = pd.DataFrame(columns=[ambiguous_label_name, *dataset.features])
  84 
  85         for num_labels, group_data in sorted(zip(group_unique_labels, group_unique_data),
  86                                              key=lambda x: x[0], reverse=True):
  87             if num_labels == 1:
  88                 break
  89 
  90             group_df = group_data[1]
  91             sample_values = dict(group_df[dataset.features].iloc[0])
  92             labels = tuple(group_df[label_col].unique())
  93             n_data_sample = group_df.shape[0]
  94             num_ambiguous += n_data_sample
  95 
  96             display = display.append({ambiguous_label_name: labels, **sample_values}, ignore_index=True)
  97 
  98         display = display.set_index(ambiguous_label_name)
  99 
  100         explanation = ('Each row in the table shows an example of a data sample '
  101                        'and the it\'s observed labels as a found in the dataset.')
  102 
  103         display = None if display.empty else [explanation, display.head(self.n_to_show)]
  104 
  105         percent_ambiguous = num_ambiguous/dataset.n_samples
  106 
  107         return CheckResult(value=percent_ambiguous, display=display)
  108 
  109     def add_condition_ambiguous_sample_ratio_not_greater_than(self, max_ratio=0):
  110         """Add condition - require samples with multiple labels to not be more than max_ratio.
  111 
  112         Args:
  113             max_ratio (float): Maximum ratio of samples with multiple labels.
  114         """
  115         def max_ratio_condition(result: float) -> ConditionResult:
  116             if result > max_ratio:
  117                 return ConditionResult(False, f'Found ratio of samples with multiple labels above threshold: '
  118                                               f'{format_percent(result)}')
  119             else:
  120                 return ConditionResult(True)
  121 
  122         return self.add_condition(f'Ambiguous sample ratio is not greater than {format_percent(max_ratio)}',
  123                                   max_ratio_condition)
  124
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/deepchecks/checks/integrity/label_ambiguity.py b/deepchecks/checks/integrity/label_ambiguity.py
  --- a/deepchecks/checks/integrity/label_ambiguity.py
  +++ b/deepchecks/checks/integrity/label_ambiguity.py
  @@ -98,7 +98,7 @@
           display = display.set_index(ambiguous_label_name)
   
           explanation = ('Each row in the table shows an example of a data sample '
  -                       'and the it\'s observed labels as a found in the dataset.')
  +                       'and the its observed labels as found in the dataset.')
   
           display = None if display.empty else [explanation, display.head(self.n_to_show)]
  
verification_info: {"golden_diff": "diff --git a/deepchecks/checks/integrity/label_ambiguity.py b/deepchecks/checks/integrity/label_ambiguity.py\n--- a/deepchecks/checks/integrity/label_ambiguity.py\n+++ b/deepchecks/checks/integrity/label_ambiguity.py\n@@ -98,7 +98,7 @@\n         display = display.set_index(ambiguous_label_name)\n \n         explanation = ('Each row in the table shows an example of a data sample '\n-                       'and the it\\'s observed labels as a found in the dataset.')\n+                       'and the its observed labels as found in the dataset.')\n \n         display = None if display.empty else [explanation, display.head(self.n_to_show)]\n", "issue": "[TYPO] Label ambiguity explanation\nCurrent explanation: \"Each row in the table shows an example of a data sample and the it's observed labels as a found in the dataset.\"\n", "before_files": [{"content": "# ----------------------------------------------------------------------------\n# Copyright (C) 2021 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 contains Data Duplicates check.\"\"\"\nfrom typing import Union, List\n\nimport pandas as pd\n\nfrom deepchecks import Dataset, ConditionResult\nfrom deepchecks.base.check import CheckResult, SingleDatasetBaseCheck\nfrom deepchecks.errors import DeepchecksValueError\nfrom deepchecks.utils.metrics import task_type_validation, ModelType\nfrom deepchecks.utils.strings import format_percent\nfrom deepchecks.utils.typing import Hashable\n\n\n__all__ = ['LabelAmbiguity']\n\n\nclass LabelAmbiguity(SingleDatasetBaseCheck):\n    \"\"\"Find samples with multiple labels.\n\n    Args:\n        columns (Hashable, List[Hashable]):\n            List of columns to check, if none given checks\n            all columns Except ignored ones.\n        ignore_columns (Hashable, List[Hashable]):\n            List of columns to ignore, if none given checks\n            based on columns variable.\n        n_to_show (int):\n            number of most common ambiguous samples to show.\n    \"\"\"\n\n    def __init__(\n        self,\n        columns: Union[Hashable, List[Hashable], None] = None,\n        ignore_columns: Union[Hashable, List[Hashable], None] = None,\n        n_to_show: int = 5\n    ):\n        super().__init__()\n        self.columns = columns\n        self.ignore_columns = ignore_columns\n        self.n_to_show = n_to_show\n\n    def run(self, dataset: Dataset, model=None) -> CheckResult:\n        \"\"\"Run check.\n\n        Args:\n            dataset(Dataset): any dataset.\n            model (any): used to check task type (default: None)\n\n        Returns:\n            (CheckResult): percentage of ambiguous samples and display of the top n_to_show most ambiguous.\n        \"\"\"\n        dataset: Dataset = Dataset.validate_dataset(dataset)\n        dataset = dataset.select(self.columns, self.ignore_columns)\n\n        if model:\n            task_type_validation(model, dataset, [ModelType.MULTICLASS, ModelType.BINARY])\n        elif dataset.label_type == 'regression_label':\n            raise DeepchecksValueError('Task type cannot be regression')\n\n        label_col = dataset.label_name\n\n        # HACK: pandas have bug with groupby on category dtypes, so until it fixed, change dtypes manually\n        df = dataset.data\n        category_columns = df.dtypes[df.dtypes == 'category'].index.tolist()\n        if category_columns:\n            df = df.astype({c: 'object' for c in category_columns})\n\n        group_unique_data = df.groupby(dataset.features, dropna=False)\n        group_unique_labels = group_unique_data.nunique()[label_col]\n\n        num_ambiguous = 0\n        ambiguous_label_name = 'Observed Labels'\n        display = pd.DataFrame(columns=[ambiguous_label_name, *dataset.features])\n\n        for num_labels, group_data in sorted(zip(group_unique_labels, group_unique_data),\n                                             key=lambda x: x[0], reverse=True):\n            if num_labels == 1:\n                break\n\n            group_df = group_data[1]\n            sample_values = dict(group_df[dataset.features].iloc[0])\n            labels = tuple(group_df[label_col].unique())\n            n_data_sample = group_df.shape[0]\n            num_ambiguous += n_data_sample\n\n            display = display.append({ambiguous_label_name: labels, **sample_values}, ignore_index=True)\n\n        display = display.set_index(ambiguous_label_name)\n\n        explanation = ('Each row in the table shows an example of a data sample '\n                       'and the it\\'s observed labels as a found in the dataset.')\n\n        display = None if display.empty else [explanation, display.head(self.n_to_show)]\n\n        percent_ambiguous = num_ambiguous/dataset.n_samples\n\n        return CheckResult(value=percent_ambiguous, display=display)\n\n    def add_condition_ambiguous_sample_ratio_not_greater_than(self, max_ratio=0):\n        \"\"\"Add condition - require samples with multiple labels to not be more than max_ratio.\n\n        Args:\n            max_ratio (float): Maximum ratio of samples with multiple labels.\n        \"\"\"\n        def max_ratio_condition(result: float) -> ConditionResult:\n            if result > max_ratio:\n                return ConditionResult(False, f'Found ratio of samples with multiple labels above threshold: '\n                                              f'{format_percent(result)}')\n            else:\n                return ConditionResult(True)\n\n        return self.add_condition(f'Ambiguous sample ratio is not greater than {format_percent(max_ratio)}',\n                                  max_ratio_condition)\n", "path": "deepchecks/checks/integrity/label_ambiguity.py"}], "after_files": [{"content": "# ----------------------------------------------------------------------------\n# Copyright (C) 2021 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 contains Data Duplicates check.\"\"\"\nfrom typing import Union, List\n\nimport pandas as pd\n\nfrom deepchecks import Dataset, ConditionResult\nfrom deepchecks.base.check import CheckResult, SingleDatasetBaseCheck\nfrom deepchecks.errors import DeepchecksValueError\nfrom deepchecks.utils.metrics import task_type_validation, ModelType\nfrom deepchecks.utils.strings import format_percent\nfrom deepchecks.utils.typing import Hashable\n\n\n__all__ = ['LabelAmbiguity']\n\n\nclass LabelAmbiguity(SingleDatasetBaseCheck):\n    \"\"\"Find samples with multiple labels.\n\n    Args:\n        columns (Hashable, List[Hashable]):\n            List of columns to check, if none given checks\n            all columns Except ignored ones.\n        ignore_columns (Hashable, List[Hashable]):\n            List of columns to ignore, if none given checks\n            based on columns variable.\n        n_to_show (int):\n            number of most common ambiguous samples to show.\n    \"\"\"\n\n    def __init__(\n        self,\n        columns: Union[Hashable, List[Hashable], None] = None,\n        ignore_columns: Union[Hashable, List[Hashable], None] = None,\n        n_to_show: int = 5\n    ):\n        super().__init__()\n        self.columns = columns\n        self.ignore_columns = ignore_columns\n        self.n_to_show = n_to_show\n\n    def run(self, dataset: Dataset, model=None) -> CheckResult:\n        \"\"\"Run check.\n\n        Args:\n            dataset(Dataset): any dataset.\n            model (any): used to check task type (default: None)\n\n        Returns:\n            (CheckResult): percentage of ambiguous samples and display of the top n_to_show most ambiguous.\n        \"\"\"\n        dataset: Dataset = Dataset.validate_dataset(dataset)\n        dataset = dataset.select(self.columns, self.ignore_columns)\n\n        if model:\n            task_type_validation(model, dataset, [ModelType.MULTICLASS, ModelType.BINARY])\n        elif dataset.label_type == 'regression_label':\n            raise DeepchecksValueError('Task type cannot be regression')\n\n        label_col = dataset.label_name\n\n        # HACK: pandas have bug with groupby on category dtypes, so until it fixed, change dtypes manually\n        df = dataset.data\n        category_columns = df.dtypes[df.dtypes == 'category'].index.tolist()\n        if category_columns:\n            df = df.astype({c: 'object' for c in category_columns})\n\n        group_unique_data = df.groupby(dataset.features, dropna=False)\n        group_unique_labels = group_unique_data.nunique()[label_col]\n\n        num_ambiguous = 0\n        ambiguous_label_name = 'Observed Labels'\n        display = pd.DataFrame(columns=[ambiguous_label_name, *dataset.features])\n\n        for num_labels, group_data in sorted(zip(group_unique_labels, group_unique_data),\n                                             key=lambda x: x[0], reverse=True):\n            if num_labels == 1:\n                break\n\n            group_df = group_data[1]\n            sample_values = dict(group_df[dataset.features].iloc[0])\n            labels = tuple(group_df[label_col].unique())\n            n_data_sample = group_df.shape[0]\n            num_ambiguous += n_data_sample\n\n            display = display.append({ambiguous_label_name: labels, **sample_values}, ignore_index=True)\n\n        display = display.set_index(ambiguous_label_name)\n\n        explanation = ('Each row in the table shows an example of a data sample '\n                       'and the its observed labels as found in the dataset.')\n\n        display = None if display.empty else [explanation, display.head(self.n_to_show)]\n\n        percent_ambiguous = num_ambiguous/dataset.n_samples\n\n        return CheckResult(value=percent_ambiguous, display=display)\n\n    def add_condition_ambiguous_sample_ratio_not_greater_than(self, max_ratio=0):\n        \"\"\"Add condition - require samples with multiple labels to not be more than max_ratio.\n\n        Args:\n            max_ratio (float): Maximum ratio of samples with multiple labels.\n        \"\"\"\n        def max_ratio_condition(result: float) -> ConditionResult:\n            if result > max_ratio:\n                return ConditionResult(False, f'Found ratio of samples with multiple labels above threshold: '\n                                              f'{format_percent(result)}')\n            else:\n                return ConditionResult(True)\n\n        return self.add_condition(f'Ambiguous sample ratio is not greater than {format_percent(max_ratio)}',\n                                  max_ratio_condition)\n", "path": "deepchecks/checks/integrity/label_ambiguity.py"}]}