prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Check and Fix notebook / jupyter client warning on Colab
  ## Description
  This needs to be checked on Colab, since it seems colab has its own outdated versions of notebook and jupyter-client as well.
  https://github.com/OpenMined/PySyft/issues/4915
  
  ## Definition of Done
  Fix for Colab if possible.
  
  </issue>
  <code>
  [start of src/syft/core/common/environment.py]
  1 # stdlib
  2 import sys
  3 
  4 # checks if we are in a python repl or python -i script.py
  5 is_interactive = bool(getattr(sys, "ps1", sys.flags.interactive))
  6 
  7 # checks if we are in jupyter
  8 is_jupyter = True
  9 
  10 try:
  11     get_ipython()  # type: ignore
  12     # third party
  13     import notebook
  14     from packaging import version
  15 
  16     NOTEBOOK_VERSION = version.parse(notebook.__version__.split("+")[0])
  17     if NOTEBOOK_VERSION < version.parse("6.0.0"):
  18         raise Exception(
  19             "Your Jupyter Notebook is too old. Please upgrade to version 6 or higher."
  20         )
  21 except NameError:
  22     is_jupyter = False
  23 
  24 __all__ = ["is_interactive", "is_jupyter"]
  25
  [end of src/syft/core/common/environment.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/src/syft/core/common/environment.py b/src/syft/core/common/environment.py
  --- a/src/syft/core/common/environment.py
  +++ b/src/syft/core/common/environment.py
  @@ -14,7 +14,8 @@
       from packaging import version
   
       NOTEBOOK_VERSION = version.parse(notebook.__version__.split("+")[0])
  -    if NOTEBOOK_VERSION < version.parse("6.0.0"):
  +    if NOTEBOOK_VERSION < version.parse("6.0.0") and "google.colab" not in sys.modules:
  +        # google.colab check to fix issue #5315
           raise Exception(
               "Your Jupyter Notebook is too old. Please upgrade to version 6 or higher."
           )
  
verification_info: {"golden_diff": "diff --git a/src/syft/core/common/environment.py b/src/syft/core/common/environment.py\n--- a/src/syft/core/common/environment.py\n+++ b/src/syft/core/common/environment.py\n@@ -14,7 +14,8 @@\n     from packaging import version\n \n     NOTEBOOK_VERSION = version.parse(notebook.__version__.split(\"+\")[0])\n-    if NOTEBOOK_VERSION < version.parse(\"6.0.0\"):\n+    if NOTEBOOK_VERSION < version.parse(\"6.0.0\") and \"google.colab\" not in sys.modules:\n+        # google.colab check to fix issue #5315\n         raise Exception(\n             \"Your Jupyter Notebook is too old. Please upgrade to version 6 or higher.\"\n         )\n", "issue": "Check and Fix notebook / jupyter client warning on Colab\n## Description\r\nThis needs to be checked on Colab, since it seems colab has its own outdated versions of notebook and jupyter-client as well.\r\nhttps://github.com/OpenMined/PySyft/issues/4915\r\n\r\n## Definition of Done\r\nFix for Colab if possible.\n", "before_files": [{"content": "# stdlib\nimport sys\n\n# checks if we are in a python repl or python -i script.py\nis_interactive = bool(getattr(sys, \"ps1\", sys.flags.interactive))\n\n# checks if we are in jupyter\nis_jupyter = True\n\ntry:\n    get_ipython()  # type: ignore\n    # third party\n    import notebook\n    from packaging import version\n\n    NOTEBOOK_VERSION = version.parse(notebook.__version__.split(\"+\")[0])\n    if NOTEBOOK_VERSION < version.parse(\"6.0.0\"):\n        raise Exception(\n            \"Your Jupyter Notebook is too old. Please upgrade to version 6 or higher.\"\n        )\nexcept NameError:\n    is_jupyter = False\n\n__all__ = [\"is_interactive\", \"is_jupyter\"]\n", "path": "src/syft/core/common/environment.py"}]}