prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Switch to jnius_config.add_classpath
  Currently, pyserini replaces any previously registered jars on the classpath in its setup code. Is there any reason to not use add_classpath() instead of set_classpath()?
  
  Here is the pyjnius relevant code:
  ```python
  def set_classpath(*path):
      """
      Sets the classpath for the JVM to use. Replaces any existing classpath, overriding the CLASSPATH environment variable.
      """
      check_vm_running()
      global classpath
      classpath = list(path)
  
  
  def add_classpath(*path):
      """
      Appends items to the classpath for the JVM to use.
      Replaces any existing classpath, overriding the CLASSPATH environment variable.
      """
      check_vm_running()
      global classpath
      if classpath is None:
          classpath = list(path)
      else:
          classpath.extend(path)
  ```
  
  </issue>
  <code>
  [start of pyserini/setup.py]
  1 #
  2 # Pyserini: Reproducible IR research with sparse and dense representations
  3 #
  4 # Licensed under the Apache License, Version 2.0 (the "License");
  5 # you may not use this file except in compliance with the License.
  6 # You may obtain a copy of the License at
  7 #
  8 # http://www.apache.org/licenses/LICENSE-2.0
  9 #
  10 # Unless required by applicable law or agreed to in writing, software
  11 # distributed under the License is distributed on an "AS IS" BASIS,
  12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 # See the License for the specific language governing permissions and
  14 # limitations under the License.
  15 #
  16 
  17 """
  18 Module for adding Anserini jar to classpath for pyjnius usage
  19 """
  20 
  21 import glob
  22 import os
  23 
  24 import jnius_config
  25 
  26 
  27 def configure_classpath(anserini_root="."):
  28     """
  29     Parameters
  30     ----------
  31     anserini_root : str
  32         (Optional) path to root anserini directory.
  33 
  34     """
  35     paths = glob.glob(os.path.join(anserini_root, 'anserini-*-fatjar.jar'))
  36     if not paths:
  37         raise Exception('No matching jar file found in {}'.format(os.path.abspath(anserini_root)))
  38 
  39     latest = max(paths, key=os.path.getctime)
  40     jnius_config.set_classpath(latest)
  41
  [end of pyserini/setup.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/pyserini/setup.py b/pyserini/setup.py
  --- a/pyserini/setup.py
  +++ b/pyserini/setup.py
  @@ -37,4 +37,4 @@
           raise Exception('No matching jar file found in {}'.format(os.path.abspath(anserini_root)))
   
       latest = max(paths, key=os.path.getctime)
  -    jnius_config.set_classpath(latest)
  +    jnius_config.add_classpath(latest)
  
verification_info: {"golden_diff": "diff --git a/pyserini/setup.py b/pyserini/setup.py\n--- a/pyserini/setup.py\n+++ b/pyserini/setup.py\n@@ -37,4 +37,4 @@\n         raise Exception('No matching jar file found in {}'.format(os.path.abspath(anserini_root)))\n \n     latest = max(paths, key=os.path.getctime)\n-    jnius_config.set_classpath(latest)\n+    jnius_config.add_classpath(latest)\n", "issue": "Switch to jnius_config.add_classpath\nCurrently, pyserini replaces any previously registered jars on the classpath in its setup code. Is there any reason to not use add_classpath() instead of set_classpath()?\r\n\r\nHere is the pyjnius relevant code:\r\n```python\r\ndef set_classpath(*path):\r\n    \"\"\"\r\n    Sets the classpath for the JVM to use. Replaces any existing classpath, overriding the CLASSPATH environment variable.\r\n    \"\"\"\r\n    check_vm_running()\r\n    global classpath\r\n    classpath = list(path)\r\n\r\n\r\ndef add_classpath(*path):\r\n    \"\"\"\r\n    Appends items to the classpath for the JVM to use.\r\n    Replaces any existing classpath, overriding the CLASSPATH environment variable.\r\n    \"\"\"\r\n    check_vm_running()\r\n    global classpath\r\n    if classpath is None:\r\n        classpath = list(path)\r\n    else:\r\n        classpath.extend(path)\r\n```\n", "before_files": [{"content": "#\n# Pyserini: Reproducible IR research with sparse and dense representations\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n\"\"\"\nModule for adding Anserini jar to classpath for pyjnius usage\n\"\"\"\n\nimport glob\nimport os\n\nimport jnius_config\n\n\ndef configure_classpath(anserini_root=\".\"):\n    \"\"\"\n    Parameters\n    ----------\n    anserini_root : str\n        (Optional) path to root anserini directory.\n\n    \"\"\"\n    paths = glob.glob(os.path.join(anserini_root, 'anserini-*-fatjar.jar'))\n    if not paths:\n        raise Exception('No matching jar file found in {}'.format(os.path.abspath(anserini_root)))\n\n    latest = max(paths, key=os.path.getctime)\n    jnius_config.set_classpath(latest)\n", "path": "pyserini/setup.py"}]}