prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Infinite scroll: answer are repeated on each page
  How to reproduce : search for ["user agent"](https://searx.me/?q=user+agent) with Infinite scroll activated.
  
  Should the answer be disabled except the first page ? or should Infinite Scroll hide the answer ?
  
  I vote for the first option : disabled answers except on the first page on the server side. 
  
  
  </issue>
  <code>
  [start of searx/plugins/self_info.py]
  1 '''
  2 searx is free software: you can redistribute it and/or modify
  3 it under the terms of the GNU Affero General Public License as published by
  4 the Free Software Foundation, either version 3 of the License, or
  5 (at your option) any later version.
  6 
  7 searx is distributed in the hope that it will be useful,
  8 but WITHOUT ANY WARRANTY; without even the implied warranty of
  9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  10 GNU Affero General Public License for more details.
  11 
  12 You should have received a copy of the GNU Affero General Public License
  13 along with searx. If not, see < http://www.gnu.org/licenses/ >.
  14 
  15 (C) 2015 by Adam Tauber, <asciimoo@gmail.com>
  16 '''
  17 from flask_babel import gettext
  18 import re
  19 name = "Self Informations"
  20 description = gettext('Displays your IP if the query is "ip" and your user agent if the query contains "user agent".')
  21 default_on = True
  22 
  23 
  24 # Self User Agent regex
  25 p = re.compile('.*user[ -]agent.*', re.IGNORECASE)
  26 
  27 
  28 # attach callback to the post search hook
  29 #  request: flask request object
  30 #  ctx: the whole local context of the pre search hook
  31 def post_search(request, ctx):
  32     if ctx['search'].query == 'ip':
  33         x_forwarded_for = request.headers.getlist("X-Forwarded-For")
  34         if x_forwarded_for:
  35             ip = x_forwarded_for[0]
  36         else:
  37             ip = request.remote_addr
  38         ctx['search'].result_container.answers.clear()
  39         ctx['search'].result_container.answers.add(ip)
  40     elif p.match(ctx['search'].query):
  41         ua = request.user_agent
  42         ctx['search'].result_container.answers.clear()
  43         ctx['search'].result_container.answers.add(ua)
  44     return True
  45
  [end of searx/plugins/self_info.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/plugins/self_info.py b/searx/plugins/self_info.py
  --- a/searx/plugins/self_info.py
  +++ b/searx/plugins/self_info.py
  @@ -29,6 +29,8 @@
   #  request: flask request object
   #  ctx: the whole local context of the pre search hook
   def post_search(request, ctx):
  +    if ctx['search'].pageno > 1:
  +        return True
       if ctx['search'].query == 'ip':
           x_forwarded_for = request.headers.getlist("X-Forwarded-For")
           if x_forwarded_for:
  
verification_info: {"golden_diff": "diff --git a/searx/plugins/self_info.py b/searx/plugins/self_info.py\n--- a/searx/plugins/self_info.py\n+++ b/searx/plugins/self_info.py\n@@ -29,6 +29,8 @@\n #  request: flask request object\n #  ctx: the whole local context of the pre search hook\n def post_search(request, ctx):\n+    if ctx['search'].pageno > 1:\n+        return True\n     if ctx['search'].query == 'ip':\n         x_forwarded_for = request.headers.getlist(\"X-Forwarded-For\")\n         if x_forwarded_for:\n", "issue": "Infinite scroll: answer are repeated on each page\nHow to reproduce : search for [\"user agent\"](https://searx.me/?q=user+agent) with Infinite scroll activated.\n\nShould the answer be disabled except the first page ? or should Infinite Scroll hide the answer ?\n\nI vote for the first option : disabled answers except on the first page on the server side. \n\n", "before_files": [{"content": "'''\nsearx is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nsearx is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with searx. If not, see < http://www.gnu.org/licenses/ >.\n\n(C) 2015 by Adam Tauber, <asciimoo@gmail.com>\n'''\nfrom flask_babel import gettext\nimport re\nname = \"Self Informations\"\ndescription = gettext('Displays your IP if the query is \"ip\" and your user agent if the query contains \"user agent\".')\ndefault_on = True\n\n\n# Self User Agent regex\np = re.compile('.*user[ -]agent.*', re.IGNORECASE)\n\n\n# attach callback to the post search hook\n#  request: flask request object\n#  ctx: the whole local context of the pre search hook\ndef post_search(request, ctx):\n    if ctx['search'].query == 'ip':\n        x_forwarded_for = request.headers.getlist(\"X-Forwarded-For\")\n        if x_forwarded_for:\n            ip = x_forwarded_for[0]\n        else:\n            ip = request.remote_addr\n        ctx['search'].result_container.answers.clear()\n        ctx['search'].result_container.answers.add(ip)\n    elif p.match(ctx['search'].query):\n        ua = request.user_agent\n        ctx['search'].result_container.answers.clear()\n        ctx['search'].result_container.answers.add(ua)\n    return True\n", "path": "searx/plugins/self_info.py"}]}