We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add typing to maths/segmented_sieve.py
### Describe your change:



* [ ] Add an algorithm?
* [ ] Fix a bug or typo in an existing algorithm?
* [ ] Documentation change?

### Checklist:
* [ ] I have read [CONTRIBUTING.md](https://github.com/TheAlgorithms/Python/blob/master/CONTRIBUTING.md).
* [ ] This pull request is all my own work -- I have not plagiarized.
* [ ] I know that pull requests will not be merged if they fail the automated tests.
* [ ] This PR only changes one algorithm file.  To ease review, please open separate PRs for separate algorithms.
* [ ] All new Python files are placed inside an existing directory.
* [ ] All filenames are in all lowercase characters with no spaces or dashes.
* [ ] All functions and variable names follow Python naming conventions.
* [ ] All function parameters and return values are annotated with Python [type hints](https://docs.python.org/3/library/typing.html).
* [ ] All functions have [doctests](https://docs.python.org/3/library/doctest.html) that pass the automated testing.
* [ ] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
* [ ] If this pull request resolves one or more open issues then the commit message contains `Fixes: #{$ISSUE_NO}`.


--- 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/segmented_sieve.py`
Content:
```
1 """Segmented Sieve."""
2 
3 import math
4 
5 
6 def sieve(n):
7     """Segmented Sieve."""
8     in_prime = []
9     start = 2
10     end = int(math.sqrt(n))  # Size of every segment
11     temp = [True] * (end + 1)
12     prime = []
13 
14     while start <= end:
15         if temp[start] is True:
16             in_prime.append(start)
17             for i in range(start * start, end + 1, start):
18                 temp[i] = False
19         start += 1
20     prime += in_prime
21 
22     low = end + 1
23     high = min(2 * end, n)
24 
25     while low <= n:
26         temp = [True] * (high - low + 1)
27         for each in in_prime:
28 
29             t = math.floor(low / each) * each
30             if t < low:
31                 t += each
32 
33             for j in range(t, high + 1, each):
34                 temp[j - low] = False
35 
36         for j in range(len(temp)):
37             if temp[j] is True:
38                 prime.append(j + low)
39 
40         low = high + 1
41         high = min(high + end, n)
42 
43     return prime
44 
45 
46 print(sieve(10**6))
47
```
--- 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/maths/segmented_sieve.py b/maths/segmented_sieve.py
--- a/maths/segmented_sieve.py
+++ b/maths/segmented_sieve.py
@@ -3,7 +3,7 @@
 import math
 
 
-def sieve(n):
+def sieve(n: int) -> list[int]:
     """Segmented Sieve."""
     in_prime = []
     start = 2

{"golden_diff": "diff --git a/maths/segmented_sieve.py b/maths/segmented_sieve.py\n--- a/maths/segmented_sieve.py\n+++ b/maths/segmented_sieve.py\n@@ -3,7 +3,7 @@\n import math\r\n \r\n \r\n-def sieve(n):\r\n+def sieve(n: int) -> list[int]:\r\n     \"\"\"Segmented Sieve.\"\"\"\r\n     in_prime = []\r\n     start = 2\n", "issue": "Add typing to maths/segmented_sieve.py\n### Describe your change:\r\n\r\n\r\n\r\n* [ ] Add an algorithm?\r\n* [ ] Fix a bug or typo in an existing algorithm?\r\n* [ ] Documentation change?\r\n\r\n### Checklist:\r\n* [ ] I have read [CONTRIBUTING.md](https://github.com/TheAlgorithms/Python/blob/master/CONTRIBUTING.md).\r\n* [ ] This pull request is all my own work -- I have not plagiarized.\r\n* [ ] I know that pull requests will not be merged if they fail the automated tests.\r\n* [ ] This PR only changes one algorithm file.  To ease review, please open separate PRs for separate algorithms.\r\n* [ ] All new Python files are placed inside an existing directory.\r\n* [ ] All filenames are in all lowercase characters with no spaces or dashes.\r\n* [ ] All functions and variable names follow Python naming conventions.\r\n* [ ] All function parameters and return values are annotated with Python [type hints](https://docs.python.org/3/library/typing.html).\r\n* [ ] All functions have [doctests](https://docs.python.org/3/library/doctest.html) that pass the automated testing.\r\n* [ ] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.\r\n* [ ] If this pull request resolves one or more open issues then the commit message contains `Fixes: #{$ISSUE_NO}`.\r\n\n", "before_files": [{"content": "\"\"\"Segmented Sieve.\"\"\"\r\n\r\nimport math\r\n\r\n\r\ndef sieve(n):\r\n    \"\"\"Segmented Sieve.\"\"\"\r\n    in_prime = []\r\n    start = 2\r\n    end = int(math.sqrt(n))  # Size of every segment\r\n    temp = [True] * (end + 1)\r\n    prime = []\r\n\r\n    while start <= end:\r\n        if temp[start] is True:\r\n            in_prime.append(start)\r\n            for i in range(start * start, end + 1, start):\r\n                temp[i] = False\r\n        start += 1\r\n    prime += in_prime\r\n\r\n    low = end + 1\r\n    high = min(2 * end, n)\r\n\r\n    while low <= n:\r\n        temp = [True] * (high - low + 1)\r\n        for each in in_prime:\r\n\r\n            t = math.floor(low / each) * each\r\n            if t < low:\r\n                t += each\r\n\r\n            for j in range(t, high + 1, each):\r\n                temp[j - low] = False\r\n\r\n        for j in range(len(temp)):\r\n            if temp[j] is True:\r\n                prime.append(j + low)\r\n\r\n        low = high + 1\r\n        high = min(high + end, n)\r\n\r\n    return prime\r\n\r\n\r\nprint(sieve(10**6))\r\n", "path": "maths/segmented_sieve.py"}], "after_files": [{"content": "\"\"\"Segmented Sieve.\"\"\"\r\n\r\nimport math\r\n\r\n\r\ndef sieve(n: int) -> list[int]:\r\n    \"\"\"Segmented Sieve.\"\"\"\r\n    in_prime = []\r\n    start = 2\r\n    end = int(math.sqrt(n))  # Size of every segment\r\n    temp = [True] * (end + 1)\r\n    prime = []\r\n\r\n    while start <= end:\r\n        if temp[start] is True:\r\n            in_prime.append(start)\r\n            for i in range(start * start, end + 1, start):\r\n                temp[i] = False\r\n        start += 1\r\n    prime += in_prime\r\n\r\n    low = end + 1\r\n    high = min(2 * end, n)\r\n\r\n    while low <= n:\r\n        temp = [True] * (high - low + 1)\r\n        for each in in_prime:\r\n\r\n            t = math.floor(low / each) * each\r\n            if t < low:\r\n                t += each\r\n\r\n            for j in range(t, high + 1, each):\r\n                temp[j - low] = False\r\n\r\n        for j in range(len(temp)):\r\n            if temp[j] is True:\r\n                prime.append(j + low)\r\n\r\n        low = high + 1\r\n        high = min(high + end, n)\r\n\r\n    return prime\r\n\r\n\r\nprint(sieve(10**6))\r\n", "path": "maths/segmented_sieve.py"}]}