We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[FEAT] MixedDataTypes to display a few examples of each type
Current display:
![image](https://user-images.githubusercontent.com/33841818/168741336-7c6bdb6c-cb67-4970-a39b-7fcc80dead12.png)

Desired - to see a few unique examples from each type. currently have to inspect column in order to do it, e.g.:
![image](https://user-images.githubusercontent.com/33841818/168741428-87dbe8fb-296f-43a7-b6b1-891d95222049.png)
would want the check to display it by itself


--- 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/tabular/checks/data_integrity/mixed_data_types.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 contains Mixed Types check."""
12 from typing import List, Tuple, Union
13 
14 import numpy as np
15 import pandas as pd
16 
17 from deepchecks.core import CheckResult, ConditionCategory, ConditionResult
18 from deepchecks.tabular import Context, SingleDatasetCheck
19 from deepchecks.utils.dataframes import select_from_dataframe
20 from deepchecks.utils.features import N_TOP_MESSAGE, column_importance_sorter_df
21 from deepchecks.utils.strings import format_percent, is_string_column
22 from deepchecks.utils.typing import Hashable
23 
24 __all__ = ['MixedDataTypes']
25 
26 
27 class MixedDataTypes(SingleDatasetCheck):
28     """Detect columns which contain a mix of numerical and string values.
29 
30     Parameters
31     ----------
32     columns : Union[Hashable, List[Hashable]] , default: None
33         Columns to check, if none are given checks all columns
34         except ignored ones.
35     ignore_columns : Union[Hashable, List[Hashable]] , default: None
36         Columns to ignore, if none given checks based on columns
37         variable.
38     n_top_columns : int , optional
39         amount of columns to show ordered by feature importance (date, index, label are first)
40     """
41 
42     def __init__(
43         self,
44         columns: Union[Hashable, List[Hashable], None] = None,
45         ignore_columns: Union[Hashable, List[Hashable], None] = None,
46         n_top_columns: int = 10,
47         **kwargs
48     ):
49         super().__init__(**kwargs)
50         self.columns = columns
51         self.ignore_columns = ignore_columns
52         self.n_top_columns = n_top_columns
53 
54     def run_logic(self, context: Context, dataset_type: str = 'train') -> CheckResult:
55         """Run check.
56 
57         Returns
58         -------
59         CheckResult
60             value is a dict where the key is the column name as key and the value is the ratio 'strings' and 'numbers'
61             for any column with mixed data types.
62             numbers will also include hidden numbers in string representation.
63         """
64         if dataset_type == 'train':
65             dataset = context.train
66         else:
67             dataset = context.test
68         features_importance = context.features_importance
69 
70         df = select_from_dataframe(dataset.data, self.columns, self.ignore_columns)
71 
72         # Result value: { Column Name: {string: pct, numbers: pct}}
73         display_dict = {}
74         result_dict = {}
75 
76         for column_name in df.columns:
77             column_data = df[column_name].dropna()
78             mix = self._get_data_mix(column_data)
79             result_dict[column_name] = mix
80             if mix:
81                 # Format percents for display
82                 display_dict[column_name] = {k: format_percent(v) for k, v in mix.items()}
83 
84         if display_dict:
85             df_graph = pd.DataFrame.from_dict(display_dict)
86             df_graph = column_importance_sorter_df(df_graph.T, dataset, features_importance,
87                                                    self.n_top_columns).T
88             display = [N_TOP_MESSAGE % self.n_top_columns, df_graph]
89         else:
90             display = None
91 
92         return CheckResult(result_dict, display=display)
93 
94     @classmethod
95     def _get_data_mix(cls, column_data: pd.Series) -> dict:
96         if is_string_column(column_data):
97             return cls._check_mixed_percentage(column_data)
98         return {}
99 
100     @classmethod
101     def _check_mixed_percentage(cls, column_data: pd.Series) -> dict:
102         total_rows = column_data.count()
103 
104         def is_float(x) -> bool:
105             try:
106                 float(x)
107                 return True
108             except ValueError:
109                 return False
110 
111         nums = sum(column_data.apply(is_float))
112         if nums in (total_rows, 0):
113             return {}
114 
115         # Then we've got a mix
116         nums_pct = nums / total_rows
117         strs_pct = (np.abs(nums - total_rows)) / total_rows
118 
119         return {'strings': strs_pct, 'numbers': nums_pct}
120 
121     def add_condition_rare_type_ratio_not_in_range(self, ratio_range: Tuple[float, float] = (0.01, 0.1)):
122         """Add condition - Whether the ratio of rarer data type (strings or numbers) is not in the "danger zone".
123 
124         The "danger zone" represents the following logic - if the rarer data type is, for example, 30% of the data,
125         than the column is presumably supposed to contain both numbers and string values. If the rarer data type is,
126         for example, less than 1% of the data, than it's presumably a contamination, but a negligible one. In the range
127         between, there is a real chance that the rarer data type may represent a problem to model training and
128         inference.
129 
130         Parameters
131         ----------
132         ratio_range : Tuple[float, float] , default: (0.01 , 0.1)
133             The range between which the ratio of rarer data type in the column is
134             considered a problem.
135         """
136         def condition(result):
137             no_mix_columns = []
138             failing_columns = []
139             for col, ratios in result.items():
140                 # Columns without a mix contains empty dict for ratios
141                 if not ratios:
142                     no_mix_columns.append(col)
143                     continue
144                 rarer_ratio = min(ratios['strings'], ratios['numbers'])
145                 if ratio_range[0] < rarer_ratio < ratio_range[1]:
146                     failing_columns.append(col)
147             if failing_columns:
148                 details = f'Found {len(failing_columns)} out of {len(result)} columns with non-negligible quantities ' \
149                           f'of samples with a different data type from the majority of samples: {failing_columns}'
150                 return ConditionResult(ConditionCategory.WARN, details)
151             details = f'{len(result)} columns passed: found {len(result) - len(no_mix_columns)} columns with ' \
152                       f'negligible types mix, and {len(no_mix_columns)} columns without any types mix'
153             return ConditionResult(ConditionCategory.PASS, details)
154 
155         name = f'Rare data types in column are either more than {format_percent(ratio_range[1])} or less ' \
156                f'than {format_percent(ratio_range[0])} of the data'
157         return self.add_condition(name, condition)
158
```
--- 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/tabular/checks/data_integrity/mixed_data_types.py b/deepchecks/tabular/checks/data_integrity/mixed_data_types.py
--- a/deepchecks/tabular/checks/data_integrity/mixed_data_types.py
+++ b/deepchecks/tabular/checks/data_integrity/mixed_data_types.py
@@ -18,7 +18,7 @@
 from deepchecks.tabular import Context, SingleDatasetCheck
 from deepchecks.utils.dataframes import select_from_dataframe
 from deepchecks.utils.features import N_TOP_MESSAGE, column_importance_sorter_df
-from deepchecks.utils.strings import format_percent, is_string_column
+from deepchecks.utils.strings import format_list, format_number, format_percent, get_ellipsis, is_string_column
 from deepchecks.utils.typing import Hashable
 
 __all__ = ['MixedDataTypes']
@@ -79,7 +79,13 @@
             result_dict[column_name] = mix
             if mix:
                 # Format percents for display
-                display_dict[column_name] = {k: format_percent(v) for k, v in mix.items()}
+                formated_mix = {}
+                formated_mix['Strings'] = format_percent(mix['strings'])
+                formated_mix['Numbers'] = format_percent(mix['numbers'])
+                formated_mix['Strings examples'] = [get_ellipsis(strr, 15) for strr in mix['strings_examples']]
+                formated_mix['Numbers examples'] = '[' + format_list([format_number(float(num))
+                                                                      for num in mix['numbers_examples']]) + ']'
+                display_dict[column_name] = formated_mix
 
         if display_dict:
             df_graph = pd.DataFrame.from_dict(display_dict)
@@ -91,21 +97,26 @@
 
         return CheckResult(result_dict, display=display)
 
-    @classmethod
-    def _get_data_mix(cls, column_data: pd.Series) -> dict:
+    def _get_data_mix(self, column_data: pd.Series) -> dict:
         if is_string_column(column_data):
-            return cls._check_mixed_percentage(column_data)
+            return self._check_mixed_percentage(column_data)
         return {}
 
-    @classmethod
-    def _check_mixed_percentage(cls, column_data: pd.Series) -> dict:
+    def _check_mixed_percentage(self, column_data: pd.Series) -> dict:
         total_rows = column_data.count()
 
+        numbers_in_col = set()
+        strings_in_col = set()
+
         def is_float(x) -> bool:
             try:
                 float(x)
+                if len(numbers_in_col) < 3:
+                    numbers_in_col.add(x)
                 return True
             except ValueError:
+                if len(strings_in_col) < 3:
+                    strings_in_col.add(x)
                 return False
 
         nums = sum(column_data.apply(is_float))
@@ -116,7 +127,8 @@
         nums_pct = nums / total_rows
         strs_pct = (np.abs(nums - total_rows)) / total_rows
 
-        return {'strings': strs_pct, 'numbers': nums_pct}
+        return {'strings': strs_pct, 'numbers': nums_pct,
+                'strings_examples': strings_in_col, 'numbers_examples': numbers_in_col}
 
     def add_condition_rare_type_ratio_not_in_range(self, ratio_range: Tuple[float, float] = (0.01, 0.1)):
         """Add condition - Whether the ratio of rarer data type (strings or numbers) is not in the "danger zone".

{"golden_diff": "diff --git a/deepchecks/tabular/checks/data_integrity/mixed_data_types.py b/deepchecks/tabular/checks/data_integrity/mixed_data_types.py\n--- a/deepchecks/tabular/checks/data_integrity/mixed_data_types.py\n+++ b/deepchecks/tabular/checks/data_integrity/mixed_data_types.py\n@@ -18,7 +18,7 @@\n from deepchecks.tabular import Context, SingleDatasetCheck\n from deepchecks.utils.dataframes import select_from_dataframe\n from deepchecks.utils.features import N_TOP_MESSAGE, column_importance_sorter_df\n-from deepchecks.utils.strings import format_percent, is_string_column\n+from deepchecks.utils.strings import format_list, format_number, format_percent, get_ellipsis, is_string_column\n from deepchecks.utils.typing import Hashable\n \n __all__ = ['MixedDataTypes']\n@@ -79,7 +79,13 @@\n             result_dict[column_name] = mix\n             if mix:\n                 # Format percents for display\n-                display_dict[column_name] = {k: format_percent(v) for k, v in mix.items()}\n+                formated_mix = {}\n+                formated_mix['Strings'] = format_percent(mix['strings'])\n+                formated_mix['Numbers'] = format_percent(mix['numbers'])\n+                formated_mix['Strings examples'] = [get_ellipsis(strr, 15) for strr in mix['strings_examples']]\n+                formated_mix['Numbers examples'] = '[' + format_list([format_number(float(num))\n+                                                                      for num in mix['numbers_examples']]) + ']'\n+                display_dict[column_name] = formated_mix\n \n         if display_dict:\n             df_graph = pd.DataFrame.from_dict(display_dict)\n@@ -91,21 +97,26 @@\n \n         return CheckResult(result_dict, display=display)\n \n-    @classmethod\n-    def _get_data_mix(cls, column_data: pd.Series) -> dict:\n+    def _get_data_mix(self, column_data: pd.Series) -> dict:\n         if is_string_column(column_data):\n-            return cls._check_mixed_percentage(column_data)\n+            return self._check_mixed_percentage(column_data)\n         return {}\n \n-    @classmethod\n-    def _check_mixed_percentage(cls, column_data: pd.Series) -> dict:\n+    def _check_mixed_percentage(self, column_data: pd.Series) -> dict:\n         total_rows = column_data.count()\n \n+        numbers_in_col = set()\n+        strings_in_col = set()\n+\n         def is_float(x) -> bool:\n             try:\n                 float(x)\n+                if len(numbers_in_col) < 3:\n+                    numbers_in_col.add(x)\n                 return True\n             except ValueError:\n+                if len(strings_in_col) < 3:\n+                    strings_in_col.add(x)\n                 return False\n \n         nums = sum(column_data.apply(is_float))\n@@ -116,7 +127,8 @@\n         nums_pct = nums / total_rows\n         strs_pct = (np.abs(nums - total_rows)) / total_rows\n \n-        return {'strings': strs_pct, 'numbers': nums_pct}\n+        return {'strings': strs_pct, 'numbers': nums_pct,\n+                'strings_examples': strings_in_col, 'numbers_examples': numbers_in_col}\n \n     def add_condition_rare_type_ratio_not_in_range(self, ratio_range: Tuple[float, float] = (0.01, 0.1)):\n         \"\"\"Add condition - Whether the ratio of rarer data type (strings or numbers) is not in the \"danger zone\".\n", "issue": "[FEAT] MixedDataTypes to display a few examples of each type\nCurrent display:\r\n![image](https://user-images.githubusercontent.com/33841818/168741336-7c6bdb6c-cb67-4970-a39b-7fcc80dead12.png)\r\n\r\nDesired - to see a few unique examples from each type. currently have to inspect column in order to do it, e.g.:\r\n![image](https://user-images.githubusercontent.com/33841818/168741428-87dbe8fb-296f-43a7-b6b1-891d95222049.png)\r\nwould want the check to display it by itself\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 contains Mixed Types check.\"\"\"\nfrom typing import List, Tuple, Union\n\nimport numpy as np\nimport pandas as pd\n\nfrom deepchecks.core import CheckResult, ConditionCategory, ConditionResult\nfrom deepchecks.tabular import Context, SingleDatasetCheck\nfrom deepchecks.utils.dataframes import select_from_dataframe\nfrom deepchecks.utils.features import N_TOP_MESSAGE, column_importance_sorter_df\nfrom deepchecks.utils.strings import format_percent, is_string_column\nfrom deepchecks.utils.typing import Hashable\n\n__all__ = ['MixedDataTypes']\n\n\nclass MixedDataTypes(SingleDatasetCheck):\n    \"\"\"Detect columns which contain a mix of numerical and string values.\n\n    Parameters\n    ----------\n    columns : Union[Hashable, List[Hashable]] , default: None\n        Columns to check, if none are given checks all columns\n        except ignored ones.\n    ignore_columns : Union[Hashable, List[Hashable]] , default: None\n        Columns to ignore, if none given checks based on columns\n        variable.\n    n_top_columns : int , optional\n        amount of columns to show ordered by feature importance (date, index, label are first)\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_top_columns: int = 10,\n        **kwargs\n    ):\n        super().__init__(**kwargs)\n        self.columns = columns\n        self.ignore_columns = ignore_columns\n        self.n_top_columns = n_top_columns\n\n    def run_logic(self, context: Context, dataset_type: str = 'train') -> CheckResult:\n        \"\"\"Run check.\n\n        Returns\n        -------\n        CheckResult\n            value is a dict where the key is the column name as key and the value is the ratio 'strings' and 'numbers'\n            for any column with mixed data types.\n            numbers will also include hidden numbers in string representation.\n        \"\"\"\n        if dataset_type == 'train':\n            dataset = context.train\n        else:\n            dataset = context.test\n        features_importance = context.features_importance\n\n        df = select_from_dataframe(dataset.data, self.columns, self.ignore_columns)\n\n        # Result value: { Column Name: {string: pct, numbers: pct}}\n        display_dict = {}\n        result_dict = {}\n\n        for column_name in df.columns:\n            column_data = df[column_name].dropna()\n            mix = self._get_data_mix(column_data)\n            result_dict[column_name] = mix\n            if mix:\n                # Format percents for display\n                display_dict[column_name] = {k: format_percent(v) for k, v in mix.items()}\n\n        if display_dict:\n            df_graph = pd.DataFrame.from_dict(display_dict)\n            df_graph = column_importance_sorter_df(df_graph.T, dataset, features_importance,\n                                                   self.n_top_columns).T\n            display = [N_TOP_MESSAGE % self.n_top_columns, df_graph]\n        else:\n            display = None\n\n        return CheckResult(result_dict, display=display)\n\n    @classmethod\n    def _get_data_mix(cls, column_data: pd.Series) -> dict:\n        if is_string_column(column_data):\n            return cls._check_mixed_percentage(column_data)\n        return {}\n\n    @classmethod\n    def _check_mixed_percentage(cls, column_data: pd.Series) -> dict:\n        total_rows = column_data.count()\n\n        def is_float(x) -> bool:\n            try:\n                float(x)\n                return True\n            except ValueError:\n                return False\n\n        nums = sum(column_data.apply(is_float))\n        if nums in (total_rows, 0):\n            return {}\n\n        # Then we've got a mix\n        nums_pct = nums / total_rows\n        strs_pct = (np.abs(nums - total_rows)) / total_rows\n\n        return {'strings': strs_pct, 'numbers': nums_pct}\n\n    def add_condition_rare_type_ratio_not_in_range(self, ratio_range: Tuple[float, float] = (0.01, 0.1)):\n        \"\"\"Add condition - Whether the ratio of rarer data type (strings or numbers) is not in the \"danger zone\".\n\n        The \"danger zone\" represents the following logic - if the rarer data type is, for example, 30% of the data,\n        than the column is presumably supposed to contain both numbers and string values. If the rarer data type is,\n        for example, less than 1% of the data, than it's presumably a contamination, but a negligible one. In the range\n        between, there is a real chance that the rarer data type may represent a problem to model training and\n        inference.\n\n        Parameters\n        ----------\n        ratio_range : Tuple[float, float] , default: (0.01 , 0.1)\n            The range between which the ratio of rarer data type in the column is\n            considered a problem.\n        \"\"\"\n        def condition(result):\n            no_mix_columns = []\n            failing_columns = []\n            for col, ratios in result.items():\n                # Columns without a mix contains empty dict for ratios\n                if not ratios:\n                    no_mix_columns.append(col)\n                    continue\n                rarer_ratio = min(ratios['strings'], ratios['numbers'])\n                if ratio_range[0] < rarer_ratio < ratio_range[1]:\n                    failing_columns.append(col)\n            if failing_columns:\n                details = f'Found {len(failing_columns)} out of {len(result)} columns with non-negligible quantities ' \\\n                          f'of samples with a different data type from the majority of samples: {failing_columns}'\n                return ConditionResult(ConditionCategory.WARN, details)\n            details = f'{len(result)} columns passed: found {len(result) - len(no_mix_columns)} columns with ' \\\n                      f'negligible types mix, and {len(no_mix_columns)} columns without any types mix'\n            return ConditionResult(ConditionCategory.PASS, details)\n\n        name = f'Rare data types in column are either more than {format_percent(ratio_range[1])} or less ' \\\n               f'than {format_percent(ratio_range[0])} of the data'\n        return self.add_condition(name, condition)\n", "path": "deepchecks/tabular/checks/data_integrity/mixed_data_types.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 contains Mixed Types check.\"\"\"\nfrom typing import List, Tuple, Union\n\nimport numpy as np\nimport pandas as pd\n\nfrom deepchecks.core import CheckResult, ConditionCategory, ConditionResult\nfrom deepchecks.tabular import Context, SingleDatasetCheck\nfrom deepchecks.utils.dataframes import select_from_dataframe\nfrom deepchecks.utils.features import N_TOP_MESSAGE, column_importance_sorter_df\nfrom deepchecks.utils.strings import format_list, format_number, format_percent, get_ellipsis, is_string_column\nfrom deepchecks.utils.typing import Hashable\n\n__all__ = ['MixedDataTypes']\n\n\nclass MixedDataTypes(SingleDatasetCheck):\n    \"\"\"Detect columns which contain a mix of numerical and string values.\n\n    Parameters\n    ----------\n    columns : Union[Hashable, List[Hashable]] , default: None\n        Columns to check, if none are given checks all columns\n        except ignored ones.\n    ignore_columns : Union[Hashable, List[Hashable]] , default: None\n        Columns to ignore, if none given checks based on columns\n        variable.\n    n_top_columns : int , optional\n        amount of columns to show ordered by feature importance (date, index, label are first)\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_top_columns: int = 10,\n        **kwargs\n    ):\n        super().__init__(**kwargs)\n        self.columns = columns\n        self.ignore_columns = ignore_columns\n        self.n_top_columns = n_top_columns\n\n    def run_logic(self, context: Context, dataset_type: str = 'train') -> CheckResult:\n        \"\"\"Run check.\n\n        Returns\n        -------\n        CheckResult\n            value is a dict where the key is the column name as key and the value is the ratio 'strings' and 'numbers'\n            for any column with mixed data types.\n            numbers will also include hidden numbers in string representation.\n        \"\"\"\n        if dataset_type == 'train':\n            dataset = context.train\n        else:\n            dataset = context.test\n        features_importance = context.features_importance\n\n        df = select_from_dataframe(dataset.data, self.columns, self.ignore_columns)\n\n        # Result value: { Column Name: {string: pct, numbers: pct}}\n        display_dict = {}\n        result_dict = {}\n\n        for column_name in df.columns:\n            column_data = df[column_name].dropna()\n            mix = self._get_data_mix(column_data)\n            result_dict[column_name] = mix\n            if mix:\n                # Format percents for display\n                formated_mix = {}\n                formated_mix['Strings'] = format_percent(mix['strings'])\n                formated_mix['Numbers'] = format_percent(mix['numbers'])\n                formated_mix['Strings examples'] = [get_ellipsis(strr, 15) for strr in mix['strings_examples']]\n                formated_mix['Numbers examples'] = '[' + format_list([format_number(float(num))\n                                                                      for num in mix['numbers_examples']]) + ']'\n                display_dict[column_name] = formated_mix\n\n        if display_dict:\n            df_graph = pd.DataFrame.from_dict(display_dict)\n            df_graph = column_importance_sorter_df(df_graph.T, dataset, features_importance,\n                                                   self.n_top_columns).T\n            display = [N_TOP_MESSAGE % self.n_top_columns, df_graph]\n        else:\n            display = None\n\n        return CheckResult(result_dict, display=display)\n\n    def _get_data_mix(self, column_data: pd.Series) -> dict:\n        if is_string_column(column_data):\n            return self._check_mixed_percentage(column_data)\n        return {}\n\n    def _check_mixed_percentage(self, column_data: pd.Series) -> dict:\n        total_rows = column_data.count()\n\n        numbers_in_col = set()\n        strings_in_col = set()\n\n        def is_float(x) -> bool:\n            try:\n                float(x)\n                if len(numbers_in_col) < 3:\n                    numbers_in_col.add(x)\n                return True\n            except ValueError:\n                if len(strings_in_col) < 3:\n                    strings_in_col.add(x)\n                return False\n\n        nums = sum(column_data.apply(is_float))\n        if nums in (total_rows, 0):\n            return {}\n\n        # Then we've got a mix\n        nums_pct = nums / total_rows\n        strs_pct = (np.abs(nums - total_rows)) / total_rows\n\n        return {'strings': strs_pct, 'numbers': nums_pct,\n                'strings_examples': strings_in_col, 'numbers_examples': numbers_in_col}\n\n    def add_condition_rare_type_ratio_not_in_range(self, ratio_range: Tuple[float, float] = (0.01, 0.1)):\n        \"\"\"Add condition - Whether the ratio of rarer data type (strings or numbers) is not in the \"danger zone\".\n\n        The \"danger zone\" represents the following logic - if the rarer data type is, for example, 30% of the data,\n        than the column is presumably supposed to contain both numbers and string values. If the rarer data type is,\n        for example, less than 1% of the data, than it's presumably a contamination, but a negligible one. In the range\n        between, there is a real chance that the rarer data type may represent a problem to model training and\n        inference.\n\n        Parameters\n        ----------\n        ratio_range : Tuple[float, float] , default: (0.01 , 0.1)\n            The range between which the ratio of rarer data type in the column is\n            considered a problem.\n        \"\"\"\n        def condition(result):\n            no_mix_columns = []\n            failing_columns = []\n            for col, ratios in result.items():\n                # Columns without a mix contains empty dict for ratios\n                if not ratios:\n                    no_mix_columns.append(col)\n                    continue\n                rarer_ratio = min(ratios['strings'], ratios['numbers'])\n                if ratio_range[0] < rarer_ratio < ratio_range[1]:\n                    failing_columns.append(col)\n            if failing_columns:\n                details = f'Found {len(failing_columns)} out of {len(result)} columns with non-negligible quantities ' \\\n                          f'of samples with a different data type from the majority of samples: {failing_columns}'\n                return ConditionResult(ConditionCategory.WARN, details)\n            details = f'{len(result)} columns passed: found {len(result) - len(no_mix_columns)} columns with ' \\\n                      f'negligible types mix, and {len(no_mix_columns)} columns without any types mix'\n            return ConditionResult(ConditionCategory.PASS, details)\n\n        name = f'Rare data types in column are either more than {format_percent(ratio_range[1])} or less ' \\\n               f'than {format_percent(ratio_range[0])} of the data'\n        return self.add_condition(name, condition)\n", "path": "deepchecks/tabular/checks/data_integrity/mixed_data_types.py"}]}