prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Weird completion issue
  <!--- Provide a general summary of the issue in the Title above -->
  <!--- If you have a question along the lines of "How do I do this Bash command in xonsh"
  please first look over the Bash to Xonsh translation guide: https://xon.sh/bash_to_xsh.html
  If you don't find an answer there, please do open an issue! -->
  
  ## xonfig
  
  <details>
  
  ```
  $ xonfig
  +------------------+-----------------+
  | xonsh            | 0.9.12          |
  | Python           | 3.7.4           |
  | PLY              | 3.11            |
  | have readline    | True            |
  | prompt toolkit   | 2.0.9           |
  | shell type       | prompt_toolkit2 |
  | pygments         | 2.4.2           |
  | on posix         | True            |
  | on linux         | False           |
  | on darwin        | True            |
  | on windows       | False           |
  | on cygwin        | False           |
  | on msys2         | False           |
  | is superuser     | False           |
  | default encoding | utf-8           |
  | xonsh encoding   | utf-8           |
  | encoding errors  | surrogateescape |
  +------------------+-----------------+
  ```
  
  </details>
  
  ## Expected Behavior
  <!--- Tell us what should happen -->
  Tab completion behind shell command `vim` should work
  
  ## Current Behavior
  <!--- Tell us what happens instead of the expected behavior -->
  <!--- If part of your bug report is a traceback, please first enter debug mode before triggering the error
  To enter debug mode, set the environment variable `XONSH_DEBUG=1` _before_ starting `xonsh`.
  On Linux and OSX, an easy way to to do this is to run `env XONSH_DEBUG=1 xonsh` -->
  existing file is not being found by completion (see screenshot).
  As you can see in the lower part of the screenshot, the file `pip_packages_to_install.txt` exists in the current folder but isn't found when used behind the shell command `vim` (but does work behind `cat`).
  Is this maybe created by interfering completions installed elsewhere? Maybe some vim completions from homebrew?
  
  
  <img width="822" alt="Screenshot 2019-10-31 14 11 02" src="https://user-images.githubusercontent.com/69774/67982582-99090380-fbe8-11e9-839a-b6fd0536a3ed.png">
  
  </issue>
  <code>
  [start of xonsh/completers/pip.py]
  1 """Completers for pip."""
  2 # pylint: disable=invalid-name, missing-docstring, unsupported-membership-test
  3 # pylint: disable=unused-argument, not-an-iterable
  4 import re
  5 import subprocess
  6 
  7 import xonsh.lazyasd as xl
  8 
  9 
  10 @xl.lazyobject
  11 def PIP_RE():
  12     return re.compile(r"\bx?pip(?:\d|\.)*")
  13 
  14 
  15 @xl.lazyobject
  16 def PIP_LIST_RE():
  17     return re.compile(r"\bx?pip(?:\d|\.)* (?:uninstall|show)")
  18 
  19 
  20 @xl.lazyobject
  21 def ALL_COMMANDS():
  22     try:
  23         help_text = str(
  24             subprocess.check_output(["pip", "--help"], stderr=subprocess.DEVNULL)
  25         )
  26     except FileNotFoundError:
  27         return []
  28     commands = re.findall(r"  (\w+)  ", help_text)
  29     return [c for c in commands if c not in ["completion", "help"]]
  30 
  31 
  32 def complete_pip(prefix, line, begidx, endidx, ctx):
  33     """Completes python's package manager pip"""
  34     line_len = len(line.split())
  35     if (
  36         (line_len > 3)
  37         or (line_len > 2 and line.endswith(" "))
  38         or (not PIP_RE.search(line))
  39     ):
  40         return
  41     if PIP_LIST_RE.search(line):
  42         try:
  43             items = subprocess.check_output(["pip", "list"], stderr=subprocess.DEVNULL)
  44         except FileNotFoundError:
  45             return set()
  46         items = items.decode("utf-8").splitlines()
  47         return set(i.split()[0] for i in items if i.split()[0].startswith(prefix))
  48 
  49     if (line_len > 1 and line.endswith(" ")) or line_len > 2:
  50         # "pip show " -> no complete (note space)
  51         return
  52     if prefix not in ALL_COMMANDS:
  53         suggestions = [c for c in ALL_COMMANDS if c.startswith(prefix)]
  54         if suggestions:
  55             return suggestions, len(prefix)
  56     return ALL_COMMANDS, len(prefix)
  57
  [end of xonsh/completers/pip.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/xonsh/completers/pip.py b/xonsh/completers/pip.py
  --- a/xonsh/completers/pip.py
  +++ b/xonsh/completers/pip.py
  @@ -9,12 +9,12 @@
   
   @xl.lazyobject
   def PIP_RE():
  -    return re.compile(r"\bx?pip(?:\d|\.)*")
  +    return re.compile(r"\bx?pip(?:\d|\.)*\b")
   
   
   @xl.lazyobject
   def PIP_LIST_RE():
  -    return re.compile(r"\bx?pip(?:\d|\.)* (?:uninstall|show)")
  +    return re.compile(r"\bx?pip(?:\d|\.)*\b (?:uninstall|show)")
   
   
   @xl.lazyobject
  
verification_info: {"golden_diff": "diff --git a/xonsh/completers/pip.py b/xonsh/completers/pip.py\n--- a/xonsh/completers/pip.py\n+++ b/xonsh/completers/pip.py\n@@ -9,12 +9,12 @@\n \n @xl.lazyobject\n def PIP_RE():\n-    return re.compile(r\"\\bx?pip(?:\\d|\\.)*\")\n+    return re.compile(r\"\\bx?pip(?:\\d|\\.)*\\b\")\n \n \n @xl.lazyobject\n def PIP_LIST_RE():\n-    return re.compile(r\"\\bx?pip(?:\\d|\\.)* (?:uninstall|show)\")\n+    return re.compile(r\"\\bx?pip(?:\\d|\\.)*\\b (?:uninstall|show)\")\n \n \n @xl.lazyobject\n", "issue": "Weird completion issue\n<!--- Provide a general summary of the issue in the Title above -->\r\n<!--- If you have a question along the lines of \"How do I do this Bash command in xonsh\"\r\nplease first look over the Bash to Xonsh translation guide: https://xon.sh/bash_to_xsh.html\r\nIf you don't find an answer there, please do open an issue! -->\r\n\r\n## xonfig\r\n\r\n<details>\r\n\r\n```\r\n$ xonfig\r\n+------------------+-----------------+\r\n| xonsh            | 0.9.12          |\r\n| Python           | 3.7.4           |\r\n| PLY              | 3.11            |\r\n| have readline    | True            |\r\n| prompt toolkit   | 2.0.9           |\r\n| shell type       | prompt_toolkit2 |\r\n| pygments         | 2.4.2           |\r\n| on posix         | True            |\r\n| on linux         | False           |\r\n| on darwin        | True            |\r\n| on windows       | False           |\r\n| on cygwin        | False           |\r\n| on msys2         | False           |\r\n| is superuser     | False           |\r\n| default encoding | utf-8           |\r\n| xonsh encoding   | utf-8           |\r\n| encoding errors  | surrogateescape |\r\n+------------------+-----------------+\r\n```\r\n\r\n</details>\r\n\r\n## Expected Behavior\r\n<!--- Tell us what should happen -->\r\nTab completion behind shell command `vim` should work\r\n\r\n## Current Behavior\r\n<!--- Tell us what happens instead of the expected behavior -->\r\n<!--- If part of your bug report is a traceback, please first enter debug mode before triggering the error\r\nTo enter debug mode, set the environment variable `XONSH_DEBUG=1` _before_ starting `xonsh`.\r\nOn Linux and OSX, an easy way to to do this is to run `env XONSH_DEBUG=1 xonsh` -->\r\nexisting file is not being found by completion (see screenshot).\r\nAs you can see in the lower part of the screenshot, the file `pip_packages_to_install.txt` exists in the current folder but isn't found when used behind the shell command `vim` (but does work behind `cat`).\r\nIs this maybe created by interfering completions installed elsewhere? Maybe some vim completions from homebrew?\r\n\r\n\r\n<img width=\"822\" alt=\"Screenshot 2019-10-31 14 11 02\" src=\"https://user-images.githubusercontent.com/69774/67982582-99090380-fbe8-11e9-839a-b6fd0536a3ed.png\">\n", "before_files": [{"content": "\"\"\"Completers for pip.\"\"\"\n# pylint: disable=invalid-name, missing-docstring, unsupported-membership-test\n# pylint: disable=unused-argument, not-an-iterable\nimport re\nimport subprocess\n\nimport xonsh.lazyasd as xl\n\n\n@xl.lazyobject\ndef PIP_RE():\n    return re.compile(r\"\\bx?pip(?:\\d|\\.)*\")\n\n\n@xl.lazyobject\ndef PIP_LIST_RE():\n    return re.compile(r\"\\bx?pip(?:\\d|\\.)* (?:uninstall|show)\")\n\n\n@xl.lazyobject\ndef ALL_COMMANDS():\n    try:\n        help_text = str(\n            subprocess.check_output([\"pip\", \"--help\"], stderr=subprocess.DEVNULL)\n        )\n    except FileNotFoundError:\n        return []\n    commands = re.findall(r\"  (\\w+)  \", help_text)\n    return [c for c in commands if c not in [\"completion\", \"help\"]]\n\n\ndef complete_pip(prefix, line, begidx, endidx, ctx):\n    \"\"\"Completes python's package manager pip\"\"\"\n    line_len = len(line.split())\n    if (\n        (line_len > 3)\n        or (line_len > 2 and line.endswith(\" \"))\n        or (not PIP_RE.search(line))\n    ):\n        return\n    if PIP_LIST_RE.search(line):\n        try:\n            items = subprocess.check_output([\"pip\", \"list\"], stderr=subprocess.DEVNULL)\n        except FileNotFoundError:\n            return set()\n        items = items.decode(\"utf-8\").splitlines()\n        return set(i.split()[0] for i in items if i.split()[0].startswith(prefix))\n\n    if (line_len > 1 and line.endswith(\" \")) or line_len > 2:\n        # \"pip show \" -> no complete (note space)\n        return\n    if prefix not in ALL_COMMANDS:\n        suggestions = [c for c in ALL_COMMANDS if c.startswith(prefix)]\n        if suggestions:\n            return suggestions, len(prefix)\n    return ALL_COMMANDS, len(prefix)\n", "path": "xonsh/completers/pip.py"}]}