We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Use cleaner solution for non-truncating division in python 2
Prefer `from __future__ import division` to `1.*x/y`

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `great_expectations/expectations/core/expect_column_values_to_not_match_regex_list.py`
Content:
```
1 from typing import TYPE_CHECKING, Optional
2 
3 from great_expectations.core import (
4     ExpectationConfiguration,
5     ExpectationValidationResult,
6 )
7 from great_expectations.expectations.expectation import (
8     ColumnMapExpectation,
9     InvalidExpectationConfigurationError,
10     render_evaluation_parameter_string,
11 )
12 from great_expectations.render import LegacyRendererType, RenderedStringTemplateContent
13 from great_expectations.render.renderer.renderer import renderer
14 from great_expectations.render.renderer_configuration import (
15     RendererConfiguration,
16     RendererValueType,
17 )
18 from great_expectations.render.util import (
19     num_to_str,
20     parse_row_condition_string_pandas_engine,
21     substitute_none_for_missing,
22 )
23 
24 if TYPE_CHECKING:
25     from great_expectations.render.renderer_configuration import AddParamArgs
26 
27 
28 class ExpectColumnValuesToNotMatchRegexList(ColumnMapExpectation):
29     """Expect the column entries to be strings that do not match any of a list of regular expressions. Matches can be anywhere in the string.
30 
31     expect_column_values_to_not_match_regex_list is a \
32     [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).
33 
34     Args:
35         column (str): \
36             The column name.
37         regex_list (list): \
38             The list of regular expressions which the column entries should not match
39 
40     Keyword Args:
41         mostly (None or a float between 0 and 1): \
42             Successful if at least mostly fraction of values match the expectation. \
43             For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).
44 
45     Other Parameters:
46         result_format (str or None): \
47             Which output mode to use: BOOLEAN_ONLY, BASIC, COMPLETE, or SUMMARY. \
48             For more detail, see [result_format](https://docs.greatexpectations.io/docs/reference/expectations/result_format).
49         include_config (boolean): \
50             If True, then include the expectation config as part of the result object.
51         catch_exceptions (boolean or None): \
52             If True, then catch exceptions and include them as part of the result object. \
53             For more detail, see [catch_exceptions](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#catch_exceptions).
54         meta (dict or None): \
55             A JSON-serializable dictionary (nesting allowed) that will be included in the output without \
56             modification. For more detail, see [meta](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#meta).
57 
58     Returns:
59         An [ExpectationSuiteValidationResult](https://docs.greatexpectations.io/docs/terms/validation_result)
60 
61         Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.
62 
63     See Also:
64         [expect_column_values_to_match_regex](https://greatexpectations.io/expectations/expect_column_values_to_match_regex)
65         [expect_column_values_to_match_regex_list](https://greatexpectations.io/expectations/expect_column_values_to_match_regex_list)
66         [expect_column_values_to_not_match_regex](https://greatexpectations.io/expectations/expect_column_values_to_not_match_regex)
67         [expect_column_values_to_match_like_pattern](https://greatexpectations.io/expectations/expect_column_values_to_match_like_pattern)
68         [expect_column_values_to_match_like_pattern_list](https://greatexpectations.io/expectations/expect_column_values_to_match_like_pattern_list)
69         [expect_column_values_to_not_match_like_pattern](https://greatexpectations.io/expectations/expect_column_values_to_not_match_like_pattern)
70         [expect_column_values_to_not_match_like_pattern_list](https://greatexpectations.io/expectations/expect_column_values_to_not_match_like_pattern_list)
71     """
72 
73     library_metadata = {
74         "maturity": "production",
75         "tags": ["core expectation", "column map expectation"],
76         "contributors": [
77             "@great_expectations",
78         ],
79         "requirements": [],
80         "has_full_test_suite": True,
81         "manually_reviewed_code": True,
82     }
83 
84     map_metric = "column_values.not_match_regex_list"
85     success_keys = (
86         "regex_list",
87         "mostly",
88     )
89     default_kwarg_values = {
90         "row_condition": None,
91         "condition_parser": None,  # we expect this to be explicitly set whenever a row_condition is passed
92         "mostly": 1,
93         "result_format": "BASIC",
94         "include_config": True,
95         "catch_exceptions": True,
96     }
97     args_keys = (
98         "column",
99         "regex_list",
100     )
101 
102     def validate_configuration(
103         self, configuration: Optional[ExpectationConfiguration] = None
104     ) -> None:
105         """Validates the configuration for the Expectation.
106 
107         For `expect_column_values_to_match_regex_list`
108         we require that the `configuraton.kwargs` contain a `regex_list` key that is either
109         a non-empty `list[str]` or a `dict[list]` with `$PARAMETER` key with list of regexes.
110 
111         Args:
112             configuration: The ExpectationConfiguration to be validated.
113 
114         Raises:
115             InvalidExpectationConfigurationError: The configuraton does not contain the values required by the Expectation
116         """
117         super().validate_configuration(configuration)
118         configuration = configuration or self.configuration
119         try:
120             assert "regex_list" in configuration.kwargs, "regex_list is required"
121             assert isinstance(
122                 configuration.kwargs["regex_list"], (list, dict)
123             ), "regex_list must be a list of regexes"
124             if (
125                 not isinstance(configuration.kwargs["regex_list"], dict)
126                 and len(configuration.kwargs["regex_list"]) > 0
127             ):
128                 for i in configuration.kwargs["regex_list"]:
129                     assert isinstance(i, str), "regexes in list must be strings"
130             if isinstance(configuration.kwargs["regex_list"], dict):
131                 assert (
132                     "$PARAMETER" in configuration.kwargs["regex_list"]
133                 ), 'Evaluation Parameter dict for regex_list kwarg must have "$PARAMETER" key.'
134         except AssertionError as e:
135             raise InvalidExpectationConfigurationError(str(e))
136 
137     @classmethod
138     def _prescriptive_template(
139         cls,
140         renderer_configuration: RendererConfiguration,
141     ) -> RendererConfiguration:
142         add_param_args: AddParamArgs = (
143             ("column", RendererValueType.STRING),
144             ("regex_list", RendererValueType.ARRAY),
145             ("mostly", RendererValueType.NUMBER),
146         )
147         for name, param_type in add_param_args:
148             renderer_configuration.add_param(name=name, param_type=param_type)
149 
150         params = renderer_configuration.params
151 
152         if not params.regex_list or not params.regex_list.value:
153             values_string = "[ ]"
154         else:
155             array_param_name = "regex_list"
156             param_prefix = "v__"
157             renderer_configuration = cls._add_array_params(
158                 array_param_name=array_param_name,
159                 param_prefix=param_prefix,
160                 renderer_configuration=renderer_configuration,
161             )
162             values_string: str = cls._get_array_string(
163                 array_param_name=array_param_name,
164                 param_prefix=param_prefix,
165                 renderer_configuration=renderer_configuration,
166             )
167 
168         template_str = (
169             "values must not match any of the following regular expressions: "
170             + values_string
171         )
172 
173         if params.mostly and params.mostly.value < 1.0:
174             renderer_configuration = cls._add_mostly_pct_param(
175                 renderer_configuration=renderer_configuration
176             )
177             template_str += ", at least $mostly_pct % of the time."
178         else:
179             template_str += "."
180 
181         if renderer_configuration.include_column_name:
182             template_str = f"$column {template_str}"
183 
184         renderer_configuration.template_str = template_str
185 
186         return renderer_configuration
187 
188     @classmethod
189     @renderer(renderer_type=LegacyRendererType.PRESCRIPTIVE)
190     @render_evaluation_parameter_string
191     def _prescriptive_renderer(
192         cls,
193         configuration: Optional[ExpectationConfiguration] = None,
194         result: Optional[ExpectationValidationResult] = None,
195         runtime_configuration: Optional[dict] = None,
196         **kwargs,
197     ):
198         runtime_configuration = runtime_configuration or {}
199         include_column_name = (
200             False if runtime_configuration.get("include_column_name") is False else True
201         )
202         styling = runtime_configuration.get("styling")
203         params = substitute_none_for_missing(
204             configuration.kwargs,
205             ["column", "regex_list", "mostly", "row_condition", "condition_parser"],
206         )
207 
208         if not params.get("regex_list") or len(params.get("regex_list")) == 0:
209             values_string = "[ ]"
210         else:
211             for i, v in enumerate(params["regex_list"]):
212                 params[f"v__{str(i)}"] = v
213             values_string = " ".join(
214                 [f"$v__{str(i)}" for i, v in enumerate(params["regex_list"])]
215             )
216 
217         template_str = (
218             "values must not match any of the following regular expressions: "
219             + values_string
220         )
221 
222         if params["mostly"] is not None and params["mostly"] < 1.0:
223             params["mostly_pct"] = num_to_str(
224                 params["mostly"] * 100, precision=15, no_scientific=True
225             )
226             # params["mostly_pct"] = "{:.14f}".format(params["mostly"]*100).rstrip("0").rstrip(".")
227             template_str += ", at least $mostly_pct % of the time."
228         else:
229             template_str += "."
230 
231         if include_column_name:
232             template_str = f"$column {template_str}"
233 
234         if params["row_condition"] is not None:
235             (
236                 conditional_template_str,
237                 conditional_params,
238             ) = parse_row_condition_string_pandas_engine(params["row_condition"])
239             template_str = f"{conditional_template_str}, then {template_str}"
240             params.update(conditional_params)
241 
242         return [
243             RenderedStringTemplateContent(
244                 **{
245                     "content_block_type": "string_template",
246                     "string_template": {
247                         "template": template_str,
248                         "params": params,
249                         "styling": styling,
250                     },
251                 }
252             )
253         ]
254
```
--- 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/great_expectations/expectations/core/expect_column_values_to_not_match_regex_list.py b/great_expectations/expectations/core/expect_column_values_to_not_match_regex_list.py
--- a/great_expectations/expectations/core/expect_column_values_to_not_match_regex_list.py
+++ b/great_expectations/expectations/core/expect_column_values_to_not_match_regex_list.py
@@ -102,17 +102,20 @@
     def validate_configuration(
         self, configuration: Optional[ExpectationConfiguration] = None
     ) -> None:
-        """Validates the configuration for the Expectation.
+        """Validates the configuration of an Expectation.
 
-        For `expect_column_values_to_match_regex_list`
-        we require that the `configuraton.kwargs` contain a `regex_list` key that is either
-        a non-empty `list[str]` or a `dict[list]` with `$PARAMETER` key with list of regexes.
+        For `expect_column_values_to_not_match_regex_list` it is required that:
+            - 'regex_list' kwarg is of type list or dict
+            - if 'regex_list' is list, assert is non-empty and each entry is of type str
+            - if 'regex_list' is dict, assert a key "$PARAMETER" is present
 
         Args:
-            configuration: The ExpectationConfiguration to be validated.
+            configuration: An `ExpectationConfiguration` to validate. If no configuration is provided, it will be pulled
+                                  from the configuration attribute of the Expectation instance.
 
         Raises:
-            InvalidExpectationConfigurationError: The configuraton does not contain the values required by the Expectation
+            InvalidExpectationConfigurationError: The configuration does not contain the values required by the
+                                  Expectation.
         """
         super().validate_configuration(configuration)
         configuration = configuration or self.configuration
@@ -120,7 +123,7 @@
             assert "regex_list" in configuration.kwargs, "regex_list is required"
             assert isinstance(
                 configuration.kwargs["regex_list"], (list, dict)
-            ), "regex_list must be a list of regexes"
+            ), "regex_list must be a list or dict of regexes"
             if (
                 not isinstance(configuration.kwargs["regex_list"], dict)
                 and len(configuration.kwargs["regex_list"]) > 0

{"golden_diff": "diff --git a/great_expectations/expectations/core/expect_column_values_to_not_match_regex_list.py b/great_expectations/expectations/core/expect_column_values_to_not_match_regex_list.py\n--- a/great_expectations/expectations/core/expect_column_values_to_not_match_regex_list.py\n+++ b/great_expectations/expectations/core/expect_column_values_to_not_match_regex_list.py\n@@ -102,17 +102,20 @@\n     def validate_configuration(\n         self, configuration: Optional[ExpectationConfiguration] = None\n     ) -> None:\n-        \"\"\"Validates the configuration for the Expectation.\n+        \"\"\"Validates the configuration of an Expectation.\n \n-        For `expect_column_values_to_match_regex_list`\n-        we require that the `configuraton.kwargs` contain a `regex_list` key that is either\n-        a non-empty `list[str]` or a `dict[list]` with `$PARAMETER` key with list of regexes.\n+        For `expect_column_values_to_not_match_regex_list` it is required that:\n+            - 'regex_list' kwarg is of type list or dict\n+            - if 'regex_list' is list, assert is non-empty and each entry is of type str\n+            - if 'regex_list' is dict, assert a key \"$PARAMETER\" is present\n \n         Args:\n-            configuration: The ExpectationConfiguration to be validated.\n+            configuration: An `ExpectationConfiguration` to validate. If no configuration is provided, it will be pulled\n+                                  from the configuration attribute of the Expectation instance.\n \n         Raises:\n-            InvalidExpectationConfigurationError: The configuraton does not contain the values required by the Expectation\n+            InvalidExpectationConfigurationError: The configuration does not contain the values required by the\n+                                  Expectation.\n         \"\"\"\n         super().validate_configuration(configuration)\n         configuration = configuration or self.configuration\n@@ -120,7 +123,7 @@\n             assert \"regex_list\" in configuration.kwargs, \"regex_list is required\"\n             assert isinstance(\n                 configuration.kwargs[\"regex_list\"], (list, dict)\n-            ), \"regex_list must be a list of regexes\"\n+            ), \"regex_list must be a list or dict of regexes\"\n             if (\n                 not isinstance(configuration.kwargs[\"regex_list\"], dict)\n                 and len(configuration.kwargs[\"regex_list\"]) > 0\n", "issue": "Use cleaner solution for non-truncating division in python 2\nPrefer `from __future__ import division` to `1.*x/y`\n", "before_files": [{"content": "from typing import TYPE_CHECKING, Optional\n\nfrom great_expectations.core import (\n    ExpectationConfiguration,\n    ExpectationValidationResult,\n)\nfrom great_expectations.expectations.expectation import (\n    ColumnMapExpectation,\n    InvalidExpectationConfigurationError,\n    render_evaluation_parameter_string,\n)\nfrom great_expectations.render import LegacyRendererType, RenderedStringTemplateContent\nfrom great_expectations.render.renderer.renderer import renderer\nfrom great_expectations.render.renderer_configuration import (\n    RendererConfiguration,\n    RendererValueType,\n)\nfrom great_expectations.render.util import (\n    num_to_str,\n    parse_row_condition_string_pandas_engine,\n    substitute_none_for_missing,\n)\n\nif TYPE_CHECKING:\n    from great_expectations.render.renderer_configuration import AddParamArgs\n\n\nclass ExpectColumnValuesToNotMatchRegexList(ColumnMapExpectation):\n    \"\"\"Expect the column entries to be strings that do not match any of a list of regular expressions. Matches can be anywhere in the string.\n\n    expect_column_values_to_not_match_regex_list is a \\\n    [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).\n\n    Args:\n        column (str): \\\n            The column name.\n        regex_list (list): \\\n            The list of regular expressions which the column entries should not match\n\n    Keyword Args:\n        mostly (None or a float between 0 and 1): \\\n            Successful if at least mostly fraction of values match the expectation. \\\n            For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).\n\n    Other Parameters:\n        result_format (str or None): \\\n            Which output mode to use: BOOLEAN_ONLY, BASIC, COMPLETE, or SUMMARY. \\\n            For more detail, see [result_format](https://docs.greatexpectations.io/docs/reference/expectations/result_format).\n        include_config (boolean): \\\n            If True, then include the expectation config as part of the result object.\n        catch_exceptions (boolean or None): \\\n            If True, then catch exceptions and include them as part of the result object. \\\n            For more detail, see [catch_exceptions](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#catch_exceptions).\n        meta (dict or None): \\\n            A JSON-serializable dictionary (nesting allowed) that will be included in the output without \\\n            modification. For more detail, see [meta](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#meta).\n\n    Returns:\n        An [ExpectationSuiteValidationResult](https://docs.greatexpectations.io/docs/terms/validation_result)\n\n        Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.\n\n    See Also:\n        [expect_column_values_to_match_regex](https://greatexpectations.io/expectations/expect_column_values_to_match_regex)\n        [expect_column_values_to_match_regex_list](https://greatexpectations.io/expectations/expect_column_values_to_match_regex_list)\n        [expect_column_values_to_not_match_regex](https://greatexpectations.io/expectations/expect_column_values_to_not_match_regex)\n        [expect_column_values_to_match_like_pattern](https://greatexpectations.io/expectations/expect_column_values_to_match_like_pattern)\n        [expect_column_values_to_match_like_pattern_list](https://greatexpectations.io/expectations/expect_column_values_to_match_like_pattern_list)\n        [expect_column_values_to_not_match_like_pattern](https://greatexpectations.io/expectations/expect_column_values_to_not_match_like_pattern)\n        [expect_column_values_to_not_match_like_pattern_list](https://greatexpectations.io/expectations/expect_column_values_to_not_match_like_pattern_list)\n    \"\"\"\n\n    library_metadata = {\n        \"maturity\": \"production\",\n        \"tags\": [\"core expectation\", \"column map expectation\"],\n        \"contributors\": [\n            \"@great_expectations\",\n        ],\n        \"requirements\": [],\n        \"has_full_test_suite\": True,\n        \"manually_reviewed_code\": True,\n    }\n\n    map_metric = \"column_values.not_match_regex_list\"\n    success_keys = (\n        \"regex_list\",\n        \"mostly\",\n    )\n    default_kwarg_values = {\n        \"row_condition\": None,\n        \"condition_parser\": None,  # we expect this to be explicitly set whenever a row_condition is passed\n        \"mostly\": 1,\n        \"result_format\": \"BASIC\",\n        \"include_config\": True,\n        \"catch_exceptions\": True,\n    }\n    args_keys = (\n        \"column\",\n        \"regex_list\",\n    )\n\n    def validate_configuration(\n        self, configuration: Optional[ExpectationConfiguration] = None\n    ) -> None:\n        \"\"\"Validates the configuration for the Expectation.\n\n        For `expect_column_values_to_match_regex_list`\n        we require that the `configuraton.kwargs` contain a `regex_list` key that is either\n        a non-empty `list[str]` or a `dict[list]` with `$PARAMETER` key with list of regexes.\n\n        Args:\n            configuration: The ExpectationConfiguration to be validated.\n\n        Raises:\n            InvalidExpectationConfigurationError: The configuraton does not contain the values required by the Expectation\n        \"\"\"\n        super().validate_configuration(configuration)\n        configuration = configuration or self.configuration\n        try:\n            assert \"regex_list\" in configuration.kwargs, \"regex_list is required\"\n            assert isinstance(\n                configuration.kwargs[\"regex_list\"], (list, dict)\n            ), \"regex_list must be a list of regexes\"\n            if (\n                not isinstance(configuration.kwargs[\"regex_list\"], dict)\n                and len(configuration.kwargs[\"regex_list\"]) > 0\n            ):\n                for i in configuration.kwargs[\"regex_list\"]:\n                    assert isinstance(i, str), \"regexes in list must be strings\"\n            if isinstance(configuration.kwargs[\"regex_list\"], dict):\n                assert (\n                    \"$PARAMETER\" in configuration.kwargs[\"regex_list\"]\n                ), 'Evaluation Parameter dict for regex_list kwarg must have \"$PARAMETER\" key.'\n        except AssertionError as e:\n            raise InvalidExpectationConfigurationError(str(e))\n\n    @classmethod\n    def _prescriptive_template(\n        cls,\n        renderer_configuration: RendererConfiguration,\n    ) -> RendererConfiguration:\n        add_param_args: AddParamArgs = (\n            (\"column\", RendererValueType.STRING),\n            (\"regex_list\", RendererValueType.ARRAY),\n            (\"mostly\", RendererValueType.NUMBER),\n        )\n        for name, param_type in add_param_args:\n            renderer_configuration.add_param(name=name, param_type=param_type)\n\n        params = renderer_configuration.params\n\n        if not params.regex_list or not params.regex_list.value:\n            values_string = \"[ ]\"\n        else:\n            array_param_name = \"regex_list\"\n            param_prefix = \"v__\"\n            renderer_configuration = cls._add_array_params(\n                array_param_name=array_param_name,\n                param_prefix=param_prefix,\n                renderer_configuration=renderer_configuration,\n            )\n            values_string: str = cls._get_array_string(\n                array_param_name=array_param_name,\n                param_prefix=param_prefix,\n                renderer_configuration=renderer_configuration,\n            )\n\n        template_str = (\n            \"values must not match any of the following regular expressions: \"\n            + values_string\n        )\n\n        if params.mostly and params.mostly.value < 1.0:\n            renderer_configuration = cls._add_mostly_pct_param(\n                renderer_configuration=renderer_configuration\n            )\n            template_str += \", at least $mostly_pct % of the time.\"\n        else:\n            template_str += \".\"\n\n        if renderer_configuration.include_column_name:\n            template_str = f\"$column {template_str}\"\n\n        renderer_configuration.template_str = template_str\n\n        return renderer_configuration\n\n    @classmethod\n    @renderer(renderer_type=LegacyRendererType.PRESCRIPTIVE)\n    @render_evaluation_parameter_string\n    def _prescriptive_renderer(\n        cls,\n        configuration: Optional[ExpectationConfiguration] = None,\n        result: Optional[ExpectationValidationResult] = None,\n        runtime_configuration: Optional[dict] = None,\n        **kwargs,\n    ):\n        runtime_configuration = runtime_configuration or {}\n        include_column_name = (\n            False if runtime_configuration.get(\"include_column_name\") is False else True\n        )\n        styling = runtime_configuration.get(\"styling\")\n        params = substitute_none_for_missing(\n            configuration.kwargs,\n            [\"column\", \"regex_list\", \"mostly\", \"row_condition\", \"condition_parser\"],\n        )\n\n        if not params.get(\"regex_list\") or len(params.get(\"regex_list\")) == 0:\n            values_string = \"[ ]\"\n        else:\n            for i, v in enumerate(params[\"regex_list\"]):\n                params[f\"v__{str(i)}\"] = v\n            values_string = \" \".join(\n                [f\"$v__{str(i)}\" for i, v in enumerate(params[\"regex_list\"])]\n            )\n\n        template_str = (\n            \"values must not match any of the following regular expressions: \"\n            + values_string\n        )\n\n        if params[\"mostly\"] is not None and params[\"mostly\"] < 1.0:\n            params[\"mostly_pct\"] = num_to_str(\n                params[\"mostly\"] * 100, precision=15, no_scientific=True\n            )\n            # params[\"mostly_pct\"] = \"{:.14f}\".format(params[\"mostly\"]*100).rstrip(\"0\").rstrip(\".\")\n            template_str += \", at least $mostly_pct % of the time.\"\n        else:\n            template_str += \".\"\n\n        if include_column_name:\n            template_str = f\"$column {template_str}\"\n\n        if params[\"row_condition\"] is not None:\n            (\n                conditional_template_str,\n                conditional_params,\n            ) = parse_row_condition_string_pandas_engine(params[\"row_condition\"])\n            template_str = f\"{conditional_template_str}, then {template_str}\"\n            params.update(conditional_params)\n\n        return [\n            RenderedStringTemplateContent(\n                **{\n                    \"content_block_type\": \"string_template\",\n                    \"string_template\": {\n                        \"template\": template_str,\n                        \"params\": params,\n                        \"styling\": styling,\n                    },\n                }\n            )\n        ]\n", "path": "great_expectations/expectations/core/expect_column_values_to_not_match_regex_list.py"}], "after_files": [{"content": "from typing import TYPE_CHECKING, Optional\n\nfrom great_expectations.core import (\n    ExpectationConfiguration,\n    ExpectationValidationResult,\n)\nfrom great_expectations.expectations.expectation import (\n    ColumnMapExpectation,\n    InvalidExpectationConfigurationError,\n    render_evaluation_parameter_string,\n)\nfrom great_expectations.render import LegacyRendererType, RenderedStringTemplateContent\nfrom great_expectations.render.renderer.renderer import renderer\nfrom great_expectations.render.renderer_configuration import (\n    RendererConfiguration,\n    RendererValueType,\n)\nfrom great_expectations.render.util import (\n    num_to_str,\n    parse_row_condition_string_pandas_engine,\n    substitute_none_for_missing,\n)\n\nif TYPE_CHECKING:\n    from great_expectations.render.renderer_configuration import AddParamArgs\n\n\nclass ExpectColumnValuesToNotMatchRegexList(ColumnMapExpectation):\n    \"\"\"Expect the column entries to be strings that do not match any of a list of regular expressions. Matches can be anywhere in the string.\n\n    expect_column_values_to_not_match_regex_list is a \\\n    [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).\n\n    Args:\n        column (str): \\\n            The column name.\n        regex_list (list): \\\n            The list of regular expressions which the column entries should not match\n\n    Keyword Args:\n        mostly (None or a float between 0 and 1): \\\n            Successful if at least mostly fraction of values match the expectation. \\\n            For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).\n\n    Other Parameters:\n        result_format (str or None): \\\n            Which output mode to use: BOOLEAN_ONLY, BASIC, COMPLETE, or SUMMARY. \\\n            For more detail, see [result_format](https://docs.greatexpectations.io/docs/reference/expectations/result_format).\n        include_config (boolean): \\\n            If True, then include the expectation config as part of the result object.\n        catch_exceptions (boolean or None): \\\n            If True, then catch exceptions and include them as part of the result object. \\\n            For more detail, see [catch_exceptions](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#catch_exceptions).\n        meta (dict or None): \\\n            A JSON-serializable dictionary (nesting allowed) that will be included in the output without \\\n            modification. For more detail, see [meta](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#meta).\n\n    Returns:\n        An [ExpectationSuiteValidationResult](https://docs.greatexpectations.io/docs/terms/validation_result)\n\n        Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.\n\n    See Also:\n        [expect_column_values_to_match_regex](https://greatexpectations.io/expectations/expect_column_values_to_match_regex)\n        [expect_column_values_to_match_regex_list](https://greatexpectations.io/expectations/expect_column_values_to_match_regex_list)\n        [expect_column_values_to_not_match_regex](https://greatexpectations.io/expectations/expect_column_values_to_not_match_regex)\n        [expect_column_values_to_match_like_pattern](https://greatexpectations.io/expectations/expect_column_values_to_match_like_pattern)\n        [expect_column_values_to_match_like_pattern_list](https://greatexpectations.io/expectations/expect_column_values_to_match_like_pattern_list)\n        [expect_column_values_to_not_match_like_pattern](https://greatexpectations.io/expectations/expect_column_values_to_not_match_like_pattern)\n        [expect_column_values_to_not_match_like_pattern_list](https://greatexpectations.io/expectations/expect_column_values_to_not_match_like_pattern_list)\n    \"\"\"\n\n    library_metadata = {\n        \"maturity\": \"production\",\n        \"tags\": [\"core expectation\", \"column map expectation\"],\n        \"contributors\": [\n            \"@great_expectations\",\n        ],\n        \"requirements\": [],\n        \"has_full_test_suite\": True,\n        \"manually_reviewed_code\": True,\n    }\n\n    map_metric = \"column_values.not_match_regex_list\"\n    success_keys = (\n        \"regex_list\",\n        \"mostly\",\n    )\n    default_kwarg_values = {\n        \"row_condition\": None,\n        \"condition_parser\": None,  # we expect this to be explicitly set whenever a row_condition is passed\n        \"mostly\": 1,\n        \"result_format\": \"BASIC\",\n        \"include_config\": True,\n        \"catch_exceptions\": True,\n    }\n    args_keys = (\n        \"column\",\n        \"regex_list\",\n    )\n\n    def validate_configuration(\n        self, configuration: Optional[ExpectationConfiguration] = None\n    ) -> None:\n        \"\"\"Validates the configuration of an Expectation.\n\n        For `expect_column_values_to_not_match_regex_list` it is required that:\n            - 'regex_list' kwarg is of type list or dict\n            - if 'regex_list' is list, assert is non-empty and each entry is of type str\n            - if 'regex_list' is dict, assert a key \"$PARAMETER\" is present\n\n        Args:\n            configuration: An `ExpectationConfiguration` to validate. If no configuration is provided, it will be pulled\n                                  from the configuration attribute of the Expectation instance.\n\n        Raises:\n            InvalidExpectationConfigurationError: The configuration does not contain the values required by the\n                                  Expectation.\n        \"\"\"\n        super().validate_configuration(configuration)\n        configuration = configuration or self.configuration\n        try:\n            assert \"regex_list\" in configuration.kwargs, \"regex_list is required\"\n            assert isinstance(\n                configuration.kwargs[\"regex_list\"], (list, dict)\n            ), \"regex_list must be a list or dict of regexes\"\n            if (\n                not isinstance(configuration.kwargs[\"regex_list\"], dict)\n                and len(configuration.kwargs[\"regex_list\"]) > 0\n            ):\n                for i in configuration.kwargs[\"regex_list\"]:\n                    assert isinstance(i, str), \"regexes in list must be strings\"\n            if isinstance(configuration.kwargs[\"regex_list\"], dict):\n                assert (\n                    \"$PARAMETER\" in configuration.kwargs[\"regex_list\"]\n                ), 'Evaluation Parameter dict for regex_list kwarg must have \"$PARAMETER\" key.'\n        except AssertionError as e:\n            raise InvalidExpectationConfigurationError(str(e))\n\n    @classmethod\n    def _prescriptive_template(\n        cls,\n        renderer_configuration: RendererConfiguration,\n    ) -> RendererConfiguration:\n        add_param_args: AddParamArgs = (\n            (\"column\", RendererValueType.STRING),\n            (\"regex_list\", RendererValueType.ARRAY),\n            (\"mostly\", RendererValueType.NUMBER),\n        )\n        for name, param_type in add_param_args:\n            renderer_configuration.add_param(name=name, param_type=param_type)\n\n        params = renderer_configuration.params\n\n        if not params.regex_list or not params.regex_list.value:\n            values_string = \"[ ]\"\n        else:\n            array_param_name = \"regex_list\"\n            param_prefix = \"v__\"\n            renderer_configuration = cls._add_array_params(\n                array_param_name=array_param_name,\n                param_prefix=param_prefix,\n                renderer_configuration=renderer_configuration,\n            )\n            values_string: str = cls._get_array_string(\n                array_param_name=array_param_name,\n                param_prefix=param_prefix,\n                renderer_configuration=renderer_configuration,\n            )\n\n        template_str = (\n            \"values must not match any of the following regular expressions: \"\n            + values_string\n        )\n\n        if params.mostly and params.mostly.value < 1.0:\n            renderer_configuration = cls._add_mostly_pct_param(\n                renderer_configuration=renderer_configuration\n            )\n            template_str += \", at least $mostly_pct % of the time.\"\n        else:\n            template_str += \".\"\n\n        if renderer_configuration.include_column_name:\n            template_str = f\"$column {template_str}\"\n\n        renderer_configuration.template_str = template_str\n\n        return renderer_configuration\n\n    @classmethod\n    @renderer(renderer_type=LegacyRendererType.PRESCRIPTIVE)\n    @render_evaluation_parameter_string\n    def _prescriptive_renderer(\n        cls,\n        configuration: Optional[ExpectationConfiguration] = None,\n        result: Optional[ExpectationValidationResult] = None,\n        runtime_configuration: Optional[dict] = None,\n        **kwargs,\n    ):\n        runtime_configuration = runtime_configuration or {}\n        include_column_name = (\n            False if runtime_configuration.get(\"include_column_name\") is False else True\n        )\n        styling = runtime_configuration.get(\"styling\")\n        params = substitute_none_for_missing(\n            configuration.kwargs,\n            [\"column\", \"regex_list\", \"mostly\", \"row_condition\", \"condition_parser\"],\n        )\n\n        if not params.get(\"regex_list\") or len(params.get(\"regex_list\")) == 0:\n            values_string = \"[ ]\"\n        else:\n            for i, v in enumerate(params[\"regex_list\"]):\n                params[f\"v__{str(i)}\"] = v\n            values_string = \" \".join(\n                [f\"$v__{str(i)}\" for i, v in enumerate(params[\"regex_list\"])]\n            )\n\n        template_str = (\n            \"values must not match any of the following regular expressions: \"\n            + values_string\n        )\n\n        if params[\"mostly\"] is not None and params[\"mostly\"] < 1.0:\n            params[\"mostly_pct\"] = num_to_str(\n                params[\"mostly\"] * 100, precision=15, no_scientific=True\n            )\n            # params[\"mostly_pct\"] = \"{:.14f}\".format(params[\"mostly\"]*100).rstrip(\"0\").rstrip(\".\")\n            template_str += \", at least $mostly_pct % of the time.\"\n        else:\n            template_str += \".\"\n\n        if include_column_name:\n            template_str = f\"$column {template_str}\"\n\n        if params[\"row_condition\"] is not None:\n            (\n                conditional_template_str,\n                conditional_params,\n            ) = parse_row_condition_string_pandas_engine(params[\"row_condition\"])\n            template_str = f\"{conditional_template_str}, then {template_str}\"\n            params.update(conditional_params)\n\n        return [\n            RenderedStringTemplateContent(\n                **{\n                    \"content_block_type\": \"string_template\",\n                    \"string_template\": {\n                        \"template\": template_str,\n                        \"params\": params,\n                        \"styling\": styling,\n                    },\n                }\n            )\n        ]\n", "path": "great_expectations/expectations/core/expect_column_values_to_not_match_regex_list.py"}]}