prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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).
  
  </issue>
  <code>
  [start of mlflow/exceptions.py]
  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 of mlflow/exceptions.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: 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"""
  
verification_info: {"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"}]}