prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Translate 'library/os.po'
  This needs to reach 100% translated.
  
  The rendered version of this file will be available at https://docs.python.org/es/3.10/library/os.html once translated.
  Meanwhile, the English version is shown.
  
  Current stats for `library/os.po`:
  
  * Fuzzy: 27
  * Percent translated: 94.8%
  * Entries: 804 / 848
  * Untranslated: 44
  
  Please, comment here if you want this file to be assigned to you and an member will assign it to you as soon as possible, so you can start working on it.
  
  Remember to follow the steps in our [Contributing Guide](https://python-docs-es.readthedocs.io/page/CONTRIBUTING.html).
  
  </issue>
  <code>
  [start of scripts/translate.py]
  1 import os
  2 import re
  3 import sys
  4 from typing import Dict, Tuple
  5 
  6 import polib
  7 
  8 VERBOSE = False
  9 DEBUG = False
  10 SKIP_TRANSLATED_ENTRIES = True
  11 
  12 try:
  13     from deep_translator import GoogleTranslator
  14 except ImportError:
  15     print("Error: This util script needs `deep_translator` to be installed")
  16     sys.exit(1)
  17 
  18 _patterns = [
  19     ":c:func:`[^`]+`",
  20     ":c:type:`[^`]+`",
  21     ":c:macro:`[^`]+`",
  22     ":c:member:`[^`]+`",
  23     ":c:data:`[^`]+`",
  24     ":py:data:`[^`]+`",
  25     ":py:mod:`[^`]+`",
  26     ":func:`[^`]+`",
  27     ":mod:`[^`]+`",
  28     ":ref:`[^`]+`",
  29     ":class:`[^`]+`",
  30     ":pep:`[^`]+`",
  31     ":data:`[^`]+`",
  32     ":exc:`[^`]+`",
  33     ":term:`[^`]+`",
  34     ":meth:`[^`]+`",
  35     ":envvar:`[^`]+`",
  36     ":file:`[^`]+`",
  37     ":attr:`[^`]+`",
  38     ":const:`[^`]+`",
  39     ":issue:`[^`]+`",
  40     ":opcode:`[^`]+`",
  41     ":option:`[^`]+`",
  42     ":program:`[^`]+`",
  43     ":keyword:`[^`]+`",
  44     ":RFC:`[^`]+`",
  45     ":rfc:`[^`]+`",
  46     ":doc:`[^`]+`",
  47     "``[^`]+``",
  48     "`[^`]+`__",
  49     "`[^`]+`_",
  50     "\*\*[^\*]+\*\*",  # bold text between **
  51     "\*[^\*]+\*",  # italic text between *
  52 ]
  53 
  54 _exps = [re.compile(e) for e in _patterns]
  55 
  56 def protect_sphinx_directives(s: str) -> Tuple[dict, str]:
  57     """
  58     Parameters:
  59         string containing the text to translate
  60 
  61     Returns:
  62         dictionary containing all the placeholder text as keys
  63         and the correct value.
  64     """
  65 
  66     i = 0
  67     d: Dict[str, str] = {}
  68     for exp in _exps:
  69         matches = exp.findall(s)
  70         if DEBUG:
  71             print(exp, matches)
  72         for match in matches:
  73             ph = f"XASDF{str(i).zfill(2)}"
  74             s = s.replace(match, ph)
  75             if ph in d and VERBOSE:
  76                 print(f"Error: {ph} is already in the dictionary")
  77                 print("new", match)
  78                 print("old", d[ph])
  79             d[ph] = match
  80             i += 1
  81     return d, s
  82 
  83 
  84 def undo_sphinx_directives_protection(placeholders: dict, translated_text: str) -> str:
  85     for ph, value in placeholders.items():
  86         translated_text = translated_text.replace(ph, value)
  87         if DEBUG:
  88             print(ph, value)
  89             print(translated_text)
  90     return translated_text
  91 
  92 
  93 if __name__ == "__main__":
  94     filename = sys.argv[1]
  95     if not os.path.isfile(filename):
  96         print(f"File not found: '{filename}'")
  97         sys.exit(-1)
  98 
  99     po = polib.pofile(filename)
  100     translator = GoogleTranslator(source="en", target="es")
  101 
  102     for entry in po:
  103         # If the entry has already a translation, skip.
  104         if SKIP_TRANSLATED_ENTRIES and entry.msgstr:
  105             continue
  106 
  107         print("\nEN|", entry.msgid)
  108         placeholders, temp_text = protect_sphinx_directives(entry.msgid)
  109         if VERBOSE:
  110             print(temp_text)
  111             print(placeholders)
  112 
  113         # Translate the temporary text without sphinx statements
  114         translated_text = translator.translate(temp_text)
  115 
  116         # Recover sphinx statements
  117         real_text = undo_sphinx_directives_protection(placeholders, translated_text)
  118         print("ES|", real_text)
  119 
  120         # Replace the po file translated entry
  121         entry.msgstr = real_text
  122 
  123     # Save the file after all the entries are translated
  124     po.save()
  125
  [end of scripts/translate.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/scripts/translate.py b/scripts/translate.py
  --- a/scripts/translate.py
  +++ b/scripts/translate.py
  @@ -44,6 +44,8 @@
       ":RFC:`[^`]+`",
       ":rfc:`[^`]+`",
       ":doc:`[^`]+`",
  +    ":manpage:`[^`]+`",
  +    ":sup:`[^`]+`",
       "``[^`]+``",
       "`[^`]+`__",
       "`[^`]+`_",
  
verification_info: {"golden_diff": "diff --git a/scripts/translate.py b/scripts/translate.py\n--- a/scripts/translate.py\n+++ b/scripts/translate.py\n@@ -44,6 +44,8 @@\n     \":RFC:`[^`]+`\",\n     \":rfc:`[^`]+`\",\n     \":doc:`[^`]+`\",\n+    \":manpage:`[^`]+`\",\n+    \":sup:`[^`]+`\",\n     \"``[^`]+``\",\n     \"`[^`]+`__\",\n     \"`[^`]+`_\",\n", "issue": "Translate 'library/os.po'\nThis needs to reach 100% translated.\n\nThe rendered version of this file will be available at https://docs.python.org/es/3.10/library/os.html once translated.\nMeanwhile, the English version is shown.\n\nCurrent stats for `library/os.po`:\n\n* Fuzzy: 27\n* Percent translated: 94.8%\n* Entries: 804 / 848\n* Untranslated: 44\n\nPlease, comment here if you want this file to be assigned to you and an member will assign it to you as soon as possible, so you can start working on it.\n\nRemember to follow the steps in our [Contributing Guide](https://python-docs-es.readthedocs.io/page/CONTRIBUTING.html).\n", "before_files": [{"content": "import os\nimport re\nimport sys\nfrom typing import Dict, Tuple\n\nimport polib\n\nVERBOSE = False\nDEBUG = False\nSKIP_TRANSLATED_ENTRIES = True\n\ntry:\n    from deep_translator import GoogleTranslator\nexcept ImportError:\n    print(\"Error: This util script needs `deep_translator` to be installed\")\n    sys.exit(1)\n\n_patterns = [\n    \":c:func:`[^`]+`\",\n    \":c:type:`[^`]+`\",\n    \":c:macro:`[^`]+`\",\n    \":c:member:`[^`]+`\",\n    \":c:data:`[^`]+`\",\n    \":py:data:`[^`]+`\",\n    \":py:mod:`[^`]+`\",\n    \":func:`[^`]+`\",\n    \":mod:`[^`]+`\",\n    \":ref:`[^`]+`\",\n    \":class:`[^`]+`\",\n    \":pep:`[^`]+`\",\n    \":data:`[^`]+`\",\n    \":exc:`[^`]+`\",\n    \":term:`[^`]+`\",\n    \":meth:`[^`]+`\",\n    \":envvar:`[^`]+`\",\n    \":file:`[^`]+`\",\n    \":attr:`[^`]+`\",\n    \":const:`[^`]+`\",\n    \":issue:`[^`]+`\",\n    \":opcode:`[^`]+`\",\n    \":option:`[^`]+`\",\n    \":program:`[^`]+`\",\n    \":keyword:`[^`]+`\",\n    \":RFC:`[^`]+`\",\n    \":rfc:`[^`]+`\",\n    \":doc:`[^`]+`\",\n    \"``[^`]+``\",\n    \"`[^`]+`__\",\n    \"`[^`]+`_\",\n    \"\\*\\*[^\\*]+\\*\\*\",  # bold text between **\n    \"\\*[^\\*]+\\*\",  # italic text between *\n]\n\n_exps = [re.compile(e) for e in _patterns]\n\ndef protect_sphinx_directives(s: str) -> Tuple[dict, str]:\n    \"\"\"\n    Parameters:\n        string containing the text to translate\n\n    Returns:\n        dictionary containing all the placeholder text as keys\n        and the correct value.\n    \"\"\"\n\n    i = 0\n    d: Dict[str, str] = {}\n    for exp in _exps:\n        matches = exp.findall(s)\n        if DEBUG:\n            print(exp, matches)\n        for match in matches:\n            ph = f\"XASDF{str(i).zfill(2)}\"\n            s = s.replace(match, ph)\n            if ph in d and VERBOSE:\n                print(f\"Error: {ph} is already in the dictionary\")\n                print(\"new\", match)\n                print(\"old\", d[ph])\n            d[ph] = match\n            i += 1\n    return d, s\n\n\ndef undo_sphinx_directives_protection(placeholders: dict, translated_text: str) -> str:\n    for ph, value in placeholders.items():\n        translated_text = translated_text.replace(ph, value)\n        if DEBUG:\n            print(ph, value)\n            print(translated_text)\n    return translated_text\n\n\nif __name__ == \"__main__\":\n    filename = sys.argv[1]\n    if not os.path.isfile(filename):\n        print(f\"File not found: '{filename}'\")\n        sys.exit(-1)\n\n    po = polib.pofile(filename)\n    translator = GoogleTranslator(source=\"en\", target=\"es\")\n\n    for entry in po:\n        # If the entry has already a translation, skip.\n        if SKIP_TRANSLATED_ENTRIES and entry.msgstr:\n            continue\n\n        print(\"\\nEN|\", entry.msgid)\n        placeholders, temp_text = protect_sphinx_directives(entry.msgid)\n        if VERBOSE:\n            print(temp_text)\n            print(placeholders)\n\n        # Translate the temporary text without sphinx statements\n        translated_text = translator.translate(temp_text)\n\n        # Recover sphinx statements\n        real_text = undo_sphinx_directives_protection(placeholders, translated_text)\n        print(\"ES|\", real_text)\n\n        # Replace the po file translated entry\n        entry.msgstr = real_text\n\n    # Save the file after all the entries are translated\n    po.save()\n", "path": "scripts/translate.py"}]}