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/data_context/util.py`
Content:
```
1 import copy
2 import importlib
3 import inspect
4 import logging
5 import os
6 import re
7 from collections import OrderedDict
8 
9 from great_expectations.data_context.types.base import (
10     DataContextConfig,
11     DataContextConfigSchema,
12 )
13 from great_expectations.exceptions import (
14     MissingConfigVariableError,
15     PluginClassNotFoundError,
16     PluginModuleNotFoundError,
17 )
18 from great_expectations.util import verify_dynamic_loading_support
19 
20 logger = logging.getLogger(__name__)
21 
22 
23 def load_class(class_name, module_name):
24     """Dynamically load a class from strings or raise a helpful error."""
25     try:
26         loaded_module = importlib.import_module(module_name)
27         class_ = getattr(loaded_module, class_name)
28     except ModuleNotFoundError:
29         raise PluginModuleNotFoundError(module_name)
30     except AttributeError:
31         raise PluginClassNotFoundError(module_name=module_name, class_name=class_name)
32     return class_
33 
34 
35 # TODO: Rename config to constructor_kwargs and config_defaults -> constructor_kwarg_default
36 # TODO: Improve error messages in this method. Since so much of our workflow is config-driven, this will be a *super* important part of DX.
37 def instantiate_class_from_config(config, runtime_environment, config_defaults=None):
38     """Build a GE class from configuration dictionaries."""
39 
40     if config_defaults is None:
41         config_defaults = {}
42 
43     config = copy.deepcopy(config)
44 
45     module_name = config.pop("module_name", None)
46     if module_name is None:
47         try:
48             module_name = config_defaults.pop("module_name")
49         except KeyError:
50             raise KeyError(
51                 "Neither config : {} nor config_defaults : {} contains a module_name key.".format(
52                     config, config_defaults,
53                 )
54             )
55     else:
56         # Pop the value without using it, to avoid sending an unwanted value to the config_class
57         config_defaults.pop("module_name", None)
58 
59     verify_dynamic_loading_support(module_name=module_name)
60 
61     class_name = config.pop("class_name", None)
62     if class_name is None:
63         logger.warning(
64             "Instantiating class from config without an explicit class_name is dangerous. Consider adding "
65             "an explicit class_name for %s" % config.get("name")
66         )
67         try:
68             class_name = config_defaults.pop("class_name")
69         except KeyError:
70             raise KeyError(
71                 "Neither config : {} nor config_defaults : {} contains a class_name key.".format(
72                     config, config_defaults,
73                 )
74             )
75     else:
76         # Pop the value without using it, to avoid sending an unwanted value to the config_class
77         config_defaults.pop("class_name", None)
78 
79     class_ = load_class(class_name=class_name, module_name=module_name)
80 
81     config_with_defaults = copy.deepcopy(config_defaults)
82     config_with_defaults.update(config)
83     if runtime_environment is not None:
84         # If there are additional kwargs available in the runtime_environment requested by a
85         # class to be instantiated, provide them
86         argspec = inspect.getfullargspec(class_.__init__)[0][1:]
87 
88         missing_args = set(argspec) - set(config_with_defaults.keys())
89         config_with_defaults.update(
90             {
91                 missing_arg: runtime_environment[missing_arg]
92                 for missing_arg in missing_args
93                 if missing_arg in runtime_environment
94             }
95         )
96         # Add the entire runtime_environment as well if it's requested
97         if "runtime_environment" in missing_args:
98             config_with_defaults.update({"runtime_environment": runtime_environment})
99 
100     try:
101         class_instance = class_(**config_with_defaults)
102     except TypeError as e:
103         raise TypeError(
104             "Couldn't instantiate class : {} with config : \n\t{}\n \n".format(
105                 class_name, format_dict_for_error_message(config_with_defaults)
106             )
107             + str(e)
108         )
109 
110     return class_instance
111 
112 
113 def format_dict_for_error_message(dict_):
114     # TODO : Tidy this up a bit. Indentation isn't fully consistent.
115 
116     return "\n\t".join("\t\t".join((str(key), str(dict_[key]))) for key in dict_)
117 
118 
119 def substitute_config_variable(template_str, config_variables_dict):
120     """
121     This method takes a string, and if it contains a pattern ${SOME_VARIABLE} or $SOME_VARIABLE,
122     returns a string where the pattern is replaced with the value of SOME_VARIABLE,
123     otherwise returns the string unchanged.
124 
125     If the environment variable SOME_VARIABLE is set, the method uses its value for substitution.
126     If it is not set, the value of SOME_VARIABLE is looked up in the config variables store (file).
127     If it is not found there, the input string is returned as is.
128 
129     :param template_str: a string that might or might not be of the form ${SOME_VARIABLE}
130             or $SOME_VARIABLE
131     :param config_variables_dict: a dictionary of config variables. It is loaded from the
132             config variables store (by default, "uncommitted/config_variables.yml file)
133     :return:
134     """
135     if template_str is None:
136         return template_str
137 
138     try:
139         match = re.search(r"\$\{(.*?)\}", template_str) or re.search(
140             r"\$([_a-z][_a-z0-9]*)", template_str
141         )
142     except TypeError:
143         # If the value is not a string (e.g., a boolean), we should return it as is
144         return template_str
145 
146     if match:
147         config_variable_value = config_variables_dict.get(match.group(1))
148 
149         if config_variable_value:
150             if match.start() == 0 and match.end() == len(template_str):
151                 return config_variable_value
152             else:
153                 return (
154                     template_str[: match.start()]
155                     + config_variable_value
156                     + template_str[match.end() :]
157                 )
158 
159         raise MissingConfigVariableError(
160             f"""\n\nUnable to find a match for config substitution variable: `{match.group(1)}`.
161 Please add this missing variable to your `uncommitted/config_variables.yml` file or your environment variables.
162 See https://great-expectations.readthedocs.io/en/latest/reference/data_context_reference.html#managing-environment-and-secrets""",
163             missing_config_variable=match.group(1),
164         )
165 
166     return template_str
167 
168 
169 def substitute_all_config_variables(data, replace_variables_dict):
170     """
171     Substitute all config variables of the form ${SOME_VARIABLE} in a dictionary-like
172     config object for their values.
173 
174     The method traverses the dictionary recursively.
175 
176     :param data:
177     :param replace_variables_dict:
178     :return: a dictionary with all the variables replaced with their values
179     """
180     if isinstance(data, DataContextConfig):
181         data = DataContextConfigSchema().dump(data)
182 
183     if isinstance(data, dict) or isinstance(data, OrderedDict):
184         return {
185             k: substitute_all_config_variables(v, replace_variables_dict)
186             for k, v in data.items()
187         }
188     elif isinstance(data, list):
189         return [
190             substitute_all_config_variables(v, replace_variables_dict) for v in data
191         ]
192     return substitute_config_variable(data, replace_variables_dict)
193 
194 
195 def file_relative_path(dunderfile, relative_path):
196     """
197     This function is useful when one needs to load a file that is
198     relative to the position of the current file. (Such as when
199     you encode a configuration file path in source file and want
200     in runnable in any current working directory)
201 
202     It is meant to be used like the following:
203     file_relative_path(__file__, 'path/relative/to/file')
204 
205     H/T https://github.com/dagster-io/dagster/blob/8a250e9619a49e8bff8e9aa7435df89c2d2ea039/python_modules/dagster/dagster/utils/__init__.py#L34
206     """
207     return os.path.join(os.path.dirname(dunderfile), relative_path)
208
```
--- 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/data_context/util.py b/great_expectations/data_context/util.py
--- a/great_expectations/data_context/util.py
+++ b/great_expectations/data_context/util.py
@@ -146,7 +146,7 @@
     if match:
         config_variable_value = config_variables_dict.get(match.group(1))
 
-        if config_variable_value:
+        if config_variable_value is not None:
             if match.start() == 0 and match.end() == len(template_str):
                 return config_variable_value
             else:

{"golden_diff": "diff --git a/great_expectations/data_context/util.py b/great_expectations/data_context/util.py\n--- a/great_expectations/data_context/util.py\n+++ b/great_expectations/data_context/util.py\n@@ -146,7 +146,7 @@\n     if match:\n         config_variable_value = config_variables_dict.get(match.group(1))\n \n-        if config_variable_value:\n+        if config_variable_value is not None:\n             if match.start() == 0 and match.end() == len(template_str):\n                 return config_variable_value\n             else:\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": "import copy\nimport importlib\nimport inspect\nimport logging\nimport os\nimport re\nfrom collections import OrderedDict\n\nfrom great_expectations.data_context.types.base import (\n    DataContextConfig,\n    DataContextConfigSchema,\n)\nfrom great_expectations.exceptions import (\n    MissingConfigVariableError,\n    PluginClassNotFoundError,\n    PluginModuleNotFoundError,\n)\nfrom great_expectations.util import verify_dynamic_loading_support\n\nlogger = logging.getLogger(__name__)\n\n\ndef load_class(class_name, module_name):\n    \"\"\"Dynamically load a class from strings or raise a helpful error.\"\"\"\n    try:\n        loaded_module = importlib.import_module(module_name)\n        class_ = getattr(loaded_module, class_name)\n    except ModuleNotFoundError:\n        raise PluginModuleNotFoundError(module_name)\n    except AttributeError:\n        raise PluginClassNotFoundError(module_name=module_name, class_name=class_name)\n    return class_\n\n\n# TODO: Rename config to constructor_kwargs and config_defaults -> constructor_kwarg_default\n# TODO: Improve error messages in this method. Since so much of our workflow is config-driven, this will be a *super* important part of DX.\ndef instantiate_class_from_config(config, runtime_environment, config_defaults=None):\n    \"\"\"Build a GE class from configuration dictionaries.\"\"\"\n\n    if config_defaults is None:\n        config_defaults = {}\n\n    config = copy.deepcopy(config)\n\n    module_name = config.pop(\"module_name\", None)\n    if module_name is None:\n        try:\n            module_name = config_defaults.pop(\"module_name\")\n        except KeyError:\n            raise KeyError(\n                \"Neither config : {} nor config_defaults : {} contains a module_name key.\".format(\n                    config, config_defaults,\n                )\n            )\n    else:\n        # Pop the value without using it, to avoid sending an unwanted value to the config_class\n        config_defaults.pop(\"module_name\", None)\n\n    verify_dynamic_loading_support(module_name=module_name)\n\n    class_name = config.pop(\"class_name\", None)\n    if class_name is None:\n        logger.warning(\n            \"Instantiating class from config without an explicit class_name is dangerous. Consider adding \"\n            \"an explicit class_name for %s\" % config.get(\"name\")\n        )\n        try:\n            class_name = config_defaults.pop(\"class_name\")\n        except KeyError:\n            raise KeyError(\n                \"Neither config : {} nor config_defaults : {} contains a class_name key.\".format(\n                    config, config_defaults,\n                )\n            )\n    else:\n        # Pop the value without using it, to avoid sending an unwanted value to the config_class\n        config_defaults.pop(\"class_name\", None)\n\n    class_ = load_class(class_name=class_name, module_name=module_name)\n\n    config_with_defaults = copy.deepcopy(config_defaults)\n    config_with_defaults.update(config)\n    if runtime_environment is not None:\n        # If there are additional kwargs available in the runtime_environment requested by a\n        # class to be instantiated, provide them\n        argspec = inspect.getfullargspec(class_.__init__)[0][1:]\n\n        missing_args = set(argspec) - set(config_with_defaults.keys())\n        config_with_defaults.update(\n            {\n                missing_arg: runtime_environment[missing_arg]\n                for missing_arg in missing_args\n                if missing_arg in runtime_environment\n            }\n        )\n        # Add the entire runtime_environment as well if it's requested\n        if \"runtime_environment\" in missing_args:\n            config_with_defaults.update({\"runtime_environment\": runtime_environment})\n\n    try:\n        class_instance = class_(**config_with_defaults)\n    except TypeError as e:\n        raise TypeError(\n            \"Couldn't instantiate class : {} with config : \\n\\t{}\\n \\n\".format(\n                class_name, format_dict_for_error_message(config_with_defaults)\n            )\n            + str(e)\n        )\n\n    return class_instance\n\n\ndef format_dict_for_error_message(dict_):\n    # TODO : Tidy this up a bit. Indentation isn't fully consistent.\n\n    return \"\\n\\t\".join(\"\\t\\t\".join((str(key), str(dict_[key]))) for key in dict_)\n\n\ndef substitute_config_variable(template_str, config_variables_dict):\n    \"\"\"\n    This method takes a string, and if it contains a pattern ${SOME_VARIABLE} or $SOME_VARIABLE,\n    returns a string where the pattern is replaced with the value of SOME_VARIABLE,\n    otherwise returns the string unchanged.\n\n    If the environment variable SOME_VARIABLE is set, the method uses its value for substitution.\n    If it is not set, the value of SOME_VARIABLE is looked up in the config variables store (file).\n    If it is not found there, the input string is returned as is.\n\n    :param template_str: a string that might or might not be of the form ${SOME_VARIABLE}\n            or $SOME_VARIABLE\n    :param config_variables_dict: a dictionary of config variables. It is loaded from the\n            config variables store (by default, \"uncommitted/config_variables.yml file)\n    :return:\n    \"\"\"\n    if template_str is None:\n        return template_str\n\n    try:\n        match = re.search(r\"\\$\\{(.*?)\\}\", template_str) or re.search(\n            r\"\\$([_a-z][_a-z0-9]*)\", template_str\n        )\n    except TypeError:\n        # If the value is not a string (e.g., a boolean), we should return it as is\n        return template_str\n\n    if match:\n        config_variable_value = config_variables_dict.get(match.group(1))\n\n        if config_variable_value:\n            if match.start() == 0 and match.end() == len(template_str):\n                return config_variable_value\n            else:\n                return (\n                    template_str[: match.start()]\n                    + config_variable_value\n                    + template_str[match.end() :]\n                )\n\n        raise MissingConfigVariableError(\n            f\"\"\"\\n\\nUnable to find a match for config substitution variable: `{match.group(1)}`.\nPlease add this missing variable to your `uncommitted/config_variables.yml` file or your environment variables.\nSee https://great-expectations.readthedocs.io/en/latest/reference/data_context_reference.html#managing-environment-and-secrets\"\"\",\n            missing_config_variable=match.group(1),\n        )\n\n    return template_str\n\n\ndef substitute_all_config_variables(data, replace_variables_dict):\n    \"\"\"\n    Substitute all config variables of the form ${SOME_VARIABLE} in a dictionary-like\n    config object for their values.\n\n    The method traverses the dictionary recursively.\n\n    :param data:\n    :param replace_variables_dict:\n    :return: a dictionary with all the variables replaced with their values\n    \"\"\"\n    if isinstance(data, DataContextConfig):\n        data = DataContextConfigSchema().dump(data)\n\n    if isinstance(data, dict) or isinstance(data, OrderedDict):\n        return {\n            k: substitute_all_config_variables(v, replace_variables_dict)\n            for k, v in data.items()\n        }\n    elif isinstance(data, list):\n        return [\n            substitute_all_config_variables(v, replace_variables_dict) for v in data\n        ]\n    return substitute_config_variable(data, replace_variables_dict)\n\n\ndef file_relative_path(dunderfile, relative_path):\n    \"\"\"\n    This function is useful when one needs to load a file that is\n    relative to the position of the current file. (Such as when\n    you encode a configuration file path in source file and want\n    in runnable in any current working directory)\n\n    It is meant to be used like the following:\n    file_relative_path(__file__, 'path/relative/to/file')\n\n    H/T https://github.com/dagster-io/dagster/blob/8a250e9619a49e8bff8e9aa7435df89c2d2ea039/python_modules/dagster/dagster/utils/__init__.py#L34\n    \"\"\"\n    return os.path.join(os.path.dirname(dunderfile), relative_path)\n", "path": "great_expectations/data_context/util.py"}], "after_files": [{"content": "import copy\nimport importlib\nimport inspect\nimport logging\nimport os\nimport re\nfrom collections import OrderedDict\n\nfrom great_expectations.data_context.types.base import (\n    DataContextConfig,\n    DataContextConfigSchema,\n)\nfrom great_expectations.exceptions import (\n    MissingConfigVariableError,\n    PluginClassNotFoundError,\n    PluginModuleNotFoundError,\n)\nfrom great_expectations.util import verify_dynamic_loading_support\n\nlogger = logging.getLogger(__name__)\n\n\ndef load_class(class_name, module_name):\n    \"\"\"Dynamically load a class from strings or raise a helpful error.\"\"\"\n    try:\n        loaded_module = importlib.import_module(module_name)\n        class_ = getattr(loaded_module, class_name)\n    except ModuleNotFoundError:\n        raise PluginModuleNotFoundError(module_name)\n    except AttributeError:\n        raise PluginClassNotFoundError(module_name=module_name, class_name=class_name)\n    return class_\n\n\n# TODO: Rename config to constructor_kwargs and config_defaults -> constructor_kwarg_default\n# TODO: Improve error messages in this method. Since so much of our workflow is config-driven, this will be a *super* important part of DX.\ndef instantiate_class_from_config(config, runtime_environment, config_defaults=None):\n    \"\"\"Build a GE class from configuration dictionaries.\"\"\"\n\n    if config_defaults is None:\n        config_defaults = {}\n\n    config = copy.deepcopy(config)\n\n    module_name = config.pop(\"module_name\", None)\n    if module_name is None:\n        try:\n            module_name = config_defaults.pop(\"module_name\")\n        except KeyError:\n            raise KeyError(\n                \"Neither config : {} nor config_defaults : {} contains a module_name key.\".format(\n                    config, config_defaults,\n                )\n            )\n    else:\n        # Pop the value without using it, to avoid sending an unwanted value to the config_class\n        config_defaults.pop(\"module_name\", None)\n\n    verify_dynamic_loading_support(module_name=module_name)\n\n    class_name = config.pop(\"class_name\", None)\n    if class_name is None:\n        logger.warning(\n            \"Instantiating class from config without an explicit class_name is dangerous. Consider adding \"\n            \"an explicit class_name for %s\" % config.get(\"name\")\n        )\n        try:\n            class_name = config_defaults.pop(\"class_name\")\n        except KeyError:\n            raise KeyError(\n                \"Neither config : {} nor config_defaults : {} contains a class_name key.\".format(\n                    config, config_defaults,\n                )\n            )\n    else:\n        # Pop the value without using it, to avoid sending an unwanted value to the config_class\n        config_defaults.pop(\"class_name\", None)\n\n    class_ = load_class(class_name=class_name, module_name=module_name)\n\n    config_with_defaults = copy.deepcopy(config_defaults)\n    config_with_defaults.update(config)\n    if runtime_environment is not None:\n        # If there are additional kwargs available in the runtime_environment requested by a\n        # class to be instantiated, provide them\n        argspec = inspect.getfullargspec(class_.__init__)[0][1:]\n\n        missing_args = set(argspec) - set(config_with_defaults.keys())\n        config_with_defaults.update(\n            {\n                missing_arg: runtime_environment[missing_arg]\n                for missing_arg in missing_args\n                if missing_arg in runtime_environment\n            }\n        )\n        # Add the entire runtime_environment as well if it's requested\n        if \"runtime_environment\" in missing_args:\n            config_with_defaults.update({\"runtime_environment\": runtime_environment})\n\n    try:\n        class_instance = class_(**config_with_defaults)\n    except TypeError as e:\n        raise TypeError(\n            \"Couldn't instantiate class : {} with config : \\n\\t{}\\n \\n\".format(\n                class_name, format_dict_for_error_message(config_with_defaults)\n            )\n            + str(e)\n        )\n\n    return class_instance\n\n\ndef format_dict_for_error_message(dict_):\n    # TODO : Tidy this up a bit. Indentation isn't fully consistent.\n\n    return \"\\n\\t\".join(\"\\t\\t\".join((str(key), str(dict_[key]))) for key in dict_)\n\n\ndef substitute_config_variable(template_str, config_variables_dict):\n    \"\"\"\n    This method takes a string, and if it contains a pattern ${SOME_VARIABLE} or $SOME_VARIABLE,\n    returns a string where the pattern is replaced with the value of SOME_VARIABLE,\n    otherwise returns the string unchanged.\n\n    If the environment variable SOME_VARIABLE is set, the method uses its value for substitution.\n    If it is not set, the value of SOME_VARIABLE is looked up in the config variables store (file).\n    If it is not found there, the input string is returned as is.\n\n    :param template_str: a string that might or might not be of the form ${SOME_VARIABLE}\n            or $SOME_VARIABLE\n    :param config_variables_dict: a dictionary of config variables. It is loaded from the\n            config variables store (by default, \"uncommitted/config_variables.yml file)\n    :return:\n    \"\"\"\n    if template_str is None:\n        return template_str\n\n    try:\n        match = re.search(r\"\\$\\{(.*?)\\}\", template_str) or re.search(\n            r\"\\$([_a-z][_a-z0-9]*)\", template_str\n        )\n    except TypeError:\n        # If the value is not a string (e.g., a boolean), we should return it as is\n        return template_str\n\n    if match:\n        config_variable_value = config_variables_dict.get(match.group(1))\n\n        if config_variable_value is not None:\n            if match.start() == 0 and match.end() == len(template_str):\n                return config_variable_value\n            else:\n                return (\n                    template_str[: match.start()]\n                    + config_variable_value\n                    + template_str[match.end() :]\n                )\n\n        raise MissingConfigVariableError(\n            f\"\"\"\\n\\nUnable to find a match for config substitution variable: `{match.group(1)}`.\nPlease add this missing variable to your `uncommitted/config_variables.yml` file or your environment variables.\nSee https://great-expectations.readthedocs.io/en/latest/reference/data_context_reference.html#managing-environment-and-secrets\"\"\",\n            missing_config_variable=match.group(1),\n        )\n\n    return template_str\n\n\ndef substitute_all_config_variables(data, replace_variables_dict):\n    \"\"\"\n    Substitute all config variables of the form ${SOME_VARIABLE} in a dictionary-like\n    config object for their values.\n\n    The method traverses the dictionary recursively.\n\n    :param data:\n    :param replace_variables_dict:\n    :return: a dictionary with all the variables replaced with their values\n    \"\"\"\n    if isinstance(data, DataContextConfig):\n        data = DataContextConfigSchema().dump(data)\n\n    if isinstance(data, dict) or isinstance(data, OrderedDict):\n        return {\n            k: substitute_all_config_variables(v, replace_variables_dict)\n            for k, v in data.items()\n        }\n    elif isinstance(data, list):\n        return [\n            substitute_all_config_variables(v, replace_variables_dict) for v in data\n        ]\n    return substitute_config_variable(data, replace_variables_dict)\n\n\ndef file_relative_path(dunderfile, relative_path):\n    \"\"\"\n    This function is useful when one needs to load a file that is\n    relative to the position of the current file. (Such as when\n    you encode a configuration file path in source file and want\n    in runnable in any current working directory)\n\n    It is meant to be used like the following:\n    file_relative_path(__file__, 'path/relative/to/file')\n\n    H/T https://github.com/dagster-io/dagster/blob/8a250e9619a49e8bff8e9aa7435df89c2d2ea039/python_modules/dagster/dagster/utils/__init__.py#L34\n    \"\"\"\n    return os.path.join(os.path.dirname(dunderfile), relative_path)\n", "path": "great_expectations/data_context/util.py"}]}