prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN 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.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/syft/core/common/environment.py`
  Content:
  ```
  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 FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
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"}], "after_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\") 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        )\nexcept NameError:\n    is_jupyter = False\n\n__all__ = [\"is_interactive\", \"is_jupyter\"]\n", "path": "src/syft/core/common/environment.py"}]}