We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add `MlflowException.invalid_parameter_value`
## Motivation

We frequently construct an `MlflowException` instance with `error_code=INVALID_PARAMETER_VALUE`:


```python
import mlflow.exceptions from MlflowException
from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE

raise MlflowException(
    "error message",
    error_code=INVALID_PARAMETER_VALUE,
)
```

If we had a class method `invalid_parameter_value`:

```python
class MlflowException(...):
    @classmethod
    def invalid_parameter_value(cls, message, **kwargs):
        return cls(message, error_code=INVALID_PARAMETER_VALUE, **kwargs)
```

we could simplify the code above to:

```python
import mlflow.exceptions from MlflowException

raise MlflowException.invalid_parameter_value("error message")
```

which is shorter and has fewer import statements.

## Notes

- We don't need to replace existing `MlflowException("error message",error_code=INVALID_PARAMETER_VALUE)` for now (we may in the future).

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mlflow/exceptions.py`
Content:
```
1 import json
2 
3 from mlflow.protos.databricks_pb2 import (
4     INTERNAL_ERROR,
5     TEMPORARILY_UNAVAILABLE,
6     ENDPOINT_NOT_FOUND,
7     PERMISSION_DENIED,
8     REQUEST_LIMIT_EXCEEDED,
9     BAD_REQUEST,
10     INVALID_PARAMETER_VALUE,
11     RESOURCE_DOES_NOT_EXIST,
12     INVALID_STATE,
13     RESOURCE_ALREADY_EXISTS,
14     ErrorCode,
15 )
16 
17 ERROR_CODE_TO_HTTP_STATUS = {
18     ErrorCode.Name(INTERNAL_ERROR): 500,
19     ErrorCode.Name(INVALID_STATE): 500,
20     ErrorCode.Name(TEMPORARILY_UNAVAILABLE): 503,
21     ErrorCode.Name(REQUEST_LIMIT_EXCEEDED): 429,
22     ErrorCode.Name(ENDPOINT_NOT_FOUND): 404,
23     ErrorCode.Name(RESOURCE_DOES_NOT_EXIST): 404,
24     ErrorCode.Name(PERMISSION_DENIED): 403,
25     ErrorCode.Name(BAD_REQUEST): 400,
26     ErrorCode.Name(RESOURCE_ALREADY_EXISTS): 400,
27     ErrorCode.Name(INVALID_PARAMETER_VALUE): 400,
28 }
29 
30 
31 class MlflowException(Exception):
32     """
33     Generic exception thrown to surface failure information about external-facing operations.
34     The error message associated with this exception may be exposed to clients in HTTP responses
35     for debugging purposes. If the error text is sensitive, raise a generic `Exception` object
36     instead.
37     """
38 
39     def __init__(self, message, error_code=INTERNAL_ERROR, **kwargs):
40         """
41         :param message: The message describing the error that occured. This will be included in the
42                         exception's serialized JSON representation.
43         :param error_code: An appropriate error code for the error that occured; it will be included
44                            in the exception's serialized JSON representation. This should be one of
45                            the codes listed in the `mlflow.protos.databricks_pb2` proto.
46         :param kwargs: Additional key-value pairs to include in the serialized JSON representation
47                        of the MlflowException.
48         """
49         try:
50             self.error_code = ErrorCode.Name(error_code)
51         except (ValueError, TypeError):
52             self.error_code = ErrorCode.Name(INTERNAL_ERROR)
53         self.message = message
54         self.json_kwargs = kwargs
55         super().__init__(message)
56 
57     def serialize_as_json(self):
58         exception_dict = {"error_code": self.error_code, "message": self.message}
59         exception_dict.update(self.json_kwargs)
60         return json.dumps(exception_dict)
61 
62     def get_http_status_code(self):
63         return ERROR_CODE_TO_HTTP_STATUS.get(self.error_code, 500)
64 
65 
66 class RestException(MlflowException):
67     """Exception thrown on non 200-level responses from the REST API"""
68 
69     def __init__(self, json):
70         error_code = json.get("error_code", ErrorCode.Name(INTERNAL_ERROR))
71         message = "%s: %s" % (
72             error_code,
73             json["message"] if "message" in json else "Response: " + str(json),
74         )
75         super().__init__(message, error_code=ErrorCode.Value(error_code))
76         self.json = json
77 
78 
79 class ExecutionException(MlflowException):
80     """Exception thrown when executing a project fails"""
81 
82     pass
83 
84 
85 class MissingConfigException(MlflowException):
86     """Exception thrown when expected configuration file/directory not found"""
87 
88     pass
89
```
--- 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/mlflow/exceptions.py b/mlflow/exceptions.py
--- a/mlflow/exceptions.py
+++ b/mlflow/exceptions.py
@@ -62,6 +62,18 @@
     def get_http_status_code(self):
         return ERROR_CODE_TO_HTTP_STATUS.get(self.error_code, 500)
 
+    @classmethod
+    def invalid_parameter_value(cls, message, **kwargs):
+        """
+        Constructs an `MlflowException` object with the `INVALID_PARAMETER_VALUE` error code.
+
+        :param message: The message describing the error that occured. This will be included in the
+                        exception's serialized JSON representation.
+        :param kwargs: Additional key-value pairs to include in the serialized JSON representation
+                       of the MlflowException.
+        """
+        return cls(message, error_code=INVALID_PARAMETER_VALUE, **kwargs)
+
 
 class RestException(MlflowException):
     """Exception thrown on non 200-level responses from the REST API"""

{"golden_diff": "diff --git a/mlflow/exceptions.py b/mlflow/exceptions.py\n--- a/mlflow/exceptions.py\n+++ b/mlflow/exceptions.py\n@@ -62,6 +62,18 @@\n     def get_http_status_code(self):\n         return ERROR_CODE_TO_HTTP_STATUS.get(self.error_code, 500)\n \n+    @classmethod\n+    def invalid_parameter_value(cls, message, **kwargs):\n+        \"\"\"\n+        Constructs an `MlflowException` object with the `INVALID_PARAMETER_VALUE` error code.\n+\n+        :param message: The message describing the error that occured. This will be included in the\n+                        exception's serialized JSON representation.\n+        :param kwargs: Additional key-value pairs to include in the serialized JSON representation\n+                       of the MlflowException.\n+        \"\"\"\n+        return cls(message, error_code=INVALID_PARAMETER_VALUE, **kwargs)\n+\n \n class RestException(MlflowException):\n     \"\"\"Exception thrown on non 200-level responses from the REST API\"\"\"\n", "issue": "Add `MlflowException.invalid_parameter_value`\n## Motivation\r\n\r\nWe frequently construct an `MlflowException` instance with `error_code=INVALID_PARAMETER_VALUE`:\r\n\r\n\r\n```python\r\nimport mlflow.exceptions from MlflowException\r\nfrom mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE\r\n\r\nraise MlflowException(\r\n    \"error message\",\r\n    error_code=INVALID_PARAMETER_VALUE,\r\n)\r\n```\r\n\r\nIf we had a class method `invalid_parameter_value`:\r\n\r\n```python\r\nclass MlflowException(...):\r\n    @classmethod\r\n    def invalid_parameter_value(cls, message, **kwargs):\r\n        return cls(message, error_code=INVALID_PARAMETER_VALUE, **kwargs)\r\n```\r\n\r\nwe could simplify the code above to:\r\n\r\n```python\r\nimport mlflow.exceptions from MlflowException\r\n\r\nraise MlflowException.invalid_parameter_value(\"error message\")\r\n```\r\n\r\nwhich is shorter and has fewer import statements.\r\n\r\n## Notes\r\n\r\n- We don't need to replace existing `MlflowException(\"error message\",error_code=INVALID_PARAMETER_VALUE)` for now (we may in the future).\n", "before_files": [{"content": "import json\n\nfrom mlflow.protos.databricks_pb2 import (\n    INTERNAL_ERROR,\n    TEMPORARILY_UNAVAILABLE,\n    ENDPOINT_NOT_FOUND,\n    PERMISSION_DENIED,\n    REQUEST_LIMIT_EXCEEDED,\n    BAD_REQUEST,\n    INVALID_PARAMETER_VALUE,\n    RESOURCE_DOES_NOT_EXIST,\n    INVALID_STATE,\n    RESOURCE_ALREADY_EXISTS,\n    ErrorCode,\n)\n\nERROR_CODE_TO_HTTP_STATUS = {\n    ErrorCode.Name(INTERNAL_ERROR): 500,\n    ErrorCode.Name(INVALID_STATE): 500,\n    ErrorCode.Name(TEMPORARILY_UNAVAILABLE): 503,\n    ErrorCode.Name(REQUEST_LIMIT_EXCEEDED): 429,\n    ErrorCode.Name(ENDPOINT_NOT_FOUND): 404,\n    ErrorCode.Name(RESOURCE_DOES_NOT_EXIST): 404,\n    ErrorCode.Name(PERMISSION_DENIED): 403,\n    ErrorCode.Name(BAD_REQUEST): 400,\n    ErrorCode.Name(RESOURCE_ALREADY_EXISTS): 400,\n    ErrorCode.Name(INVALID_PARAMETER_VALUE): 400,\n}\n\n\nclass MlflowException(Exception):\n    \"\"\"\n    Generic exception thrown to surface failure information about external-facing operations.\n    The error message associated with this exception may be exposed to clients in HTTP responses\n    for debugging purposes. If the error text is sensitive, raise a generic `Exception` object\n    instead.\n    \"\"\"\n\n    def __init__(self, message, error_code=INTERNAL_ERROR, **kwargs):\n        \"\"\"\n        :param message: The message describing the error that occured. This will be included in the\n                        exception's serialized JSON representation.\n        :param error_code: An appropriate error code for the error that occured; it will be included\n                           in the exception's serialized JSON representation. This should be one of\n                           the codes listed in the `mlflow.protos.databricks_pb2` proto.\n        :param kwargs: Additional key-value pairs to include in the serialized JSON representation\n                       of the MlflowException.\n        \"\"\"\n        try:\n            self.error_code = ErrorCode.Name(error_code)\n        except (ValueError, TypeError):\n            self.error_code = ErrorCode.Name(INTERNAL_ERROR)\n        self.message = message\n        self.json_kwargs = kwargs\n        super().__init__(message)\n\n    def serialize_as_json(self):\n        exception_dict = {\"error_code\": self.error_code, \"message\": self.message}\n        exception_dict.update(self.json_kwargs)\n        return json.dumps(exception_dict)\n\n    def get_http_status_code(self):\n        return ERROR_CODE_TO_HTTP_STATUS.get(self.error_code, 500)\n\n\nclass RestException(MlflowException):\n    \"\"\"Exception thrown on non 200-level responses from the REST API\"\"\"\n\n    def __init__(self, json):\n        error_code = json.get(\"error_code\", ErrorCode.Name(INTERNAL_ERROR))\n        message = \"%s: %s\" % (\n            error_code,\n            json[\"message\"] if \"message\" in json else \"Response: \" + str(json),\n        )\n        super().__init__(message, error_code=ErrorCode.Value(error_code))\n        self.json = json\n\n\nclass ExecutionException(MlflowException):\n    \"\"\"Exception thrown when executing a project fails\"\"\"\n\n    pass\n\n\nclass MissingConfigException(MlflowException):\n    \"\"\"Exception thrown when expected configuration file/directory not found\"\"\"\n\n    pass\n", "path": "mlflow/exceptions.py"}], "after_files": [{"content": "import json\n\nfrom mlflow.protos.databricks_pb2 import (\n    INTERNAL_ERROR,\n    TEMPORARILY_UNAVAILABLE,\n    ENDPOINT_NOT_FOUND,\n    PERMISSION_DENIED,\n    REQUEST_LIMIT_EXCEEDED,\n    BAD_REQUEST,\n    INVALID_PARAMETER_VALUE,\n    RESOURCE_DOES_NOT_EXIST,\n    INVALID_STATE,\n    RESOURCE_ALREADY_EXISTS,\n    ErrorCode,\n)\n\nERROR_CODE_TO_HTTP_STATUS = {\n    ErrorCode.Name(INTERNAL_ERROR): 500,\n    ErrorCode.Name(INVALID_STATE): 500,\n    ErrorCode.Name(TEMPORARILY_UNAVAILABLE): 503,\n    ErrorCode.Name(REQUEST_LIMIT_EXCEEDED): 429,\n    ErrorCode.Name(ENDPOINT_NOT_FOUND): 404,\n    ErrorCode.Name(RESOURCE_DOES_NOT_EXIST): 404,\n    ErrorCode.Name(PERMISSION_DENIED): 403,\n    ErrorCode.Name(BAD_REQUEST): 400,\n    ErrorCode.Name(RESOURCE_ALREADY_EXISTS): 400,\n    ErrorCode.Name(INVALID_PARAMETER_VALUE): 400,\n}\n\n\nclass MlflowException(Exception):\n    \"\"\"\n    Generic exception thrown to surface failure information about external-facing operations.\n    The error message associated with this exception may be exposed to clients in HTTP responses\n    for debugging purposes. If the error text is sensitive, raise a generic `Exception` object\n    instead.\n    \"\"\"\n\n    def __init__(self, message, error_code=INTERNAL_ERROR, **kwargs):\n        \"\"\"\n        :param message: The message describing the error that occured. This will be included in the\n                        exception's serialized JSON representation.\n        :param error_code: An appropriate error code for the error that occured; it will be included\n                           in the exception's serialized JSON representation. This should be one of\n                           the codes listed in the `mlflow.protos.databricks_pb2` proto.\n        :param kwargs: Additional key-value pairs to include in the serialized JSON representation\n                       of the MlflowException.\n        \"\"\"\n        try:\n            self.error_code = ErrorCode.Name(error_code)\n        except (ValueError, TypeError):\n            self.error_code = ErrorCode.Name(INTERNAL_ERROR)\n        self.message = message\n        self.json_kwargs = kwargs\n        super().__init__(message)\n\n    def serialize_as_json(self):\n        exception_dict = {\"error_code\": self.error_code, \"message\": self.message}\n        exception_dict.update(self.json_kwargs)\n        return json.dumps(exception_dict)\n\n    def get_http_status_code(self):\n        return ERROR_CODE_TO_HTTP_STATUS.get(self.error_code, 500)\n\n    @classmethod\n    def invalid_parameter_value(cls, message, **kwargs):\n        \"\"\"\n        Constructs an `MlflowException` object with the `INVALID_PARAMETER_VALUE` error code.\n\n        :param message: The message describing the error that occured. This will be included in the\n                        exception's serialized JSON representation.\n        :param kwargs: Additional key-value pairs to include in the serialized JSON representation\n                       of the MlflowException.\n        \"\"\"\n        return cls(message, error_code=INVALID_PARAMETER_VALUE, **kwargs)\n\n\nclass RestException(MlflowException):\n    \"\"\"Exception thrown on non 200-level responses from the REST API\"\"\"\n\n    def __init__(self, json):\n        error_code = json.get(\"error_code\", ErrorCode.Name(INTERNAL_ERROR))\n        message = \"%s: %s\" % (\n            error_code,\n            json[\"message\"] if \"message\" in json else \"Response: \" + str(json),\n        )\n        super().__init__(message, error_code=ErrorCode.Value(error_code))\n        self.json = json\n\n\nclass ExecutionException(MlflowException):\n    \"\"\"Exception thrown when executing a project fails\"\"\"\n\n    pass\n\n\nclass MissingConfigException(MlflowException):\n    \"\"\"Exception thrown when expected configuration file/directory not found\"\"\"\n\n    pass\n", "path": "mlflow/exceptions.py"}]}