prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Bug: internetarchivescholar engine
  **Version of SearXNG, commit number if you are using on master branch and stipulate if you forked SearXNG**
  Repository: https://github.com/searxng/searxng
  Branch: master
  Version: 2023.9.19+3ac7c40b6
  <!-- Check if these values are correct -->
  
  **How did you install SearXNG?**
  <!-- Did you install SearXNG using the official wiki or using searxng-docker
  or manually by executing the searx/webapp.py file? -->
  **What happened?**
  <!-- A clear and concise description of what the bug is. -->
  
  **How To Reproduce**
  <!-- How can we reproduce this issue? (as minimally and as precisely as possible) -->
  
  **Expected behavior**
  <!-- A clear and concise description of what you expected to happen. -->
  
  **Screenshots & Logs**
  <!-- If applicable, add screenshots, logs to help explain your problem. -->
  
  **Additional context**
  <!-- Add any other context about the problem here. -->
  
  **Technical report**
  
  Error
    * Error: KeyError
    * Percentage: 25
    * Parameters: `()`
    * File name: `searx/engines/internet_archive_scholar.py:59`
    * Function: `response`
    * Code: `'title': result['biblio']['title'],`
  
  
  
  </issue>
  <code>
  [start of searx/engines/internet_archive_scholar.py]
  1 # SPDX-License-Identifier: AGPL-3.0-or-later
  2 # lint: pylint
  3 """Internet Archive scholar(science)
  4 """
  5 
  6 from datetime import datetime
  7 from urllib.parse import urlencode
  8 from searx.utils import html_to_text
  9 
  10 about = {
  11     "website": "https://scholar.archive.org/",
  12     "wikidata_id": "Q115667709",
  13     "official_api_documentation": "https://scholar.archive.org/api/redoc",
  14     "use_official_api": True,
  15     "require_api_key": False,
  16     "results": "JSON",
  17 }
  18 categories = ['science', 'scientific publications']
  19 paging = True
  20 
  21 base_url = "https://scholar.archive.org"
  22 results_per_page = 15
  23 
  24 
  25 def request(query, params):
  26     args = {
  27         "q": query,
  28         "limit": results_per_page,
  29         "offset": (params["pageno"] - 1) * results_per_page,
  30     }
  31     params["url"] = f"{base_url}/search?{urlencode(args)}"
  32     params["headers"]["Accept"] = "application/json"
  33     return params
  34 
  35 
  36 def response(resp):
  37     results = []
  38 
  39     json = resp.json()
  40 
  41     for result in json["results"]:
  42         publishedDate, content, doi = None, '', None
  43 
  44         if result['biblio'].get('release_date'):
  45             publishedDate = datetime.strptime(result['biblio']['release_date'], "%Y-%m-%d")
  46 
  47         if len(result['abstracts']) > 0:
  48             content = result['abstracts'][0].get('body')
  49         elif len(result['_highlights']) > 0:
  50             content = result['_highlights'][0]
  51 
  52         if len(result['releases']) > 0:
  53             doi = result['releases'][0].get('doi')
  54 
  55         results.append(
  56             {
  57                 'template': 'paper.html',
  58                 'url': result['fulltext']['access_url'],
  59                 'title': result['biblio']['title'],
  60                 'content': html_to_text(content),
  61                 'publisher': result['biblio'].get('publisher'),
  62                 'doi': doi,
  63                 'journal': result['biblio'].get('container_name'),
  64                 'authors': result['biblio'].get('contrib_names'),
  65                 'tags': result['tags'],
  66                 'publishedDate': publishedDate,
  67                 'issns': result['biblio'].get('issns'),
  68                 'pdf_url': result['fulltext'].get('access_url'),
  69             }
  70         )
  71 
  72     return results
  73
  [end of searx/engines/internet_archive_scholar.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/searx/engines/internet_archive_scholar.py b/searx/engines/internet_archive_scholar.py
  --- a/searx/engines/internet_archive_scholar.py
  +++ b/searx/engines/internet_archive_scholar.py
  @@ -56,7 +56,7 @@
               {
                   'template': 'paper.html',
                   'url': result['fulltext']['access_url'],
  -                'title': result['biblio']['title'],
  +                'title': result['biblio'].get('title') or result['biblio'].get('container_name'),
                   'content': html_to_text(content),
                   'publisher': result['biblio'].get('publisher'),
                   'doi': doi,
  
verification_info: {"golden_diff": "diff --git a/searx/engines/internet_archive_scholar.py b/searx/engines/internet_archive_scholar.py\n--- a/searx/engines/internet_archive_scholar.py\n+++ b/searx/engines/internet_archive_scholar.py\n@@ -56,7 +56,7 @@\n             {\n                 'template': 'paper.html',\n                 'url': result['fulltext']['access_url'],\n-                'title': result['biblio']['title'],\n+                'title': result['biblio'].get('title') or result['biblio'].get('container_name'),\n                 'content': html_to_text(content),\n                 'publisher': result['biblio'].get('publisher'),\n                 'doi': doi,\n", "issue": "Bug: internetarchivescholar engine\n**Version of SearXNG, commit number if you are using on master branch and stipulate if you forked SearXNG**\r\nRepository: https://github.com/searxng/searxng\r\nBranch: master\r\nVersion: 2023.9.19+3ac7c40b6\r\n<!-- Check if these values are correct -->\r\n\r\n**How did you install SearXNG?**\r\n<!-- Did you install SearXNG using the official wiki or using searxng-docker\r\nor manually by executing the searx/webapp.py file? -->\r\n**What happened?**\r\n<!-- A clear and concise description of what the bug is. -->\r\n\r\n**How To Reproduce**\r\n<!-- How can we reproduce this issue? (as minimally and as precisely as possible) -->\r\n\r\n**Expected behavior**\r\n<!-- A clear and concise description of what you expected to happen. -->\r\n\r\n**Screenshots & Logs**\r\n<!-- If applicable, add screenshots, logs to help explain your problem. -->\r\n\r\n**Additional context**\r\n<!-- Add any other context about the problem here. -->\r\n\r\n**Technical report**\r\n\r\nError\r\n  * Error: KeyError\r\n  * Percentage: 25\r\n  * Parameters: `()`\r\n  * File name: `searx/engines/internet_archive_scholar.py:59`\r\n  * Function: `response`\r\n  * Code: `'title': result['biblio']['title'],`\r\n\r\n\n", "before_files": [{"content": "# SPDX-License-Identifier: AGPL-3.0-or-later\n# lint: pylint\n\"\"\"Internet Archive scholar(science)\n\"\"\"\n\nfrom datetime import datetime\nfrom urllib.parse import urlencode\nfrom searx.utils import html_to_text\n\nabout = {\n    \"website\": \"https://scholar.archive.org/\",\n    \"wikidata_id\": \"Q115667709\",\n    \"official_api_documentation\": \"https://scholar.archive.org/api/redoc\",\n    \"use_official_api\": True,\n    \"require_api_key\": False,\n    \"results\": \"JSON\",\n}\ncategories = ['science', 'scientific publications']\npaging = True\n\nbase_url = \"https://scholar.archive.org\"\nresults_per_page = 15\n\n\ndef request(query, params):\n    args = {\n        \"q\": query,\n        \"limit\": results_per_page,\n        \"offset\": (params[\"pageno\"] - 1) * results_per_page,\n    }\n    params[\"url\"] = f\"{base_url}/search?{urlencode(args)}\"\n    params[\"headers\"][\"Accept\"] = \"application/json\"\n    return params\n\n\ndef response(resp):\n    results = []\n\n    json = resp.json()\n\n    for result in json[\"results\"]:\n        publishedDate, content, doi = None, '', None\n\n        if result['biblio'].get('release_date'):\n            publishedDate = datetime.strptime(result['biblio']['release_date'], \"%Y-%m-%d\")\n\n        if len(result['abstracts']) > 0:\n            content = result['abstracts'][0].get('body')\n        elif len(result['_highlights']) > 0:\n            content = result['_highlights'][0]\n\n        if len(result['releases']) > 0:\n            doi = result['releases'][0].get('doi')\n\n        results.append(\n            {\n                'template': 'paper.html',\n                'url': result['fulltext']['access_url'],\n                'title': result['biblio']['title'],\n                'content': html_to_text(content),\n                'publisher': result['biblio'].get('publisher'),\n                'doi': doi,\n                'journal': result['biblio'].get('container_name'),\n                'authors': result['biblio'].get('contrib_names'),\n                'tags': result['tags'],\n                'publishedDate': publishedDate,\n                'issns': result['biblio'].get('issns'),\n                'pdf_url': result['fulltext'].get('access_url'),\n            }\n        )\n\n    return results\n", "path": "searx/engines/internet_archive_scholar.py"}]}