prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  jsonschema.SchemaError when  a figure  is validated
  Here is a minimal example that reproduces the bug: http://nbviewer.jupyter.org/gist/empet/cf922d7c7f4269d6f63432ec67a5d020
  
  The notebook runs OK (with plotly 2.0.1) when I call `plot(fig)`. `iplot(fig)` generates the plot too, but an error box pops up whenever Jupyter tries to save the notebook.  The box has the following content:
  
  _The save operation succeeded, but the notebook does not appear to be valid. The validation error was:
  Notebook Validation failed_:
  `u'data': [{u'colorscale': u'Viridis', u'z': [[2, 27, 105, 100], [87, 14, 121, 102], [26, 121, 73, 34], [44, 105, 111, 127]], u'type': u'heatmap', u'zsmooth': u'best'}], u'layout': {u'width': 400, u'height': 400}}` _is not valid under any of the given schemas_:
  
  `{
   "data": [
    {
     "colorscale": "Viridis",
     "z": [
      [
       2,
       27,
       105,
       100
      ],
      [
       87,
       14,
       121,
       102
      ],
      [
       26,
       121,
       73,
       34
      ],
      [
       44,
       105,
       111,
       127
      ]
     ],
     "type": "heatmap",
     "zsmooth": "best"
    }
   ],
   "layout": {
    "width": 400,
    "height": 400
   }
  }`
  
  Initially I formulated this issue only for heatmaps, but meanwhile I realized that this behaviour manifests for any type of  plot.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `setup.py`
  Content:
  ```
  1 from setuptools import setup
  2 
  3 exec (open('plotly/version.py').read())
  4 
  5 
  6 def readme():
  7     with open('README.rst') as f:
  8         return f.read()
  9 
  10 
  11 setup(name='plotly',
  12       version=__version__,
  13       use_2to3=False,
  14       author='Chris P',
  15       author_email='chris@plot.ly',
  16       maintainer='Chris P',
  17       maintainer_email='chris@plot.ly',
  18       url='https://plot.ly/python/',
  19       description="Python plotting library for collaborative, "
  20                   "interactive, publication-quality graphs.",
  21       long_description=readme(),
  22       classifiers=[
  23           'Development Status :: 4 - Beta',
  24           'Programming Language :: Python :: 2',
  25           'Programming Language :: Python :: 2.7',
  26           'Programming Language :: Python :: 3',
  27           'Programming Language :: Python :: 3.3',
  28           'Programming Language :: Python :: 3.4',
  29           'Programming Language :: Python :: 3.5',
  30           'Topic :: Scientific/Engineering :: Visualization',
  31       ],
  32       license='MIT',
  33       packages=['plotly',
  34                 'plotly/api',
  35                 'plotly/api/v1',
  36                 'plotly/api/v2',
  37                 'plotly/plotly',
  38                 'plotly/plotly/chunked_requests',
  39                 'plotly/figure_factory',
  40                 'plotly/graph_objs',
  41                 'plotly/grid_objs',
  42                 'plotly/widgets',
  43                 'plotly/offline',
  44                 'plotly/matplotlylib',
  45                 'plotly/matplotlylib/mplexporter',
  46                 'plotly/matplotlylib/mplexporter/renderers'],
  47       package_data={'plotly': ['package_data/*']},
  48       install_requires=['decorator', 'requests', 'six', 'pytz'],
  49       zip_safe=False)
  50
  ```
  --- 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/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -45,5 +45,9 @@
                   'plotly/matplotlylib/mplexporter',
                   'plotly/matplotlylib/mplexporter/renderers'],
         package_data={'plotly': ['package_data/*']},
  -      install_requires=['decorator', 'requests', 'six', 'pytz'],
  +      install_requires=['decorator',
  +                        'nbformat>=4.2',
  +                        'pytz',
  +                        'requests',
  +                        'six'],
         zip_safe=False)
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -45,5 +45,9 @@\n                 'plotly/matplotlylib/mplexporter',\n                 'plotly/matplotlylib/mplexporter/renderers'],\n       package_data={'plotly': ['package_data/*']},\n-      install_requires=['decorator', 'requests', 'six', 'pytz'],\n+      install_requires=['decorator',\n+                        'nbformat>=4.2',\n+                        'pytz',\n+                        'requests',\n+                        'six'],\n       zip_safe=False)\n", "issue": "jsonschema.SchemaError when  a figure  is validated\nHere is a minimal example that reproduces the bug: http://nbviewer.jupyter.org/gist/empet/cf922d7c7f4269d6f63432ec67a5d020\r\n\r\nThe notebook runs OK (with plotly 2.0.1) when I call `plot(fig)`. `iplot(fig)` generates the plot too, but an error box pops up whenever Jupyter tries to save the notebook.  The box has the following content:\r\n\r\n_The save operation succeeded, but the notebook does not appear to be valid. The validation error was:\r\nNotebook Validation failed_:\r\n`u'data': [{u'colorscale': u'Viridis', u'z': [[2, 27, 105, 100], [87, 14, 121, 102], [26, 121, 73, 34], [44, 105, 111, 127]], u'type': u'heatmap', u'zsmooth': u'best'}], u'layout': {u'width': 400, u'height': 400}}` _is not valid under any of the given schemas_:\r\n\r\n`{\r\n \"data\": [\r\n  {\r\n   \"colorscale\": \"Viridis\",\r\n   \"z\": [\r\n    [\r\n     2,\r\n     27,\r\n     105,\r\n     100\r\n    ],\r\n    [\r\n     87,\r\n     14,\r\n     121,\r\n     102\r\n    ],\r\n    [\r\n     26,\r\n     121,\r\n     73,\r\n     34\r\n    ],\r\n    [\r\n     44,\r\n     105,\r\n     111,\r\n     127\r\n    ]\r\n   ],\r\n   \"type\": \"heatmap\",\r\n   \"zsmooth\": \"best\"\r\n  }\r\n ],\r\n \"layout\": {\r\n  \"width\": 400,\r\n  \"height\": 400\r\n }\r\n}`\r\n\r\nInitially I formulated this issue only for heatmaps, but meanwhile I realized that this behaviour manifests for any type of  plot.\n", "before_files": [{"content": "from setuptools import setup\n\nexec (open('plotly/version.py').read())\n\n\ndef readme():\n    with open('README.rst') as f:\n        return f.read()\n\n\nsetup(name='plotly',\n      version=__version__,\n      use_2to3=False,\n      author='Chris P',\n      author_email='chris@plot.ly',\n      maintainer='Chris P',\n      maintainer_email='chris@plot.ly',\n      url='https://plot.ly/python/',\n      description=\"Python plotting library for collaborative, \"\n                  \"interactive, publication-quality graphs.\",\n      long_description=readme(),\n      classifiers=[\n          'Development Status :: 4 - Beta',\n          'Programming Language :: Python :: 2',\n          'Programming Language :: Python :: 2.7',\n          'Programming Language :: Python :: 3',\n          'Programming Language :: Python :: 3.3',\n          'Programming Language :: Python :: 3.4',\n          'Programming Language :: Python :: 3.5',\n          'Topic :: Scientific/Engineering :: Visualization',\n      ],\n      license='MIT',\n      packages=['plotly',\n                'plotly/api',\n                'plotly/api/v1',\n                'plotly/api/v2',\n                'plotly/plotly',\n                'plotly/plotly/chunked_requests',\n                'plotly/figure_factory',\n                'plotly/graph_objs',\n                'plotly/grid_objs',\n                'plotly/widgets',\n                'plotly/offline',\n                'plotly/matplotlylib',\n                'plotly/matplotlylib/mplexporter',\n                'plotly/matplotlylib/mplexporter/renderers'],\n      package_data={'plotly': ['package_data/*']},\n      install_requires=['decorator', 'requests', 'six', 'pytz'],\n      zip_safe=False)\n", "path": "setup.py"}], "after_files": [{"content": "from setuptools import setup\n\nexec (open('plotly/version.py').read())\n\n\ndef readme():\n    with open('README.rst') as f:\n        return f.read()\n\n\nsetup(name='plotly',\n      version=__version__,\n      use_2to3=False,\n      author='Chris P',\n      author_email='chris@plot.ly',\n      maintainer='Chris P',\n      maintainer_email='chris@plot.ly',\n      url='https://plot.ly/python/',\n      description=\"Python plotting library for collaborative, \"\n                  \"interactive, publication-quality graphs.\",\n      long_description=readme(),\n      classifiers=[\n          'Development Status :: 4 - Beta',\n          'Programming Language :: Python :: 2',\n          'Programming Language :: Python :: 2.7',\n          'Programming Language :: Python :: 3',\n          'Programming Language :: Python :: 3.3',\n          'Programming Language :: Python :: 3.4',\n          'Programming Language :: Python :: 3.5',\n          'Topic :: Scientific/Engineering :: Visualization',\n      ],\n      license='MIT',\n      packages=['plotly',\n                'plotly/api',\n                'plotly/api/v1',\n                'plotly/api/v2',\n                'plotly/plotly',\n                'plotly/plotly/chunked_requests',\n                'plotly/figure_factory',\n                'plotly/graph_objs',\n                'plotly/grid_objs',\n                'plotly/widgets',\n                'plotly/offline',\n                'plotly/matplotlylib',\n                'plotly/matplotlylib/mplexporter',\n                'plotly/matplotlylib/mplexporter/renderers'],\n      package_data={'plotly': ['package_data/*']},\n      install_requires=['decorator',\n                        'nbformat>=4.2',\n                        'pytz',\n                        'requests',\n                        'six'],\n      zip_safe=False)\n", "path": "setup.py"}]}