prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  ExampleApp Syntax Highlighter broken in PyQt5
  ### Short description
  Since merge of #1302, the syntax highlighter in the ExampleApp is broken  (CC @j9ac9k ).
  
  ### Code to reproduce
  ```bash
  cd pyqtgraph\examples
  python3 .
  ```
  
  ### Expected behavior
  Syntax highlighter should work
  
  ### Real behavior
  Following error:
  
  ```
  Traceback (most recent call last):
    File "/home/b2/Documents/synced/pyqtgraph/examples/ExampleApp.py", line 298, in highlightBlock
      format = self.styles[format]
  AttributeError: 'PythonHighlighter' object has no attribute 'styles'
  ```
  
  ### Tested environment(s)
  
   * PyQtGraph version: 7e57e07068fc8a62e9ae3b68e5556b11b6ef1841 and newer
   * Qt Python binding: yQt5 5.15.1 Qt 5.15.1
   * Python version: Python 3.8.5
   * NumPy version: 1.19.2
   * Operating system: Linux 5.8.16-2-MANJARO
   * Installation method: Run in folder (see above)
  
  </issue>
  <code>
  [start of examples/__main__.py]
  1 import sys, os
  2 import pyqtgraph as pg
  3 from pyqtgraph.Qt import QtCore, QtGui
  4 
  5 
  6 
  7 if __name__ == '__main__':
  8     if __package__ is None or __package__ == "":
  9         parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  10         sys.path.insert(0, parent_dir)
  11         import examples
  12         __package__ = "examples"
  13 
  14     from .ExampleApp import main as run
  15     run()
  16
  [end of examples/__main__.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/examples/__main__.py b/examples/__main__.py
  --- a/examples/__main__.py
  +++ b/examples/__main__.py
  @@ -1,15 +1,16 @@
   import sys, os
  +
  +# Set up path to contain pyqtgraph module when run without installation
  +if __name__ == "__main__" and (__package__ is None or __package__==''):
  +    parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  +    sys.path.insert(0, parent_dir)
  +    import examples
  +    __package__ = "examples"
  +
   import pyqtgraph as pg
   from pyqtgraph.Qt import QtCore, QtGui
   
   
  -
   if __name__ == '__main__':
  -    if __package__ is None or __package__ == "":
  -        parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  -        sys.path.insert(0, parent_dir)
  -        import examples
  -        __package__ = "examples"
  -
       from .ExampleApp import main as run
       run()
  
verification_info: {"golden_diff": "diff --git a/examples/__main__.py b/examples/__main__.py\n--- a/examples/__main__.py\n+++ b/examples/__main__.py\n@@ -1,15 +1,16 @@\n import sys, os\n+\n+# Set up path to contain pyqtgraph module when run without installation\n+if __name__ == \"__main__\" and (__package__ is None or __package__==''):\n+    parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n+    sys.path.insert(0, parent_dir)\n+    import examples\n+    __package__ = \"examples\"\n+\n import pyqtgraph as pg\n from pyqtgraph.Qt import QtCore, QtGui\n \n \n-\n if __name__ == '__main__':\n-    if __package__ is None or __package__ == \"\":\n-        parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n-        sys.path.insert(0, parent_dir)\n-        import examples\n-        __package__ = \"examples\"\n-\n     from .ExampleApp import main as run\n     run()\n", "issue": "ExampleApp Syntax Highlighter broken in PyQt5\n### Short description\r\nSince merge of #1302, the syntax highlighter in the ExampleApp is broken  (CC @j9ac9k ).\r\n\r\n### Code to reproduce\r\n```bash\r\ncd pyqtgraph\\examples\r\npython3 .\r\n```\r\n\r\n### Expected behavior\r\nSyntax highlighter should work\r\n\r\n### Real behavior\r\nFollowing error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/b2/Documents/synced/pyqtgraph/examples/ExampleApp.py\", line 298, in highlightBlock\r\n    format = self.styles[format]\r\nAttributeError: 'PythonHighlighter' object has no attribute 'styles'\r\n```\r\n\r\n### Tested environment(s)\r\n\r\n * PyQtGraph version: 7e57e07068fc8a62e9ae3b68e5556b11b6ef1841 and newer\r\n * Qt Python binding: yQt5 5.15.1 Qt 5.15.1\r\n * Python version: Python 3.8.5\r\n * NumPy version: 1.19.2\r\n * Operating system: Linux 5.8.16-2-MANJARO\r\n * Installation method: Run in folder (see above)\n", "before_files": [{"content": "import sys, os\nimport pyqtgraph as pg\nfrom pyqtgraph.Qt import QtCore, QtGui\n\n\n\nif __name__ == '__main__':\n    if __package__ is None or __package__ == \"\":\n        parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n        sys.path.insert(0, parent_dir)\n        import examples\n        __package__ = \"examples\"\n\n    from .ExampleApp import main as run\n    run()\n", "path": "examples/__main__.py"}]}