prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [Bug] Broken links in MASTG Webpage
  ### MASTG Chapter
  
  0x04g-Testing-Cryptography.md
  
  ### File Line Number
  
  90
  
  ### Context
  
  The links to "Data Storage on Android"  and "Data Storage on iOS" lead to 404
  
  </issue>
  <code>
  [start of tools/scripts/transform_files.py]
  1 import re, os
  2 from pathlib import Path
  3 
  4 EMOJIS_regex = r"🥇 |🎁 |📝 |❗ "
  5 
  6 def transform_links(file_text):
  7     print("[*] Regex Substitutions ../Document to MASTG/")
  8     found = re.findall(r'(\((?:../)*Document/.*\.md/*)', file_text)
  9     print(f"    Found: {found}")
  10     return re.sub(r"\(((?:../)*)Document/(.*)\.md/*", r"(\1MASTG/\2/", file_text)
  11 
  12 def remove_emojis(file_text):
  13     print("[*] Regex Substitutions for emojis")
  14     found = re.findall(EMOJIS_regex, file_text)
  15     print(f"    Found: {found}")
  16     return re.sub(EMOJIS_regex, r"", file_text)
  17 
  18 def transform(folder, functions):
  19     print(f"[*] Applying transforms to {folder}")
  20     for root, dirname, filenames in os.walk(folder):
  21         if len(filenames):
  22             files = Path(root).glob('*.md')
  23 
  24             for file in files:
  25                 file_obj = Path(file)
  26                 print(f"    - File {file_obj.as_posix()}")
  27                 file_text = file_obj.read_text()
  28                 
  29                 new_text = None
  30                 for function in functions:
  31                     if new_text is None:
  32                         new_text = function(file_text)
  33                     else:
  34                         new_text = function(new_text)
  35 
  36                 file_obj.write_text(new_text)
  37 
  38 transform("docs", [transform_links])
  39 transform("Document", [remove_emojis])
  [end of tools/scripts/transform_files.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/tools/scripts/transform_files.py b/tools/scripts/transform_files.py
  --- a/tools/scripts/transform_files.py
  +++ b/tools/scripts/transform_files.py
  @@ -4,10 +4,22 @@
   EMOJIS_regex = r"🥇 |🎁 |📝 |❗ "
   
   def transform_links(file_text):
  -    print("[*] Regex Substitutions ../Document to MASTG/")
  -    found = re.findall(r'(\((?:../)*Document/.*\.md/*)', file_text)
  -    print(f"    Found: {found}")
  -    return re.sub(r"\(((?:../)*)Document/(.*)\.md/*", r"(\1MASTG/\2/", file_text)
  +    # print("[*] Regex Substitutions ../Document to MASTG/")
  +    found = re.findall(r'(\(0x.*\.md/*)', file_text)
  +
  +    # TODO FIX we must find a better solution to this
  +    while len(found) > 0:
  +        print(f"    Found: {found}")
  +        file_text = re.sub(r"\((0x0[1-3].*\.md)", r"(../Intro/\1", file_text)
  +        file_text = re.sub(r"\((0x04.*\.md)", r"(../General/\1", file_text)
  +        file_text = re.sub(r"\((0x05.*\.md)", r"(../Android/\1", file_text)
  +        file_text = re.sub(r"\((0x06.*\.md)", r"(../iOS/\1", file_text)
  +        file_text = re.sub(r"\((0x08.*\.md)", r"(../Tools/\1", file_text)
  +        file_text = re.sub(r"\((0x09.*\.md)", r"(../References/\1", file_text)
  +
  +        found = re.findall(r'(\(0x.*\.md/*)', file_text)
  +
  +    return file_text
   
   def remove_emojis(file_text):
       print("[*] Regex Substitutions for emojis")
  @@ -35,5 +47,5 @@
   
                   file_obj.write_text(new_text)
   
  -transform("docs", [transform_links])
  -transform("Document", [remove_emojis])
  \ No newline at end of file
  +transform("docs/MASTG", [transform_links])
  +# transform("docs/MASTG", [remove_emojis])
  \ No newline at end of file
  
verification_info: {"golden_diff": "diff --git a/tools/scripts/transform_files.py b/tools/scripts/transform_files.py\n--- a/tools/scripts/transform_files.py\n+++ b/tools/scripts/transform_files.py\n@@ -4,10 +4,22 @@\n EMOJIS_regex = r\"\ud83e\udd47 |\ud83c\udf81 |\ud83d\udcdd |\u2757 \"\n \n def transform_links(file_text):\n-    print(\"[*] Regex Substitutions ../Document to MASTG/\")\n-    found = re.findall(r'(\\((?:../)*Document/.*\\.md/*)', file_text)\n-    print(f\"    Found: {found}\")\n-    return re.sub(r\"\\(((?:../)*)Document/(.*)\\.md/*\", r\"(\\1MASTG/\\2/\", file_text)\n+    # print(\"[*] Regex Substitutions ../Document to MASTG/\")\n+    found = re.findall(r'(\\(0x.*\\.md/*)', file_text)\n+\n+    # TODO FIX we must find a better solution to this\n+    while len(found) > 0:\n+        print(f\"    Found: {found}\")\n+        file_text = re.sub(r\"\\((0x0[1-3].*\\.md)\", r\"(../Intro/\\1\", file_text)\n+        file_text = re.sub(r\"\\((0x04.*\\.md)\", r\"(../General/\\1\", file_text)\n+        file_text = re.sub(r\"\\((0x05.*\\.md)\", r\"(../Android/\\1\", file_text)\n+        file_text = re.sub(r\"\\((0x06.*\\.md)\", r\"(../iOS/\\1\", file_text)\n+        file_text = re.sub(r\"\\((0x08.*\\.md)\", r\"(../Tools/\\1\", file_text)\n+        file_text = re.sub(r\"\\((0x09.*\\.md)\", r\"(../References/\\1\", file_text)\n+\n+        found = re.findall(r'(\\(0x.*\\.md/*)', file_text)\n+\n+    return file_text\n \n def remove_emojis(file_text):\n     print(\"[*] Regex Substitutions for emojis\")\n@@ -35,5 +47,5 @@\n \n                 file_obj.write_text(new_text)\n \n-transform(\"docs\", [transform_links])\n-transform(\"Document\", [remove_emojis])\n\\ No newline at end of file\n+transform(\"docs/MASTG\", [transform_links])\n+# transform(\"docs/MASTG\", [remove_emojis])\n\\ No newline at end of file\n", "issue": "[Bug] Broken links in MASTG Webpage\n### MASTG Chapter\n\n0x04g-Testing-Cryptography.md\n\n### File Line Number\n\n90\n\n### Context\n\nThe links to \"Data Storage on Android\"  and \"Data Storage on iOS\" lead to 404\n", "before_files": [{"content": "import re, os\nfrom pathlib import Path\n\nEMOJIS_regex = r\"\ud83e\udd47 |\ud83c\udf81 |\ud83d\udcdd |\u2757 \"\n\ndef transform_links(file_text):\n    print(\"[*] Regex Substitutions ../Document to MASTG/\")\n    found = re.findall(r'(\\((?:../)*Document/.*\\.md/*)', file_text)\n    print(f\"    Found: {found}\")\n    return re.sub(r\"\\(((?:../)*)Document/(.*)\\.md/*\", r\"(\\1MASTG/\\2/\", file_text)\n\ndef remove_emojis(file_text):\n    print(\"[*] Regex Substitutions for emojis\")\n    found = re.findall(EMOJIS_regex, file_text)\n    print(f\"    Found: {found}\")\n    return re.sub(EMOJIS_regex, r\"\", file_text)\n\ndef transform(folder, functions):\n    print(f\"[*] Applying transforms to {folder}\")\n    for root, dirname, filenames in os.walk(folder):\n        if len(filenames):\n            files = Path(root).glob('*.md')\n\n            for file in files:\n                file_obj = Path(file)\n                print(f\"    - File {file_obj.as_posix()}\")\n                file_text = file_obj.read_text()\n                \n                new_text = None\n                for function in functions:\n                    if new_text is None:\n                        new_text = function(file_text)\n                    else:\n                        new_text = function(new_text)\n\n                file_obj.write_text(new_text)\n\ntransform(\"docs\", [transform_links])\ntransform(\"Document\", [remove_emojis])", "path": "tools/scripts/transform_files.py"}]}