We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Mergesort Update Variable Names
I was looking over the mergesort.py file in the divide_and_conquer directory when I saw that all of the variable names are a single letter and there is not much documentation. Does anyone know enough about this file to improve the variable names and make the code more understandable?

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `divide_and_conquer/mergesort.py`
Content:
```
1 def merge(a, b, m, e):
2     l = a[b : m + 1]  # noqa: E741
3     r = a[m + 1 : e + 1]
4     k = b
5     i = 0
6     j = 0
7     while i < len(l) and j < len(r):
8         # change sign for Descending order
9         if l[i] < r[j]:
10             a[k] = l[i]
11             i += 1
12         else:
13             a[k] = r[j]
14             j += 1
15         k += 1
16     while i < len(l):
17         a[k] = l[i]
18         i += 1
19         k += 1
20     while j < len(r):
21         a[k] = r[j]
22         j += 1
23         k += 1
24     return a
25 
26 
27 def mergesort(a, b, e):
28     """
29     >>> mergesort([3,2,1],0,2)
30     [1, 2, 3]
31     >>> mergesort([3,2,1,0,1,2,3,5,4],0,8)
32     [0, 1, 1, 2, 2, 3, 3, 4, 5]
33     """
34     if b < e:
35         m = (b + e) // 2
36         # print("ms1",a,b,m)
37         mergesort(a, b, m)
38         # print("ms2",a,m+1,e)
39         mergesort(a, m + 1, e)
40         # print("m",a,b,m,e)
41         merge(a, b, m, e)
42         return a
43 
44 
45 if __name__ == "__main__":
46     import doctest
47 
48     doctest.testmod()
49
```
--- 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/divide_and_conquer/mergesort.py b/divide_and_conquer/mergesort.py
--- a/divide_and_conquer/mergesort.py
+++ b/divide_and_conquer/mergesort.py
@@ -1,45 +1,48 @@
-def merge(a, b, m, e):
-    l = a[b : m + 1]  # noqa: E741
-    r = a[m + 1 : e + 1]
-    k = b
+def merge(arr, left, mid, right):
+    # overall array will divided into 2 array
+    # left_arr contains the left portion of array from left to mid
+    # right_arr contains the right portion of array from mid + 1 to right
+    left_arr = arr[left : mid + 1]
+    right_arr = arr[mid + 1 : right + 1]
+    k = left
     i = 0
     j = 0
-    while i < len(l) and j < len(r):
+    while i < len(left_arr) and j < len(right_arr):
         # change sign for Descending order
-        if l[i] < r[j]:
-            a[k] = l[i]
+        if left_arr[i] < right_arr[j]:
+            arr[k] = left_arr[i]
             i += 1
         else:
-            a[k] = r[j]
+            arr[k] = right_arr[j]
             j += 1
         k += 1
-    while i < len(l):
-        a[k] = l[i]
+    while i < len(left_arr):
+        arr[k] = left_arr[i]
         i += 1
         k += 1
-    while j < len(r):
-        a[k] = r[j]
+    while j < len(right_arr):
+        arr[k] = right_arr[j]
         j += 1
         k += 1
-    return a
+    return arr
 
 
-def mergesort(a, b, e):
+def mergesort(arr, left, right):
     """
-    >>> mergesort([3,2,1],0,2)
+    >>> mergesort([3, 2, 1], 0, 2)
     [1, 2, 3]
-    >>> mergesort([3,2,1,0,1,2,3,5,4],0,8)
+    >>> mergesort([3, 2, 1, 0, 1, 2, 3, 5, 4], 0, 8)
     [0, 1, 1, 2, 2, 3, 3, 4, 5]
     """
-    if b < e:
-        m = (b + e) // 2
+    if left < right:
+        mid = (left + right) // 2
         # print("ms1",a,b,m)
-        mergesort(a, b, m)
+        mergesort(arr, left, mid)
         # print("ms2",a,m+1,e)
-        mergesort(a, m + 1, e)
+        mergesort(arr, mid + 1, right)
         # print("m",a,b,m,e)
-        merge(a, b, m, e)
-        return a
+        merge(arr, left, mid, right)
+        return arr
 
 
 if __name__ == "__main__":

{"golden_diff": "diff --git a/divide_and_conquer/mergesort.py b/divide_and_conquer/mergesort.py\n--- a/divide_and_conquer/mergesort.py\n+++ b/divide_and_conquer/mergesort.py\n@@ -1,45 +1,48 @@\n-def merge(a, b, m, e):\n-    l = a[b : m + 1]  # noqa: E741\n-    r = a[m + 1 : e + 1]\n-    k = b\n+def merge(arr, left, mid, right):\n+    # overall array will divided into 2 array\n+    # left_arr contains the left portion of array from left to mid\n+    # right_arr contains the right portion of array from mid + 1 to right\n+    left_arr = arr[left : mid + 1]\n+    right_arr = arr[mid + 1 : right + 1]\n+    k = left\n     i = 0\n     j = 0\n-    while i < len(l) and j < len(r):\n+    while i < len(left_arr) and j < len(right_arr):\n         # change sign for Descending order\n-        if l[i] < r[j]:\n-            a[k] = l[i]\n+        if left_arr[i] < right_arr[j]:\n+            arr[k] = left_arr[i]\n             i += 1\n         else:\n-            a[k] = r[j]\n+            arr[k] = right_arr[j]\n             j += 1\n         k += 1\n-    while i < len(l):\n-        a[k] = l[i]\n+    while i < len(left_arr):\n+        arr[k] = left_arr[i]\n         i += 1\n         k += 1\n-    while j < len(r):\n-        a[k] = r[j]\n+    while j < len(right_arr):\n+        arr[k] = right_arr[j]\n         j += 1\n         k += 1\n-    return a\n+    return arr\n \n \n-def mergesort(a, b, e):\n+def mergesort(arr, left, right):\n     \"\"\"\n-    >>> mergesort([3,2,1],0,2)\n+    >>> mergesort([3, 2, 1], 0, 2)\n     [1, 2, 3]\n-    >>> mergesort([3,2,1,0,1,2,3,5,4],0,8)\n+    >>> mergesort([3, 2, 1, 0, 1, 2, 3, 5, 4], 0, 8)\n     [0, 1, 1, 2, 2, 3, 3, 4, 5]\n     \"\"\"\n-    if b < e:\n-        m = (b + e) // 2\n+    if left < right:\n+        mid = (left + right) // 2\n         # print(\"ms1\",a,b,m)\n-        mergesort(a, b, m)\n+        mergesort(arr, left, mid)\n         # print(\"ms2\",a,m+1,e)\n-        mergesort(a, m + 1, e)\n+        mergesort(arr, mid + 1, right)\n         # print(\"m\",a,b,m,e)\n-        merge(a, b, m, e)\n-        return a\n+        merge(arr, left, mid, right)\n+        return arr\n \n \n if __name__ == \"__main__\":\n", "issue": "Mergesort Update Variable Names\nI was looking over the mergesort.py file in the divide_and_conquer directory when I saw that all of the variable names are a single letter and there is not much documentation. Does anyone know enough about this file to improve the variable names and make the code more understandable?\n", "before_files": [{"content": "def merge(a, b, m, e):\n    l = a[b : m + 1]  # noqa: E741\n    r = a[m + 1 : e + 1]\n    k = b\n    i = 0\n    j = 0\n    while i < len(l) and j < len(r):\n        # change sign for Descending order\n        if l[i] < r[j]:\n            a[k] = l[i]\n            i += 1\n        else:\n            a[k] = r[j]\n            j += 1\n        k += 1\n    while i < len(l):\n        a[k] = l[i]\n        i += 1\n        k += 1\n    while j < len(r):\n        a[k] = r[j]\n        j += 1\n        k += 1\n    return a\n\n\ndef mergesort(a, b, e):\n    \"\"\"\n    >>> mergesort([3,2,1],0,2)\n    [1, 2, 3]\n    >>> mergesort([3,2,1,0,1,2,3,5,4],0,8)\n    [0, 1, 1, 2, 2, 3, 3, 4, 5]\n    \"\"\"\n    if b < e:\n        m = (b + e) // 2\n        # print(\"ms1\",a,b,m)\n        mergesort(a, b, m)\n        # print(\"ms2\",a,m+1,e)\n        mergesort(a, m + 1, e)\n        # print(\"m\",a,b,m,e)\n        merge(a, b, m, e)\n        return a\n\n\nif __name__ == \"__main__\":\n    import doctest\n\n    doctest.testmod()\n", "path": "divide_and_conquer/mergesort.py"}], "after_files": [{"content": "def merge(arr, left, mid, right):\n    # overall array will divided into 2 array\n    # left_arr contains the left portion of array from left to mid\n    # right_arr contains the right portion of array from mid + 1 to right\n    left_arr = arr[left : mid + 1]\n    right_arr = arr[mid + 1 : right + 1]\n    k = left\n    i = 0\n    j = 0\n    while i < len(left_arr) and j < len(right_arr):\n        # change sign for Descending order\n        if left_arr[i] < right_arr[j]:\n            arr[k] = left_arr[i]\n            i += 1\n        else:\n            arr[k] = right_arr[j]\n            j += 1\n        k += 1\n    while i < len(left_arr):\n        arr[k] = left_arr[i]\n        i += 1\n        k += 1\n    while j < len(right_arr):\n        arr[k] = right_arr[j]\n        j += 1\n        k += 1\n    return arr\n\n\ndef mergesort(arr, left, right):\n    \"\"\"\n    >>> mergesort([3, 2, 1], 0, 2)\n    [1, 2, 3]\n    >>> mergesort([3, 2, 1, 0, 1, 2, 3, 5, 4], 0, 8)\n    [0, 1, 1, 2, 2, 3, 3, 4, 5]\n    \"\"\"\n    if left < right:\n        mid = (left + right) // 2\n        # print(\"ms1\",a,b,m)\n        mergesort(arr, left, mid)\n        # print(\"ms2\",a,m+1,e)\n        mergesort(arr, mid + 1, right)\n        # print(\"m\",a,b,m,e)\n        merge(arr, left, mid, right)\n        return arr\n\n\nif __name__ == \"__main__\":\n    import doctest\n\n    doctest.testmod()\n", "path": "divide_and_conquer/mergesort.py"}]}