We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Warn about version mismatches
I found myself chasing ghosts in Bokeh this afternoon when I accidentally inlined the wrong JS version into our web application.  Perhaps Bokeh could try and detect when there are incompatible versions across the Python/JS interface?


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `scripts/version_update.py`
Content:
```
1 import os
2 import re
3 import sys
4 
5 
6 def check_input(new_ver):
7     """ Ensure that user input matches the format X.X.X """
8 
9     pat = r'\d+.\d+.\d+'
10     if not re.match(pat, new_ver):
11         print("The new version must be in the format X.X.X (ex. '0.6.0')")
12         return True
13 
14 
15 def version_update(new_ver, file_array):
16     """ Replace existing version/release number in an array of files
17         with a user-supplied version number (new_ver)"""
18 
19     pat = r"""(release|version)([\" ][:=] [\"\'])(\d+.\d+.\d+)([\"\'])"""
20 
21     # List that will contain any files where the version number was successfully replaced
22     replaced = []
23 
24     # Set as false until a match is found and replaced in the loop below
25     early_ver = False
26 
27     for ver_file in file_array:
28         f = open(ver_file)
29         text = f.read()
30         matchObj = re.search(pat, text)
31         f.close()
32 
33         if matchObj:
34             early_ver = matchObj.group(3)
35             f = open(ver_file, 'w')
36             text = re.sub(pat, r'\g<1>\g<2>%s\g<4>' % new_ver, text)
37             f.write(text)
38             replaced.append(ver_file)
39         else:
40             print("Unable to find version number matching expected format 'X.X.X' in %s" % ver_file)
41 
42     if early_ver:
43         print("Version number changed from %s to %s in \n%s" % (early_ver, new_ver, replaced))
44 
45 def version_add(old_ver, file_array):
46     """Add last version number in an array of files
47     with a user-supplied last version number"""
48     for ver_file in file_array:
49         with open(ver_file, "r") as f:
50             flines = f.readlines()
51             for i, line in enumerate(flines):
52                 if "ALL_VERSIONS" in line:
53                     all_vers = flines[i]
54                     begin, end = all_vers.split("[")
55                     all_vers = begin + "['{}', ".format(old_ver) + end
56                     flines[i] = all_vers
57         with open(ver_file, "w") as f:
58             f.writelines(flines)
59         print("Version number {old_ver} added in {ver_file}".format(old_ver=old_ver, ver_file=ver_file))
60 
61 if __name__ == '__main__':
62     if not len(sys.argv) == 3:
63         print("Please provide the new version number and the previous one.")
64         sys.exit(1)
65 
66     os.chdir('../')
67 
68     files_to_update = ['bokehjs/src/coffee/main.coffee', 'bokehjs/package.json']
69     files_to_add = ['sphinx/source/conf.py']
70     updated_version = sys.argv[1]
71     last_version = sys.argv[2]
72 
73     if check_input(updated_version):
74         sys.exit(1)
75 
76     version_update(updated_version, files_to_update)
77     version_add(last_version, files_to_add)
78
```

Path: `sphinx/source/conf.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
3 import os
4 
5 #
6 # Bokeh documentation build configuration file, created by
7 # sphinx-quickstart on Sat Oct 12 23:43:03 2013.
8 #
9 # This file is execfile()d with the current directory set to its containing dir.
10 #
11 # Note that not all possible configuration values are present in this
12 # autogenerated file.
13 #
14 # All configuration values have a default; values that are commented out
15 # serve to show the default.
16 
17 # If extensions (or modules to document with autodoc) are in another directory,
18 # add these directories to sys.path here. If the directory is relative to the
19 # documentation root, use os.path.abspath to make it absolute, like shown here.
20 #sys.path.insert(0, os.path.abspath('.'))
21 
22 # -- General configuration -----------------------------------------------------
23 
24 # If your documentation needs a minimal Sphinx version, state it here.
25 #needs_sphinx = '1.0'
26 
27 # Add any Sphinx extension module names here, as strings. They can be extensions
28 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
29 extensions = [
30     'sphinx.ext.autodoc',
31     'sphinx.ext.autosummary',
32     'sphinx.ext.graphviz',
33     'sphinx.ext.ifconfig',
34     'sphinx.ext.inheritance_diagram',
35     'sphinx.ext.napoleon',
36     'sphinx.ext.intersphinx',
37     'bokeh.sphinxext.bokeh_autodoc',
38     'bokeh.sphinxext.bokeh_gallery',
39     'bokeh.sphinxext.bokeh_github',
40     'bokeh.sphinxext.bokeh_jinja',
41     'bokeh.sphinxext.bokeh_model',
42     'bokeh.sphinxext.bokeh_palette',
43     'bokeh.sphinxext.bokeh_plot',
44     'bokeh.sphinxext.bokeh_prop',
45     'bokeh.sphinxext.bokeh_sitemap',
46     'bokeh.sphinxext.collapsible_code_block',
47 ]
48 
49 # Add any paths that contain templates here, relative to this directory.
50 templates_path = ['_templates']
51 
52 # The suffix of source filenames.
53 source_suffix = '.rst'
54 
55 # The encoding of source files.
56 #source_encoding = 'utf-8-sig'
57 
58 # The master toctree document.
59 master_doc = 'index'
60 
61 # General information about the project.
62 project = 'Bokeh'
63 copyright = '© Copyright 2015, Continuum Analytics.'
64 
65 # Get the standard computed Bokeh version string to use for |version|
66 # and |release|
67 from bokeh import __version__
68 
69 # The short X.Y version.
70 version = __version__
71 # The full version, including alpha/beta/rc tags.
72 release = __version__
73 
74 # Check for version override (e.g. when re-deploying a previously released
75 # docs, or when pushing test docs that do not have a corresponding BokehJS
76 # available on CDN)
77 from bokeh.settings import settings
78 if settings.docs_version():
79     version = release = settings.docs_version()
80 
81 # The language for content autogenerated by Sphinx. Refer to documentation
82 # for a list of supported languages.
83 #language = None
84 
85 # There are two options for replacing |today|: either, you set today to some
86 # non-false value, then it is used:
87 #today = ''
88 # Else, today_fmt is used as the format for a strftime call.
89 #today_fmt = '%B %d, %Y'
90 
91 # List of patterns, relative to source directory, that match files and
92 # directories to ignore when looking for source files.
93 exclude_patterns = ['_build']
94 
95 # The reST default role (used for this markup: `text`) to use for all documents.
96 #default_role = None
97 
98 # If true, '()' will be appended to :func: etc. cross-reference text.
99 #add_function_parentheses = True
100 
101 # If true, the current module name will be prepended to all description
102 # unit titles (such as .. function::).
103 add_module_names = False
104 
105 # If true, sectionauthor and moduleauthor directives will be shown in the
106 # output. They are ignored by default.
107 #show_authors = False
108 
109 # The name of the Pygments (syntax highlighting) style to use.
110 pygments_style = 'sphinx'
111 
112 # A list of ignored prefixes for module index sorting.
113 #modindex_common_prefix = []
114 
115 # Sort members by type
116 autodoc_member_order = 'groupwise'
117 
118 # -- Options for HTML output ---------------------------------------------------
119 
120 # The theme to use for HTML and HTML Help pages.  See the documentation for
121 # a list of builtin themes.
122 html_theme = 'bokeh_theme'
123 html_theme_path = ['.']
124 MAIN_SITE = '//bokehplots.com'
125 
126 html_context = {
127     'SITEMAP_BASE_URL': 'http://bokeh.pydata.org/en/', # Trailing slash is needed
128     'SITENAME': 'Bokeh Docs',
129     'DESCRIPTION': 'Bokeh visualization library, documentation site.',
130     'AUTHOR': 'Bokeh contributors',
131     'VERSION': version,
132     # Nav
133     'NAV': (
134         ('About', MAIN_SITE + '/pages/about-bokeh.html'),
135         ('Gallery', '/docs/gallery.html'),
136         ('Docs', '//bokeh.pydata.org/en/latest/'),
137         ('Github', '//github.com/bokeh/bokeh'),
138     ),
139     # Links
140     'LINKS': (
141         ('FAQs', MAIN_SITE + '/pages/faqs.html'),
142         ('Technical vision', MAIN_SITE + '/pages/technical-vision.html'),
143         ('Roadmap', MAIN_SITE + '/pages/roadmap.html'),
144         ('Citation', MAIN_SITE + '/pages/citation.html'),
145     ),
146     # About Links
147     'ABOUT': (
148         ('About', MAIN_SITE + '/pages/about-bokeh.html'),
149         ('Team', MAIN_SITE + '/pages/team.html'),
150         ('Contact', MAIN_SITE + '/pages/contact.html'),
151     ),
152     # Social links
153     'SOCIAL': (
154         ('Contribute', MAIN_SITE + '/pages/contribute.html'),
155         ('Mailing list', '//groups.google.com/a/continuum.io/forum/#!forum/bokeh'),
156         ('Github', '//github.com/bokeh/bokeh'),
157         ('Twitter', '//twitter.com/BokehPlots'),
158         ('YouTube', '//www.youtube.com/channel/UCK0rSk29mmg4UT4bIOvPYhw')
159     ),
160     # Links for the docs sub navigation
161     'NAV_DOCS': (
162         ('Installation', 'installation'),
163         ('User Guide', 'user_guide'),
164         ('Gallery', 'gallery'),
165         ('Reference', 'reference'),
166         ('Releases', 'releases/%s' % version),
167         ('Developer Guide', 'dev_guide'),
168     ),
169     'ALL_VERSIONS': ['0.12.0', '0.11.1', '0.11.0', '0.10.0', '0.9.3', '0.8.2'],
170     'css_server': os.environ.get('BOKEH_DOCS_CSS_SERVER', 'bokehplots.com'),
171 }
172 
173 # If true, links to the reST sources are added to the pages.
174 html_show_sourcelink = True
175 
176 # Output file base name for HTML help builder.
177 htmlhelp_basename = 'Bokehdoc'
178 
179 # -- Options for LaTeX output --------------------------------------------------
180 
181 latex_elements = {
182     # The paper size ('letterpaper' or 'a4paper').
183     #'papersize': 'letterpaper',
184 
185     # The font size ('10pt', '11pt' or '12pt').
186     #'pointsize': '10pt',
187 
188     # Additional stuff for the LaTeX preamble.
189     #'preamble': '',
190 }
191 
192 # Grouping the document tree into LaTeX files. List of tuples
193 # (source start file, target name, title, author, documentclass [howto/manual]).
194 latex_documents = [
195     ('index', 'Bokeh.tex', u'Bokeh Documentation', u'Continuum Analytics', 'manual'),
196 ]
197 
198 # The name of an image file (relative to this directory) to place at the top of
199 # the title page.
200 #latex_logo = None
201 
202 # For "manual" documents, if this is true, then toplevel headings are parts,
203 # not chapters.
204 #latex_use_parts = False
205 
206 # If true, show page references after internal links.
207 #latex_show_pagerefs = False
208 
209 # If true, show URL addresses after external links.
210 #latex_show_urls = False
211 
212 # Documents to append as an appendix to all manuals.
213 #latex_appendices = []
214 
215 # If false, no module index is generated.
216 #latex_domain_indices = True
217 
218 
219 # -- Options for manual page output --------------------------------------------
220 
221 # One entry per manual page. List of tuples
222 # (source start file, name, description, authors, manual section).
223 man_pages = [
224     ('index', 'bokeh', u'Bokeh Documentation',
225      [u'Continuum Analytics'], 1)
226 ]
227 
228 # If true, show URL addresses after external links.
229 #man_show_urls = False
230 
231 
232 # -- Options for Texinfo output ------------------------------------------------
233 
234 # Grouping the document tree into Texinfo files. List of tuples
235 # (source start file, target name, title, author,
236 #  dir menu entry, description, category)
237 texinfo_documents = [
238     ('index', 'Bokeh', u'Bokeh Documentation', u'Continuum Analytics', 'Bokeh', 'Interactive Web Plotting for Python', 'Graphics'),
239 ]
240 
241 # Documents to append as an appendix to all manuals.
242 #texinfo_appendices = []
243 
244 # If false, no module index is generated.
245 #texinfo_domain_indices = True
246 
247 # How to display URL addresses: 'footnote', 'no', or 'inline'.
248 #texinfo_show_urls = 'footnote'
249 
250 # intersphinx settings
251 intersphinx_mapping = {
252     'python': ('https://docs.python.org/', None),
253     'pandas': ('http://pandas.pydata.org/pandas-docs/stable/', None),
254     'numpy': ('http://docs.scipy.org/doc/numpy/', None)
255 }
256
```
--- 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()

```

diff --git a/scripts/version_update.py b/scripts/version_update.py
--- a/scripts/version_update.py
+++ b/scripts/version_update.py
@@ -42,7 +42,7 @@
     if early_ver:
         print("Version number changed from %s to %s in \n%s" % (early_ver, new_ver, replaced))
 
-def version_add(old_ver, file_array):
+def version_add(new_ver, file_array):
     """Add last version number in an array of files
     with a user-supplied last version number"""
     for ver_file in file_array:
@@ -52,11 +52,11 @@
                 if "ALL_VERSIONS" in line:
                     all_vers = flines[i]
                     begin, end = all_vers.split("[")
-                    all_vers = begin + "['{}', ".format(old_ver) + end
+                    all_vers = begin + "['{}', ".format(new_ver) + end
                     flines[i] = all_vers
         with open(ver_file, "w") as f:
             f.writelines(flines)
-        print("Version number {old_ver} added in {ver_file}".format(old_ver=old_ver, ver_file=ver_file))
+        print("Version number {new_ver} added in {ver_file}".format(new_ver=new_ver, ver_file=ver_file))
 
 if __name__ == '__main__':
     if not len(sys.argv) == 3:
@@ -65,7 +65,7 @@
 
     os.chdir('../')
 
-    files_to_update = ['bokehjs/src/coffee/main.coffee', 'bokehjs/package.json']
+    files_to_update = ['bokehjs/src/coffee/version.coffee', 'bokehjs/package.json']
     files_to_add = ['sphinx/source/conf.py']
     updated_version = sys.argv[1]
     last_version = sys.argv[2]
@@ -74,4 +74,4 @@
         sys.exit(1)
 
     version_update(updated_version, files_to_update)
-    version_add(last_version, files_to_add)
+    version_add(updated_version, files_to_add)
diff --git a/sphinx/source/conf.py b/sphinx/source/conf.py
--- a/sphinx/source/conf.py
+++ b/sphinx/source/conf.py
@@ -166,7 +166,7 @@
         ('Releases', 'releases/%s' % version),
         ('Developer Guide', 'dev_guide'),
     ),
-    'ALL_VERSIONS': ['0.12.0', '0.11.1', '0.11.0', '0.10.0', '0.9.3', '0.8.2'],
+    'ALL_VERSIONS': ['0.12.0', '0.11.0', '0.10.0', '0.9.3', '0.8.2'],
     'css_server': os.environ.get('BOKEH_DOCS_CSS_SERVER', 'bokehplots.com'),
 }

{"golden_diff": "diff --git a/scripts/version_update.py b/scripts/version_update.py\n--- a/scripts/version_update.py\n+++ b/scripts/version_update.py\n@@ -42,7 +42,7 @@\n     if early_ver:\n         print(\"Version number changed from %s to %s in \\n%s\" % (early_ver, new_ver, replaced))\n \n-def version_add(old_ver, file_array):\n+def version_add(new_ver, file_array):\n     \"\"\"Add last version number in an array of files\n     with a user-supplied last version number\"\"\"\n     for ver_file in file_array:\n@@ -52,11 +52,11 @@\n                 if \"ALL_VERSIONS\" in line:\n                     all_vers = flines[i]\n                     begin, end = all_vers.split(\"[\")\n-                    all_vers = begin + \"['{}', \".format(old_ver) + end\n+                    all_vers = begin + \"['{}', \".format(new_ver) + end\n                     flines[i] = all_vers\n         with open(ver_file, \"w\") as f:\n             f.writelines(flines)\n-        print(\"Version number {old_ver} added in {ver_file}\".format(old_ver=old_ver, ver_file=ver_file))\n+        print(\"Version number {new_ver} added in {ver_file}\".format(new_ver=new_ver, ver_file=ver_file))\n \n if __name__ == '__main__':\n     if not len(sys.argv) == 3:\n@@ -65,7 +65,7 @@\n \n     os.chdir('../')\n \n-    files_to_update = ['bokehjs/src/coffee/main.coffee', 'bokehjs/package.json']\n+    files_to_update = ['bokehjs/src/coffee/version.coffee', 'bokehjs/package.json']\n     files_to_add = ['sphinx/source/conf.py']\n     updated_version = sys.argv[1]\n     last_version = sys.argv[2]\n@@ -74,4 +74,4 @@\n         sys.exit(1)\n \n     version_update(updated_version, files_to_update)\n-    version_add(last_version, files_to_add)\n+    version_add(updated_version, files_to_add)\ndiff --git a/sphinx/source/conf.py b/sphinx/source/conf.py\n--- a/sphinx/source/conf.py\n+++ b/sphinx/source/conf.py\n@@ -166,7 +166,7 @@\n         ('Releases', 'releases/%s' % version),\n         ('Developer Guide', 'dev_guide'),\n     ),\n-    'ALL_VERSIONS': ['0.12.0', '0.11.1', '0.11.0', '0.10.0', '0.9.3', '0.8.2'],\n+    'ALL_VERSIONS': ['0.12.0', '0.11.0', '0.10.0', '0.9.3', '0.8.2'],\n     'css_server': os.environ.get('BOKEH_DOCS_CSS_SERVER', 'bokehplots.com'),\n }\n", "issue": "Warn about version mismatches\nI found myself chasing ghosts in Bokeh this afternoon when I accidentally inlined the wrong JS version into our web application.  Perhaps Bokeh could try and detect when there are incompatible versions across the Python/JS interface?\n\n", "before_files": [{"content": "import os\nimport re\nimport sys\n\n\ndef check_input(new_ver):\n    \"\"\" Ensure that user input matches the format X.X.X \"\"\"\n\n    pat = r'\\d+.\\d+.\\d+'\n    if not re.match(pat, new_ver):\n        print(\"The new version must be in the format X.X.X (ex. '0.6.0')\")\n        return True\n\n\ndef version_update(new_ver, file_array):\n    \"\"\" Replace existing version/release number in an array of files\n        with a user-supplied version number (new_ver)\"\"\"\n\n    pat = r\"\"\"(release|version)([\\\" ][:=] [\\\"\\'])(\\d+.\\d+.\\d+)([\\\"\\'])\"\"\"\n\n    # List that will contain any files where the version number was successfully replaced\n    replaced = []\n\n    # Set as false until a match is found and replaced in the loop below\n    early_ver = False\n\n    for ver_file in file_array:\n        f = open(ver_file)\n        text = f.read()\n        matchObj = re.search(pat, text)\n        f.close()\n\n        if matchObj:\n            early_ver = matchObj.group(3)\n            f = open(ver_file, 'w')\n            text = re.sub(pat, r'\\g<1>\\g<2>%s\\g<4>' % new_ver, text)\n            f.write(text)\n            replaced.append(ver_file)\n        else:\n            print(\"Unable to find version number matching expected format 'X.X.X' in %s\" % ver_file)\n\n    if early_ver:\n        print(\"Version number changed from %s to %s in \\n%s\" % (early_ver, new_ver, replaced))\n\ndef version_add(old_ver, file_array):\n    \"\"\"Add last version number in an array of files\n    with a user-supplied last version number\"\"\"\n    for ver_file in file_array:\n        with open(ver_file, \"r\") as f:\n            flines = f.readlines()\n            for i, line in enumerate(flines):\n                if \"ALL_VERSIONS\" in line:\n                    all_vers = flines[i]\n                    begin, end = all_vers.split(\"[\")\n                    all_vers = begin + \"['{}', \".format(old_ver) + end\n                    flines[i] = all_vers\n        with open(ver_file, \"w\") as f:\n            f.writelines(flines)\n        print(\"Version number {old_ver} added in {ver_file}\".format(old_ver=old_ver, ver_file=ver_file))\n\nif __name__ == '__main__':\n    if not len(sys.argv) == 3:\n        print(\"Please provide the new version number and the previous one.\")\n        sys.exit(1)\n\n    os.chdir('../')\n\n    files_to_update = ['bokehjs/src/coffee/main.coffee', 'bokehjs/package.json']\n    files_to_add = ['sphinx/source/conf.py']\n    updated_version = sys.argv[1]\n    last_version = sys.argv[2]\n\n    if check_input(updated_version):\n        sys.exit(1)\n\n    version_update(updated_version, files_to_update)\n    version_add(last_version, files_to_add)\n", "path": "scripts/version_update.py"}, {"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nimport os\n\n#\n# Bokeh documentation build configuration file, created by\n# sphinx-quickstart on Sat Oct 12 23:43:03 2013.\n#\n# This file is execfile()d with the current directory set to its containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#sys.path.insert(0, os.path.abspath('.'))\n\n# -- General configuration -----------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be extensions\n# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.\nextensions = [\n    'sphinx.ext.autodoc',\n    'sphinx.ext.autosummary',\n    'sphinx.ext.graphviz',\n    'sphinx.ext.ifconfig',\n    'sphinx.ext.inheritance_diagram',\n    'sphinx.ext.napoleon',\n    'sphinx.ext.intersphinx',\n    'bokeh.sphinxext.bokeh_autodoc',\n    'bokeh.sphinxext.bokeh_gallery',\n    'bokeh.sphinxext.bokeh_github',\n    'bokeh.sphinxext.bokeh_jinja',\n    'bokeh.sphinxext.bokeh_model',\n    'bokeh.sphinxext.bokeh_palette',\n    'bokeh.sphinxext.bokeh_plot',\n    'bokeh.sphinxext.bokeh_prop',\n    'bokeh.sphinxext.bokeh_sitemap',\n    'bokeh.sphinxext.collapsible_code_block',\n]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix of source filenames.\nsource_suffix = '.rst'\n\n# The encoding of source files.\n#source_encoding = 'utf-8-sig'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = 'Bokeh'\ncopyright = '\u00a9 Copyright 2015, Continuum Analytics.'\n\n# Get the standard computed Bokeh version string to use for |version|\n# and |release|\nfrom bokeh import __version__\n\n# The short X.Y version.\nversion = __version__\n# The full version, including alpha/beta/rc tags.\nrelease = __version__\n\n# Check for version override (e.g. when re-deploying a previously released\n# docs, or when pushing test docs that do not have a corresponding BokehJS\n# available on CDN)\nfrom bokeh.settings import settings\nif settings.docs_version():\n    version = release = settings.docs_version()\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#language = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = ['_build']\n\n# The reST default role (used for this markup: `text`) to use for all documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n#add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\nadd_module_names = False\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n# Sort members by type\nautodoc_member_order = 'groupwise'\n\n# -- Options for HTML output ---------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\nhtml_theme = 'bokeh_theme'\nhtml_theme_path = ['.']\nMAIN_SITE = '//bokehplots.com'\n\nhtml_context = {\n    'SITEMAP_BASE_URL': 'http://bokeh.pydata.org/en/', # Trailing slash is needed\n    'SITENAME': 'Bokeh Docs',\n    'DESCRIPTION': 'Bokeh visualization library, documentation site.',\n    'AUTHOR': 'Bokeh contributors',\n    'VERSION': version,\n    # Nav\n    'NAV': (\n        ('About', MAIN_SITE + '/pages/about-bokeh.html'),\n        ('Gallery', '/docs/gallery.html'),\n        ('Docs', '//bokeh.pydata.org/en/latest/'),\n        ('Github', '//github.com/bokeh/bokeh'),\n    ),\n    # Links\n    'LINKS': (\n        ('FAQs', MAIN_SITE + '/pages/faqs.html'),\n        ('Technical vision', MAIN_SITE + '/pages/technical-vision.html'),\n        ('Roadmap', MAIN_SITE + '/pages/roadmap.html'),\n        ('Citation', MAIN_SITE + '/pages/citation.html'),\n    ),\n    # About Links\n    'ABOUT': (\n        ('About', MAIN_SITE + '/pages/about-bokeh.html'),\n        ('Team', MAIN_SITE + '/pages/team.html'),\n        ('Contact', MAIN_SITE + '/pages/contact.html'),\n    ),\n    # Social links\n    'SOCIAL': (\n        ('Contribute', MAIN_SITE + '/pages/contribute.html'),\n        ('Mailing list', '//groups.google.com/a/continuum.io/forum/#!forum/bokeh'),\n        ('Github', '//github.com/bokeh/bokeh'),\n        ('Twitter', '//twitter.com/BokehPlots'),\n        ('YouTube', '//www.youtube.com/channel/UCK0rSk29mmg4UT4bIOvPYhw')\n    ),\n    # Links for the docs sub navigation\n    'NAV_DOCS': (\n        ('Installation', 'installation'),\n        ('User Guide', 'user_guide'),\n        ('Gallery', 'gallery'),\n        ('Reference', 'reference'),\n        ('Releases', 'releases/%s' % version),\n        ('Developer Guide', 'dev_guide'),\n    ),\n    'ALL_VERSIONS': ['0.12.0', '0.11.1', '0.11.0', '0.10.0', '0.9.3', '0.8.2'],\n    'css_server': os.environ.get('BOKEH_DOCS_CSS_SERVER', 'bokehplots.com'),\n}\n\n# If true, links to the reST sources are added to the pages.\nhtml_show_sourcelink = True\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'Bokehdoc'\n\n# -- Options for LaTeX output --------------------------------------------------\n\nlatex_elements = {\n    # The paper size ('letterpaper' or 'a4paper').\n    #'papersize': 'letterpaper',\n\n    # The font size ('10pt', '11pt' or '12pt').\n    #'pointsize': '10pt',\n\n    # Additional stuff for the LaTeX preamble.\n    #'preamble': '',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title, author, documentclass [howto/manual]).\nlatex_documents = [\n    ('index', 'Bokeh.tex', u'Bokeh Documentation', u'Continuum Analytics', 'manual'),\n]\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#latex_use_parts = False\n\n# If true, show page references after internal links.\n#latex_show_pagerefs = False\n\n# If true, show URL addresses after external links.\n#latex_show_urls = False\n\n# Documents to append as an appendix to all manuals.\n#latex_appendices = []\n\n# If false, no module index is generated.\n#latex_domain_indices = True\n\n\n# -- Options for manual page output --------------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n    ('index', 'bokeh', u'Bokeh Documentation',\n     [u'Continuum Analytics'], 1)\n]\n\n# If true, show URL addresses after external links.\n#man_show_urls = False\n\n\n# -- Options for Texinfo output ------------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n#  dir menu entry, description, category)\ntexinfo_documents = [\n    ('index', 'Bokeh', u'Bokeh Documentation', u'Continuum Analytics', 'Bokeh', 'Interactive Web Plotting for Python', 'Graphics'),\n]\n\n# Documents to append as an appendix to all manuals.\n#texinfo_appendices = []\n\n# If false, no module index is generated.\n#texinfo_domain_indices = True\n\n# How to display URL addresses: 'footnote', 'no', or 'inline'.\n#texinfo_show_urls = 'footnote'\n\n# intersphinx settings\nintersphinx_mapping = {\n    'python': ('https://docs.python.org/', None),\n    'pandas': ('http://pandas.pydata.org/pandas-docs/stable/', None),\n    'numpy': ('http://docs.scipy.org/doc/numpy/', None)\n}\n", "path": "sphinx/source/conf.py"}], "after_files": [{"content": "import os\nimport re\nimport sys\n\n\ndef check_input(new_ver):\n    \"\"\" Ensure that user input matches the format X.X.X \"\"\"\n\n    pat = r'\\d+.\\d+.\\d+'\n    if not re.match(pat, new_ver):\n        print(\"The new version must be in the format X.X.X (ex. '0.6.0')\")\n        return True\n\n\ndef version_update(new_ver, file_array):\n    \"\"\" Replace existing version/release number in an array of files\n        with a user-supplied version number (new_ver)\"\"\"\n\n    pat = r\"\"\"(release|version)([\\\" ][:=] [\\\"\\'])(\\d+.\\d+.\\d+)([\\\"\\'])\"\"\"\n\n    # List that will contain any files where the version number was successfully replaced\n    replaced = []\n\n    # Set as false until a match is found and replaced in the loop below\n    early_ver = False\n\n    for ver_file in file_array:\n        f = open(ver_file)\n        text = f.read()\n        matchObj = re.search(pat, text)\n        f.close()\n\n        if matchObj:\n            early_ver = matchObj.group(3)\n            f = open(ver_file, 'w')\n            text = re.sub(pat, r'\\g<1>\\g<2>%s\\g<4>' % new_ver, text)\n            f.write(text)\n            replaced.append(ver_file)\n        else:\n            print(\"Unable to find version number matching expected format 'X.X.X' in %s\" % ver_file)\n\n    if early_ver:\n        print(\"Version number changed from %s to %s in \\n%s\" % (early_ver, new_ver, replaced))\n\ndef version_add(new_ver, file_array):\n    \"\"\"Add last version number in an array of files\n    with a user-supplied last version number\"\"\"\n    for ver_file in file_array:\n        with open(ver_file, \"r\") as f:\n            flines = f.readlines()\n            for i, line in enumerate(flines):\n                if \"ALL_VERSIONS\" in line:\n                    all_vers = flines[i]\n                    begin, end = all_vers.split(\"[\")\n                    all_vers = begin + \"['{}', \".format(new_ver) + end\n                    flines[i] = all_vers\n        with open(ver_file, \"w\") as f:\n            f.writelines(flines)\n        print(\"Version number {new_ver} added in {ver_file}\".format(new_ver=new_ver, ver_file=ver_file))\n\nif __name__ == '__main__':\n    if not len(sys.argv) == 3:\n        print(\"Please provide the new version number and the previous one.\")\n        sys.exit(1)\n\n    os.chdir('../')\n\n    files_to_update = ['bokehjs/src/coffee/version.coffee', 'bokehjs/package.json']\n    files_to_add = ['sphinx/source/conf.py']\n    updated_version = sys.argv[1]\n    last_version = sys.argv[2]\n\n    if check_input(updated_version):\n        sys.exit(1)\n\n    version_update(updated_version, files_to_update)\n    version_add(updated_version, files_to_add)\n", "path": "scripts/version_update.py"}, {"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nimport os\n\n#\n# Bokeh documentation build configuration file, created by\n# sphinx-quickstart on Sat Oct 12 23:43:03 2013.\n#\n# This file is execfile()d with the current directory set to its containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#sys.path.insert(0, os.path.abspath('.'))\n\n# -- General configuration -----------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be extensions\n# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.\nextensions = [\n    'sphinx.ext.autodoc',\n    'sphinx.ext.autosummary',\n    'sphinx.ext.graphviz',\n    'sphinx.ext.ifconfig',\n    'sphinx.ext.inheritance_diagram',\n    'sphinx.ext.napoleon',\n    'sphinx.ext.intersphinx',\n    'bokeh.sphinxext.bokeh_autodoc',\n    'bokeh.sphinxext.bokeh_gallery',\n    'bokeh.sphinxext.bokeh_github',\n    'bokeh.sphinxext.bokeh_jinja',\n    'bokeh.sphinxext.bokeh_model',\n    'bokeh.sphinxext.bokeh_palette',\n    'bokeh.sphinxext.bokeh_plot',\n    'bokeh.sphinxext.bokeh_prop',\n    'bokeh.sphinxext.bokeh_sitemap',\n    'bokeh.sphinxext.collapsible_code_block',\n]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix of source filenames.\nsource_suffix = '.rst'\n\n# The encoding of source files.\n#source_encoding = 'utf-8-sig'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = 'Bokeh'\ncopyright = '\u00a9 Copyright 2015, Continuum Analytics.'\n\n# Get the standard computed Bokeh version string to use for |version|\n# and |release|\nfrom bokeh import __version__\n\n# The short X.Y version.\nversion = __version__\n# The full version, including alpha/beta/rc tags.\nrelease = __version__\n\n# Check for version override (e.g. when re-deploying a previously released\n# docs, or when pushing test docs that do not have a corresponding BokehJS\n# available on CDN)\nfrom bokeh.settings import settings\nif settings.docs_version():\n    version = release = settings.docs_version()\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#language = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = ['_build']\n\n# The reST default role (used for this markup: `text`) to use for all documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n#add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\nadd_module_names = False\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n# Sort members by type\nautodoc_member_order = 'groupwise'\n\n# -- Options for HTML output ---------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\nhtml_theme = 'bokeh_theme'\nhtml_theme_path = ['.']\nMAIN_SITE = '//bokehplots.com'\n\nhtml_context = {\n    'SITEMAP_BASE_URL': 'http://bokeh.pydata.org/en/', # Trailing slash is needed\n    'SITENAME': 'Bokeh Docs',\n    'DESCRIPTION': 'Bokeh visualization library, documentation site.',\n    'AUTHOR': 'Bokeh contributors',\n    'VERSION': version,\n    # Nav\n    'NAV': (\n        ('About', MAIN_SITE + '/pages/about-bokeh.html'),\n        ('Gallery', '/docs/gallery.html'),\n        ('Docs', '//bokeh.pydata.org/en/latest/'),\n        ('Github', '//github.com/bokeh/bokeh'),\n    ),\n    # Links\n    'LINKS': (\n        ('FAQs', MAIN_SITE + '/pages/faqs.html'),\n        ('Technical vision', MAIN_SITE + '/pages/technical-vision.html'),\n        ('Roadmap', MAIN_SITE + '/pages/roadmap.html'),\n        ('Citation', MAIN_SITE + '/pages/citation.html'),\n    ),\n    # About Links\n    'ABOUT': (\n        ('About', MAIN_SITE + '/pages/about-bokeh.html'),\n        ('Team', MAIN_SITE + '/pages/team.html'),\n        ('Contact', MAIN_SITE + '/pages/contact.html'),\n    ),\n    # Social links\n    'SOCIAL': (\n        ('Contribute', MAIN_SITE + '/pages/contribute.html'),\n        ('Mailing list', '//groups.google.com/a/continuum.io/forum/#!forum/bokeh'),\n        ('Github', '//github.com/bokeh/bokeh'),\n        ('Twitter', '//twitter.com/BokehPlots'),\n        ('YouTube', '//www.youtube.com/channel/UCK0rSk29mmg4UT4bIOvPYhw')\n    ),\n    # Links for the docs sub navigation\n    'NAV_DOCS': (\n        ('Installation', 'installation'),\n        ('User Guide', 'user_guide'),\n        ('Gallery', 'gallery'),\n        ('Reference', 'reference'),\n        ('Releases', 'releases/%s' % version),\n        ('Developer Guide', 'dev_guide'),\n    ),\n    'ALL_VERSIONS': ['0.12.0', '0.11.0', '0.10.0', '0.9.3', '0.8.2'],\n    'css_server': os.environ.get('BOKEH_DOCS_CSS_SERVER', 'bokehplots.com'),\n}\n\n# If true, links to the reST sources are added to the pages.\nhtml_show_sourcelink = True\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'Bokehdoc'\n\n# -- Options for LaTeX output --------------------------------------------------\n\nlatex_elements = {\n    # The paper size ('letterpaper' or 'a4paper').\n    #'papersize': 'letterpaper',\n\n    # The font size ('10pt', '11pt' or '12pt').\n    #'pointsize': '10pt',\n\n    # Additional stuff for the LaTeX preamble.\n    #'preamble': '',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title, author, documentclass [howto/manual]).\nlatex_documents = [\n    ('index', 'Bokeh.tex', u'Bokeh Documentation', u'Continuum Analytics', 'manual'),\n]\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#latex_use_parts = False\n\n# If true, show page references after internal links.\n#latex_show_pagerefs = False\n\n# If true, show URL addresses after external links.\n#latex_show_urls = False\n\n# Documents to append as an appendix to all manuals.\n#latex_appendices = []\n\n# If false, no module index is generated.\n#latex_domain_indices = True\n\n\n# -- Options for manual page output --------------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n    ('index', 'bokeh', u'Bokeh Documentation',\n     [u'Continuum Analytics'], 1)\n]\n\n# If true, show URL addresses after external links.\n#man_show_urls = False\n\n\n# -- Options for Texinfo output ------------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n#  dir menu entry, description, category)\ntexinfo_documents = [\n    ('index', 'Bokeh', u'Bokeh Documentation', u'Continuum Analytics', 'Bokeh', 'Interactive Web Plotting for Python', 'Graphics'),\n]\n\n# Documents to append as an appendix to all manuals.\n#texinfo_appendices = []\n\n# If false, no module index is generated.\n#texinfo_domain_indices = True\n\n# How to display URL addresses: 'footnote', 'no', or 'inline'.\n#texinfo_show_urls = 'footnote'\n\n# intersphinx settings\nintersphinx_mapping = {\n    'python': ('https://docs.python.org/', None),\n    'pandas': ('http://pandas.pydata.org/pandas-docs/stable/', None),\n    'numpy': ('http://docs.scipy.org/doc/numpy/', None)\n}\n", "path": "sphinx/source/conf.py"}]}