prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Concatenate/consolidate all algorithms with different implementations
  ### Feature description
  
  There are lots of algorithms with the same concept but different implementations/methods in different files. All these should be moved into one file
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `maths/miller_rabin.py`
  Content:
  ```
  1 import random
  2 
  3 from .binary_exp_mod import bin_exp_mod
  4 
  5 
  6 # This is a probabilistic check to test primality, useful for big numbers!
  7 # if it's a prime, it will return true
  8 # if it's not a prime, the chance of it returning true is at most 1/4**prec
  9 def is_prime_big(n, prec=1000):
  10     """
  11     >>> from maths.prime_check import is_prime
  12     >>> # all(is_prime_big(i) == is_prime(i) for i in range(1000))  # 3.45s
  13     >>> all(is_prime_big(i) == is_prime(i) for i in range(256))
  14     True
  15     """
  16     if n < 2:
  17         return False
  18 
  19     if n % 2 == 0:
  20         return n == 2
  21 
  22     # this means n is odd
  23     d = n - 1
  24     exp = 0
  25     while d % 2 == 0:
  26         d /= 2
  27         exp += 1
  28 
  29     # n - 1=d*(2**exp)
  30     count = 0
  31     while count < prec:
  32         a = random.randint(2, n - 1)
  33         b = bin_exp_mod(a, d, n)
  34         if b != 1:
  35             flag = True
  36             for _ in range(exp):
  37                 if b == n - 1:
  38                     flag = False
  39                     break
  40                 b = b * b
  41                 b %= n
  42             if flag:
  43                 return False
  44             count += 1
  45     return True
  46 
  47 
  48 if __name__ == "__main__":
  49     n = abs(int(input("Enter bound : ").strip()))
  50     print("Here's the list of primes:")
  51     print(", ".join(str(i) for i in range(n + 1) if is_prime_big(i)))
  52
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/maths/miller_rabin.py b/maths/miller_rabin.py
  deleted file mode 100644
  --- a/maths/miller_rabin.py
  +++ /dev/null
  @@ -1,51 +0,0 @@
  -import random
  -
  -from .binary_exp_mod import bin_exp_mod
  -
  -
  -# This is a probabilistic check to test primality, useful for big numbers!
  -# if it's a prime, it will return true
  -# if it's not a prime, the chance of it returning true is at most 1/4**prec
  -def is_prime_big(n, prec=1000):
  -    """
  -    >>> from maths.prime_check import is_prime
  -    >>> # all(is_prime_big(i) == is_prime(i) for i in range(1000))  # 3.45s
  -    >>> all(is_prime_big(i) == is_prime(i) for i in range(256))
  -    True
  -    """
  -    if n < 2:
  -        return False
  -
  -    if n % 2 == 0:
  -        return n == 2
  -
  -    # this means n is odd
  -    d = n - 1
  -    exp = 0
  -    while d % 2 == 0:
  -        d /= 2
  -        exp += 1
  -
  -    # n - 1=d*(2**exp)
  -    count = 0
  -    while count < prec:
  -        a = random.randint(2, n - 1)
  -        b = bin_exp_mod(a, d, n)
  -        if b != 1:
  -            flag = True
  -            for _ in range(exp):
  -                if b == n - 1:
  -                    flag = False
  -                    break
  -                b = b * b
  -                b %= n
  -            if flag:
  -                return False
  -            count += 1
  -    return True
  -
  -
  -if __name__ == "__main__":
  -    n = abs(int(input("Enter bound : ").strip()))
  -    print("Here's the list of primes:")
  -    print(", ".join(str(i) for i in range(n + 1) if is_prime_big(i)))
  
verification_info: {"golden_diff": "diff --git a/maths/miller_rabin.py b/maths/miller_rabin.py\ndeleted file mode 100644\n--- a/maths/miller_rabin.py\n+++ /dev/null\n@@ -1,51 +0,0 @@\n-import random\n-\n-from .binary_exp_mod import bin_exp_mod\n-\n-\n-# This is a probabilistic check to test primality, useful for big numbers!\n-# if it's a prime, it will return true\n-# if it's not a prime, the chance of it returning true is at most 1/4**prec\n-def is_prime_big(n, prec=1000):\n-    \"\"\"\n-    >>> from maths.prime_check import is_prime\n-    >>> # all(is_prime_big(i) == is_prime(i) for i in range(1000))  # 3.45s\n-    >>> all(is_prime_big(i) == is_prime(i) for i in range(256))\n-    True\n-    \"\"\"\n-    if n < 2:\n-        return False\n-\n-    if n % 2 == 0:\n-        return n == 2\n-\n-    # this means n is odd\n-    d = n - 1\n-    exp = 0\n-    while d % 2 == 0:\n-        d /= 2\n-        exp += 1\n-\n-    # n - 1=d*(2**exp)\n-    count = 0\n-    while count < prec:\n-        a = random.randint(2, n - 1)\n-        b = bin_exp_mod(a, d, n)\n-        if b != 1:\n-            flag = True\n-            for _ in range(exp):\n-                if b == n - 1:\n-                    flag = False\n-                    break\n-                b = b * b\n-                b %= n\n-            if flag:\n-                return False\n-            count += 1\n-    return True\n-\n-\n-if __name__ == \"__main__\":\n-    n = abs(int(input(\"Enter bound : \").strip()))\n-    print(\"Here's the list of primes:\")\n-    print(\", \".join(str(i) for i in range(n + 1) if is_prime_big(i)))\n", "issue": "Concatenate/consolidate all algorithms with different implementations\n### Feature description\n\nThere are lots of algorithms with the same concept but different implementations/methods in different files. All these should be moved into one file\n", "before_files": [{"content": "import random\n\nfrom .binary_exp_mod import bin_exp_mod\n\n\n# This is a probabilistic check to test primality, useful for big numbers!\n# if it's a prime, it will return true\n# if it's not a prime, the chance of it returning true is at most 1/4**prec\ndef is_prime_big(n, prec=1000):\n    \"\"\"\n    >>> from maths.prime_check import is_prime\n    >>> # all(is_prime_big(i) == is_prime(i) for i in range(1000))  # 3.45s\n    >>> all(is_prime_big(i) == is_prime(i) for i in range(256))\n    True\n    \"\"\"\n    if n < 2:\n        return False\n\n    if n % 2 == 0:\n        return n == 2\n\n    # this means n is odd\n    d = n - 1\n    exp = 0\n    while d % 2 == 0:\n        d /= 2\n        exp += 1\n\n    # n - 1=d*(2**exp)\n    count = 0\n    while count < prec:\n        a = random.randint(2, n - 1)\n        b = bin_exp_mod(a, d, n)\n        if b != 1:\n            flag = True\n            for _ in range(exp):\n                if b == n - 1:\n                    flag = False\n                    break\n                b = b * b\n                b %= n\n            if flag:\n                return False\n            count += 1\n    return True\n\n\nif __name__ == \"__main__\":\n    n = abs(int(input(\"Enter bound : \").strip()))\n    print(\"Here's the list of primes:\")\n    print(\", \".join(str(i) for i in range(n + 1) if is_prime_big(i)))\n", "path": "maths/miller_rabin.py"}], "after_files": [{"content": null, "path": "maths/miller_rabin.py"}]}