We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
remove requests as runtime dependency?
This only seems to be used for one sampledata download, in which case we should find a different way to grab the data with stdlib functions and remove the dependency.

ping @mattpap 

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `bokeh/sampledata/daylight.py`
Content:
```
1 """ Daylight hours from http://www.sunrisesunset.com
2 
3 """
4 from __future__ import absolute_import
5 
6 from bokeh.util.dependencies import import_required
7 pd = import_required('pandas',
8               'daylight sample data requires Pandas (http://pandas.pydata.org) to be installed')
9 
10 import re
11 import datetime
12 import requests
13 
14 from six.moves import xrange
15 from os.path import join, abspath, dirname
16 
17 url = "http://sunrisesunset.com/calendar.asp"
18 
19 r0 = re.compile("<[^>]+>|&nbsp;|[\r\n\t]")
20 r1 = re.compile(r"(\d+)(DST Begins|DST Ends)?Sunrise: (\d+):(\d\d)Sunset: (\d+):(\d\d)")
21 
22 def fetch_daylight_hours(lat, lon, tz, dst, year):
23     """Fetch daylight hours from sunrisesunset.com for a given location.
24 
25        Parameters
26        ----------
27        lat  : float
28            Location's latitude.
29        lon  : float
30            Location's longitude.
31        tz   : int or float
32            Time zone offset from UTC. Use floats for half-hour time zones.
33        dst  : int
34            Daylight saving type, e.g. 0 -> none, 1 -> North America, 2 -> Europe.
35            See sunrisesunset.com/custom.asp for other possible values.
36        year : int
37            Year (1901..2099).
38     """
39     daylight = []
40     summer = 0 if lat >= 0 else 1
41 
42     for month in xrange(1, 12+1):
43         args = dict(url=url, lat=lat, lon=lon, tz=tz, dst=dst, year=year, month=month)
44         response = requests.get("%(url)s?comb_city_info=_;%(lon)s;%(lat)s;%(tz)s;%(dst)s&month=%(month)s&year=%(year)s&time_type=1&wadj=1" % args)
45         entries = r1.findall(r0.sub("", response.text))
46 
47         for day, note, sunrise_hour, sunrise_minute, sunset_hour, sunset_minute in entries:
48             if note == "DST Begins":
49                 summer = 1
50             elif note == "DST Ends":
51                 summer = 0
52 
53             date = datetime.date(year, month, int(day))
54             sunrise = datetime.time(int(sunrise_hour), int(sunrise_minute))
55             sunset = datetime.time(int(sunset_hour), int(sunset_minute))
56 
57             daylight.append([date, sunrise, sunset, summer])
58 
59     return pd.DataFrame(daylight, columns=["Date", "Sunrise", "Sunset", "Summer"])
60 
61 # daylight_warsaw_2013 = fetch_daylight_hours(52.2297, -21.0122, 1, 2, 2013)
62 # daylight_warsaw_2013.to_csv("bokeh/sampledata/daylight_warsaw_2013.csv", index=False)
63 
64 def load_daylight_hours(file):
65     path = join(dirname(abspath(__file__)), file)
66     df = pd.read_csv(path, parse_dates=["Date", "Sunrise", "Sunset"])
67 
68     df["Date"] = df.Date.map(lambda x: x.date())
69     df["Sunrise"] = df.Sunrise.map(lambda x: x.time())
70     df["Sunset"] = df.Sunset.map(lambda x: x.time())
71 
72     return df
73 
74 daylight_warsaw_2013 = load_daylight_hours("daylight_warsaw_2013.csv")
75
```

Path: `setup.py`
Content:
```
1 #-----------------------------------------------------------------------------
2 # Copyright (c) 2012 - 2017, Continuum Analytics, Inc. All rights reserved.
3 #
4 # Powered by the Bokeh Development Team.
5 #
6 # The full license is in the file LICENSE.txt, distributed with this software.
7 #-----------------------------------------------------------------------------
8 ''' Setup script for Bokeh.
9 
10 Two separate components comprise Bokeh:
11 
12 * A JavaScript runtime BokehJS that draws and handles events in browsers
13 * Python "bindings" and an optional server for interacting with BokehJS
14 
15 The BokehJS library is written in a mixture of CoffeeScript, TypeScript, and
16 pure JavaScript. This necessitates a "compilation" step to build a complete
17 BokehJS from these sources, and this fact makes the Bokeh setup and install
18 more complicated than typical pure Python projects.
19 
20 In order to build BokehJS, the first step is to make sure that the "npm"
21 command is installed. If you are using conda, you can typically just run
22 
23     conda install -c bokeh nodejs
24 
25 Othewise, you can find general instructions for installing NodeJS here:
26 
27     https://nodejs.org/en/download/
28 
29 Once you have "npm" installed, this script can be used to build BokehJS
30 from the ``bokehjs`` source subdirectory, and install Bokeh into the python
31 source package by issuing the command:
32 
33     python setup.py install --build-js
34 
35 The script also supports the standard "develop" mode that setuptools offers:
36 
37     python setup.py develop --build-js
38 
39 It can take a few minutes for BokehJS to build, if you are not making changes
40 to the BokehJS source code, then you only need to build it once, the first
41 time. Subsequence invocations can be made to install the previously built
42 BokehJS from the ``bokehjs`` source subdirectoruy with the ``--install-js``
43 option, e.g:
44 
45     python setup.py develop --install-js
46 
47 It is also possible to build BokehJS "by hand" under the ``bokehjs`` source
48 subdirectory. In this case, to simply install the build BokehJS quickly into
49 the python source tree, the following command may be issued:
50 
51     python setup.py --install-js
52 
53 This will copy BokehJS from the ``bokehjs`` source directory, into the python
54 package directory, and perform no other actions.
55 
56 Note that source distributions (sdists) are published with a pre-built BokehJS
57 included inside the python package, and do not include the ``bokehjs`` source.
58 The ``--build-js`` and ``-install-js`` options are not valid when running from
59 an sdist. They will be ignored, and warning printed.
60 
61 '''
62 from os.path import join
63 from shutil import copy
64 import sys
65 
66 from setuptools import find_packages, setup
67 
68 from _setup_support import (
69     build_or_install_bokehjs, conda_rendering, fixup_building_sdist,
70     fixup_for_packaged, get_cmdclass, get_package_data, get_version,
71     install_js, package_files, package_path, ROOT, SERVER, show_bokehjs,
72     show_help
73 )
74 
75 # immediately bail for ancient pythons
76 if sys.version_info[:2] < (2, 7):
77     raise RuntimeError("Bokeh requires python >= 2.7")
78 
79 # immediately handle lightweight "python setup.py --install-js"
80 if len(sys.argv) == 2 and sys.argv[-1] == '--install-js':
81     install_js()
82     sys.exit()
83 
84 # we want to have the license at the top level of the GitHub repo, but setup
85 # can't include it from there, so copy it to the package directory first thing
86 copy("LICENSE.txt", "bokeh/")
87 
88 # state our runtime deps here, also used by meta.yaml (so KEEP the spaces)
89 REQUIRES = [
90     'six >=1.5.2',
91     'requests >=1.2.3',
92     'PyYAML >=3.10',
93     'python-dateutil >=2.1',
94     'Jinja2 >=2.7',
95     'numpy >=1.7.1',
96     'tornado >=4.3',
97 
98     # this will be removed when Bokeh hits 1.0
99     'bkcharts >=0.2',
100 ]
101 
102 # handle the compat difference for futures (meta.yaml handles differently)
103 if sys.version_info[:2] == (2, 7):
104     REQUIRES.append('futures >=3.0.3')
105 
106 # if this is just conda-build skimming information, skip all this actual work
107 if not conda_rendering():
108     fixup_for_packaged()   # --build_js and --install_js not valid FROM sdist
109     fixup_building_sdist() # must build BokehJS when MAKING sdists
110 
111     bokehjs_action = build_or_install_bokehjs()
112 
113 # configuration to include all the special or non-python files in the package
114 # directory that need to also be installed or included in a build
115 sampledata_pats = ('.csv', '.conf', '.gz', '.json', '.png', '.ics', '.geojson')
116 package_path(join(SERVER, 'static'))
117 package_path(join(ROOT, 'bokeh', 'core', '_templates'))
118 package_path(join(ROOT, 'bokeh', 'sphinxext', '_templates'))
119 package_path(join(ROOT, 'bokeh', 'server', 'views'), ('.html'))
120 package_path(join(ROOT, 'bokeh', 'sampledata'), sampledata_pats)
121 package_files('LICENSE.txt', 'themes/*.yaml')
122 
123 setup(
124 
125     # basic package metadata
126     name='bokeh',
127     version=get_version(),
128     description='Interactive plots and applications in the browser from Python',
129     license='New BSD',
130     author='Continuum Analytics',
131     author_email='info@continuum.io',
132     url='http://github.com/bokeh/bokeh',
133     classifiers=open("classifiers.txt").read().strip().split('\n'),
134 
135     # details needed by setup
136     install_requires=REQUIRES,
137     packages=find_packages(exclude=["scripts*", "tests*"]),
138     package_data=get_package_data(),
139     entry_points={'console_scripts': ['bokeh = bokeh.__main__:main',], },
140     zip_safe=False,
141     cmdclass=get_cmdclass()
142 
143 )
144 
145 # if this is just conda-build skimming information, skip all this actual work
146 if not conda_rendering():
147     if '--help'  in sys.argv: show_help(bokehjs_action)
148     if 'develop' in sys.argv: show_bokehjs(bokehjs_action, develop=True)
149     if 'install' in sys.argv: show_bokehjs(bokehjs_action)
150
```
--- 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/bokeh/sampledata/daylight.py b/bokeh/sampledata/daylight.py
--- a/bokeh/sampledata/daylight.py
+++ b/bokeh/sampledata/daylight.py
@@ -7,60 +7,8 @@
 pd = import_required('pandas',
               'daylight sample data requires Pandas (http://pandas.pydata.org) to be installed')
 
-import re
-import datetime
-import requests
-
-from six.moves import xrange
 from os.path import join, abspath, dirname
 
-url = "http://sunrisesunset.com/calendar.asp"
-
-r0 = re.compile("<[^>]+>|&nbsp;|[\r\n\t]")
-r1 = re.compile(r"(\d+)(DST Begins|DST Ends)?Sunrise: (\d+):(\d\d)Sunset: (\d+):(\d\d)")
-
-def fetch_daylight_hours(lat, lon, tz, dst, year):
-    """Fetch daylight hours from sunrisesunset.com for a given location.
-
-       Parameters
-       ----------
-       lat  : float
-           Location's latitude.
-       lon  : float
-           Location's longitude.
-       tz   : int or float
-           Time zone offset from UTC. Use floats for half-hour time zones.
-       dst  : int
-           Daylight saving type, e.g. 0 -> none, 1 -> North America, 2 -> Europe.
-           See sunrisesunset.com/custom.asp for other possible values.
-       year : int
-           Year (1901..2099).
-    """
-    daylight = []
-    summer = 0 if lat >= 0 else 1
-
-    for month in xrange(1, 12+1):
-        args = dict(url=url, lat=lat, lon=lon, tz=tz, dst=dst, year=year, month=month)
-        response = requests.get("%(url)s?comb_city_info=_;%(lon)s;%(lat)s;%(tz)s;%(dst)s&month=%(month)s&year=%(year)s&time_type=1&wadj=1" % args)
-        entries = r1.findall(r0.sub("", response.text))
-
-        for day, note, sunrise_hour, sunrise_minute, sunset_hour, sunset_minute in entries:
-            if note == "DST Begins":
-                summer = 1
-            elif note == "DST Ends":
-                summer = 0
-
-            date = datetime.date(year, month, int(day))
-            sunrise = datetime.time(int(sunrise_hour), int(sunrise_minute))
-            sunset = datetime.time(int(sunset_hour), int(sunset_minute))
-
-            daylight.append([date, sunrise, sunset, summer])
-
-    return pd.DataFrame(daylight, columns=["Date", "Sunrise", "Sunset", "Summer"])
-
-# daylight_warsaw_2013 = fetch_daylight_hours(52.2297, -21.0122, 1, 2, 2013)
-# daylight_warsaw_2013.to_csv("bokeh/sampledata/daylight_warsaw_2013.csv", index=False)
-
 def load_daylight_hours(file):
     path = join(dirname(abspath(__file__)), file)
     df = pd.read_csv(path, parse_dates=["Date", "Sunrise", "Sunset"])
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -88,7 +88,6 @@
 # state our runtime deps here, also used by meta.yaml (so KEEP the spaces)
 REQUIRES = [
     'six >=1.5.2',
-    'requests >=1.2.3',
     'PyYAML >=3.10',
     'python-dateutil >=2.1',
     'Jinja2 >=2.7',

{"golden_diff": "diff --git a/bokeh/sampledata/daylight.py b/bokeh/sampledata/daylight.py\n--- a/bokeh/sampledata/daylight.py\n+++ b/bokeh/sampledata/daylight.py\n@@ -7,60 +7,8 @@\n pd = import_required('pandas',\n               'daylight sample data requires Pandas (http://pandas.pydata.org) to be installed')\n \n-import re\n-import datetime\n-import requests\n-\n-from six.moves import xrange\n from os.path import join, abspath, dirname\n \n-url = \"http://sunrisesunset.com/calendar.asp\"\n-\n-r0 = re.compile(\"<[^>]+>|&nbsp;|[\\r\\n\\t]\")\n-r1 = re.compile(r\"(\\d+)(DST Begins|DST Ends)?Sunrise: (\\d+):(\\d\\d)Sunset: (\\d+):(\\d\\d)\")\n-\n-def fetch_daylight_hours(lat, lon, tz, dst, year):\n-    \"\"\"Fetch daylight hours from sunrisesunset.com for a given location.\n-\n-       Parameters\n-       ----------\n-       lat  : float\n-           Location's latitude.\n-       lon  : float\n-           Location's longitude.\n-       tz   : int or float\n-           Time zone offset from UTC. Use floats for half-hour time zones.\n-       dst  : int\n-           Daylight saving type, e.g. 0 -> none, 1 -> North America, 2 -> Europe.\n-           See sunrisesunset.com/custom.asp for other possible values.\n-       year : int\n-           Year (1901..2099).\n-    \"\"\"\n-    daylight = []\n-    summer = 0 if lat >= 0 else 1\n-\n-    for month in xrange(1, 12+1):\n-        args = dict(url=url, lat=lat, lon=lon, tz=tz, dst=dst, year=year, month=month)\n-        response = requests.get(\"%(url)s?comb_city_info=_;%(lon)s;%(lat)s;%(tz)s;%(dst)s&month=%(month)s&year=%(year)s&time_type=1&wadj=1\" % args)\n-        entries = r1.findall(r0.sub(\"\", response.text))\n-\n-        for day, note, sunrise_hour, sunrise_minute, sunset_hour, sunset_minute in entries:\n-            if note == \"DST Begins\":\n-                summer = 1\n-            elif note == \"DST Ends\":\n-                summer = 0\n-\n-            date = datetime.date(year, month, int(day))\n-            sunrise = datetime.time(int(sunrise_hour), int(sunrise_minute))\n-            sunset = datetime.time(int(sunset_hour), int(sunset_minute))\n-\n-            daylight.append([date, sunrise, sunset, summer])\n-\n-    return pd.DataFrame(daylight, columns=[\"Date\", \"Sunrise\", \"Sunset\", \"Summer\"])\n-\n-# daylight_warsaw_2013 = fetch_daylight_hours(52.2297, -21.0122, 1, 2, 2013)\n-# daylight_warsaw_2013.to_csv(\"bokeh/sampledata/daylight_warsaw_2013.csv\", index=False)\n-\n def load_daylight_hours(file):\n     path = join(dirname(abspath(__file__)), file)\n     df = pd.read_csv(path, parse_dates=[\"Date\", \"Sunrise\", \"Sunset\"])\ndiff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -88,7 +88,6 @@\n # state our runtime deps here, also used by meta.yaml (so KEEP the spaces)\n REQUIRES = [\n     'six >=1.5.2',\n-    'requests >=1.2.3',\n     'PyYAML >=3.10',\n     'python-dateutil >=2.1',\n     'Jinja2 >=2.7',\n", "issue": "remove requests as runtime dependency?\nThis only seems to be used for one sampledata download, in which case we should find a different way to grab the data with stdlib functions and remove the dependency.\r\n\r\nping @mattpap \n", "before_files": [{"content": "\"\"\" Daylight hours from http://www.sunrisesunset.com\n\n\"\"\"\nfrom __future__ import absolute_import\n\nfrom bokeh.util.dependencies import import_required\npd = import_required('pandas',\n              'daylight sample data requires Pandas (http://pandas.pydata.org) to be installed')\n\nimport re\nimport datetime\nimport requests\n\nfrom six.moves import xrange\nfrom os.path import join, abspath, dirname\n\nurl = \"http://sunrisesunset.com/calendar.asp\"\n\nr0 = re.compile(\"<[^>]+>|&nbsp;|[\\r\\n\\t]\")\nr1 = re.compile(r\"(\\d+)(DST Begins|DST Ends)?Sunrise: (\\d+):(\\d\\d)Sunset: (\\d+):(\\d\\d)\")\n\ndef fetch_daylight_hours(lat, lon, tz, dst, year):\n    \"\"\"Fetch daylight hours from sunrisesunset.com for a given location.\n\n       Parameters\n       ----------\n       lat  : float\n           Location's latitude.\n       lon  : float\n           Location's longitude.\n       tz   : int or float\n           Time zone offset from UTC. Use floats for half-hour time zones.\n       dst  : int\n           Daylight saving type, e.g. 0 -> none, 1 -> North America, 2 -> Europe.\n           See sunrisesunset.com/custom.asp for other possible values.\n       year : int\n           Year (1901..2099).\n    \"\"\"\n    daylight = []\n    summer = 0 if lat >= 0 else 1\n\n    for month in xrange(1, 12+1):\n        args = dict(url=url, lat=lat, lon=lon, tz=tz, dst=dst, year=year, month=month)\n        response = requests.get(\"%(url)s?comb_city_info=_;%(lon)s;%(lat)s;%(tz)s;%(dst)s&month=%(month)s&year=%(year)s&time_type=1&wadj=1\" % args)\n        entries = r1.findall(r0.sub(\"\", response.text))\n\n        for day, note, sunrise_hour, sunrise_minute, sunset_hour, sunset_minute in entries:\n            if note == \"DST Begins\":\n                summer = 1\n            elif note == \"DST Ends\":\n                summer = 0\n\n            date = datetime.date(year, month, int(day))\n            sunrise = datetime.time(int(sunrise_hour), int(sunrise_minute))\n            sunset = datetime.time(int(sunset_hour), int(sunset_minute))\n\n            daylight.append([date, sunrise, sunset, summer])\n\n    return pd.DataFrame(daylight, columns=[\"Date\", \"Sunrise\", \"Sunset\", \"Summer\"])\n\n# daylight_warsaw_2013 = fetch_daylight_hours(52.2297, -21.0122, 1, 2, 2013)\n# daylight_warsaw_2013.to_csv(\"bokeh/sampledata/daylight_warsaw_2013.csv\", index=False)\n\ndef load_daylight_hours(file):\n    path = join(dirname(abspath(__file__)), file)\n    df = pd.read_csv(path, parse_dates=[\"Date\", \"Sunrise\", \"Sunset\"])\n\n    df[\"Date\"] = df.Date.map(lambda x: x.date())\n    df[\"Sunrise\"] = df.Sunrise.map(lambda x: x.time())\n    df[\"Sunset\"] = df.Sunset.map(lambda x: x.time())\n\n    return df\n\ndaylight_warsaw_2013 = load_daylight_hours(\"daylight_warsaw_2013.csv\")\n", "path": "bokeh/sampledata/daylight.py"}, {"content": "#-----------------------------------------------------------------------------\n# Copyright (c) 2012 - 2017, Continuum Analytics, Inc. All rights reserved.\n#\n# Powered by the Bokeh Development Team.\n#\n# The full license is in the file LICENSE.txt, distributed with this software.\n#-----------------------------------------------------------------------------\n''' Setup script for Bokeh.\n\nTwo separate components comprise Bokeh:\n\n* A JavaScript runtime BokehJS that draws and handles events in browsers\n* Python \"bindings\" and an optional server for interacting with BokehJS\n\nThe BokehJS library is written in a mixture of CoffeeScript, TypeScript, and\npure JavaScript. This necessitates a \"compilation\" step to build a complete\nBokehJS from these sources, and this fact makes the Bokeh setup and install\nmore complicated than typical pure Python projects.\n\nIn order to build BokehJS, the first step is to make sure that the \"npm\"\ncommand is installed. If you are using conda, you can typically just run\n\n    conda install -c bokeh nodejs\n\nOthewise, you can find general instructions for installing NodeJS here:\n\n    https://nodejs.org/en/download/\n\nOnce you have \"npm\" installed, this script can be used to build BokehJS\nfrom the ``bokehjs`` source subdirectory, and install Bokeh into the python\nsource package by issuing the command:\n\n    python setup.py install --build-js\n\nThe script also supports the standard \"develop\" mode that setuptools offers:\n\n    python setup.py develop --build-js\n\nIt can take a few minutes for BokehJS to build, if you are not making changes\nto the BokehJS source code, then you only need to build it once, the first\ntime. Subsequence invocations can be made to install the previously built\nBokehJS from the ``bokehjs`` source subdirectoruy with the ``--install-js``\noption, e.g:\n\n    python setup.py develop --install-js\n\nIt is also possible to build BokehJS \"by hand\" under the ``bokehjs`` source\nsubdirectory. In this case, to simply install the build BokehJS quickly into\nthe python source tree, the following command may be issued:\n\n    python setup.py --install-js\n\nThis will copy BokehJS from the ``bokehjs`` source directory, into the python\npackage directory, and perform no other actions.\n\nNote that source distributions (sdists) are published with a pre-built BokehJS\nincluded inside the python package, and do not include the ``bokehjs`` source.\nThe ``--build-js`` and ``-install-js`` options are not valid when running from\nan sdist. They will be ignored, and warning printed.\n\n'''\nfrom os.path import join\nfrom shutil import copy\nimport sys\n\nfrom setuptools import find_packages, setup\n\nfrom _setup_support import (\n    build_or_install_bokehjs, conda_rendering, fixup_building_sdist,\n    fixup_for_packaged, get_cmdclass, get_package_data, get_version,\n    install_js, package_files, package_path, ROOT, SERVER, show_bokehjs,\n    show_help\n)\n\n# immediately bail for ancient pythons\nif sys.version_info[:2] < (2, 7):\n    raise RuntimeError(\"Bokeh requires python >= 2.7\")\n\n# immediately handle lightweight \"python setup.py --install-js\"\nif len(sys.argv) == 2 and sys.argv[-1] == '--install-js':\n    install_js()\n    sys.exit()\n\n# we want to have the license at the top level of the GitHub repo, but setup\n# can't include it from there, so copy it to the package directory first thing\ncopy(\"LICENSE.txt\", \"bokeh/\")\n\n# state our runtime deps here, also used by meta.yaml (so KEEP the spaces)\nREQUIRES = [\n    'six >=1.5.2',\n    'requests >=1.2.3',\n    'PyYAML >=3.10',\n    'python-dateutil >=2.1',\n    'Jinja2 >=2.7',\n    'numpy >=1.7.1',\n    'tornado >=4.3',\n\n    # this will be removed when Bokeh hits 1.0\n    'bkcharts >=0.2',\n]\n\n# handle the compat difference for futures (meta.yaml handles differently)\nif sys.version_info[:2] == (2, 7):\n    REQUIRES.append('futures >=3.0.3')\n\n# if this is just conda-build skimming information, skip all this actual work\nif not conda_rendering():\n    fixup_for_packaged()   # --build_js and --install_js not valid FROM sdist\n    fixup_building_sdist() # must build BokehJS when MAKING sdists\n\n    bokehjs_action = build_or_install_bokehjs()\n\n# configuration to include all the special or non-python files in the package\n# directory that need to also be installed or included in a build\nsampledata_pats = ('.csv', '.conf', '.gz', '.json', '.png', '.ics', '.geojson')\npackage_path(join(SERVER, 'static'))\npackage_path(join(ROOT, 'bokeh', 'core', '_templates'))\npackage_path(join(ROOT, 'bokeh', 'sphinxext', '_templates'))\npackage_path(join(ROOT, 'bokeh', 'server', 'views'), ('.html'))\npackage_path(join(ROOT, 'bokeh', 'sampledata'), sampledata_pats)\npackage_files('LICENSE.txt', 'themes/*.yaml')\n\nsetup(\n\n    # basic package metadata\n    name='bokeh',\n    version=get_version(),\n    description='Interactive plots and applications in the browser from Python',\n    license='New BSD',\n    author='Continuum Analytics',\n    author_email='info@continuum.io',\n    url='http://github.com/bokeh/bokeh',\n    classifiers=open(\"classifiers.txt\").read().strip().split('\\n'),\n\n    # details needed by setup\n    install_requires=REQUIRES,\n    packages=find_packages(exclude=[\"scripts*\", \"tests*\"]),\n    package_data=get_package_data(),\n    entry_points={'console_scripts': ['bokeh = bokeh.__main__:main',], },\n    zip_safe=False,\n    cmdclass=get_cmdclass()\n\n)\n\n# if this is just conda-build skimming information, skip all this actual work\nif not conda_rendering():\n    if '--help'  in sys.argv: show_help(bokehjs_action)\n    if 'develop' in sys.argv: show_bokehjs(bokehjs_action, develop=True)\n    if 'install' in sys.argv: show_bokehjs(bokehjs_action)\n", "path": "setup.py"}], "after_files": [{"content": "\"\"\" Daylight hours from http://www.sunrisesunset.com\n\n\"\"\"\nfrom __future__ import absolute_import\n\nfrom bokeh.util.dependencies import import_required\npd = import_required('pandas',\n              'daylight sample data requires Pandas (http://pandas.pydata.org) to be installed')\n\nfrom os.path import join, abspath, dirname\n\ndef load_daylight_hours(file):\n    path = join(dirname(abspath(__file__)), file)\n    df = pd.read_csv(path, parse_dates=[\"Date\", \"Sunrise\", \"Sunset\"])\n\n    df[\"Date\"] = df.Date.map(lambda x: x.date())\n    df[\"Sunrise\"] = df.Sunrise.map(lambda x: x.time())\n    df[\"Sunset\"] = df.Sunset.map(lambda x: x.time())\n\n    return df\n\ndaylight_warsaw_2013 = load_daylight_hours(\"daylight_warsaw_2013.csv\")\n", "path": "bokeh/sampledata/daylight.py"}, {"content": "#-----------------------------------------------------------------------------\n# Copyright (c) 2012 - 2017, Continuum Analytics, Inc. All rights reserved.\n#\n# Powered by the Bokeh Development Team.\n#\n# The full license is in the file LICENSE.txt, distributed with this software.\n#-----------------------------------------------------------------------------\n''' Setup script for Bokeh.\n\nTwo separate components comprise Bokeh:\n\n* A JavaScript runtime BokehJS that draws and handles events in browsers\n* Python \"bindings\" and an optional server for interacting with BokehJS\n\nThe BokehJS library is written in a mixture of CoffeeScript, TypeScript, and\npure JavaScript. This necessitates a \"compilation\" step to build a complete\nBokehJS from these sources, and this fact makes the Bokeh setup and install\nmore complicated than typical pure Python projects.\n\nIn order to build BokehJS, the first step is to make sure that the \"npm\"\ncommand is installed. If you are using conda, you can typically just run\n\n    conda install -c bokeh nodejs\n\nOthewise, you can find general instructions for installing NodeJS here:\n\n    https://nodejs.org/en/download/\n\nOnce you have \"npm\" installed, this script can be used to build BokehJS\nfrom the ``bokehjs`` source subdirectory, and install Bokeh into the python\nsource package by issuing the command:\n\n    python setup.py install --build-js\n\nThe script also supports the standard \"develop\" mode that setuptools offers:\n\n    python setup.py develop --build-js\n\nIt can take a few minutes for BokehJS to build, if you are not making changes\nto the BokehJS source code, then you only need to build it once, the first\ntime. Subsequence invocations can be made to install the previously built\nBokehJS from the ``bokehjs`` source subdirectoruy with the ``--install-js``\noption, e.g:\n\n    python setup.py develop --install-js\n\nIt is also possible to build BokehJS \"by hand\" under the ``bokehjs`` source\nsubdirectory. In this case, to simply install the build BokehJS quickly into\nthe python source tree, the following command may be issued:\n\n    python setup.py --install-js\n\nThis will copy BokehJS from the ``bokehjs`` source directory, into the python\npackage directory, and perform no other actions.\n\nNote that source distributions (sdists) are published with a pre-built BokehJS\nincluded inside the python package, and do not include the ``bokehjs`` source.\nThe ``--build-js`` and ``-install-js`` options are not valid when running from\nan sdist. They will be ignored, and warning printed.\n\n'''\nfrom os.path import join\nfrom shutil import copy\nimport sys\n\nfrom setuptools import find_packages, setup\n\nfrom _setup_support import (\n    build_or_install_bokehjs, conda_rendering, fixup_building_sdist,\n    fixup_for_packaged, get_cmdclass, get_package_data, get_version,\n    install_js, package_files, package_path, ROOT, SERVER, show_bokehjs,\n    show_help\n)\n\n# immediately bail for ancient pythons\nif sys.version_info[:2] < (2, 7):\n    raise RuntimeError(\"Bokeh requires python >= 2.7\")\n\n# immediately handle lightweight \"python setup.py --install-js\"\nif len(sys.argv) == 2 and sys.argv[-1] == '--install-js':\n    install_js()\n    sys.exit()\n\n# we want to have the license at the top level of the GitHub repo, but setup\n# can't include it from there, so copy it to the package directory first thing\ncopy(\"LICENSE.txt\", \"bokeh/\")\n\n# state our runtime deps here, also used by meta.yaml (so KEEP the spaces)\nREQUIRES = [\n    'six >=1.5.2',\n    'PyYAML >=3.10',\n    'python-dateutil >=2.1',\n    'Jinja2 >=2.7',\n    'numpy >=1.7.1',\n    'tornado >=4.3',\n\n    # this will be removed when Bokeh hits 1.0\n    'bkcharts >=0.2',\n]\n\n# handle the compat difference for futures (meta.yaml handles differently)\nif sys.version_info[:2] == (2, 7):\n    REQUIRES.append('futures >=3.0.3')\n\n# if this is just conda-build skimming information, skip all this actual work\nif not conda_rendering():\n    fixup_for_packaged()   # --build_js and --install_js not valid FROM sdist\n    fixup_building_sdist() # must build BokehJS when MAKING sdists\n\n    bokehjs_action = build_or_install_bokehjs()\n\n# configuration to include all the special or non-python files in the package\n# directory that need to also be installed or included in a build\nsampledata_pats = ('.csv', '.conf', '.gz', '.json', '.png', '.ics', '.geojson')\npackage_path(join(SERVER, 'static'))\npackage_path(join(ROOT, 'bokeh', 'core', '_templates'))\npackage_path(join(ROOT, 'bokeh', 'sphinxext', '_templates'))\npackage_path(join(ROOT, 'bokeh', 'server', 'views'), ('.html'))\npackage_path(join(ROOT, 'bokeh', 'sampledata'), sampledata_pats)\npackage_files('LICENSE.txt', 'themes/*.yaml')\n\nsetup(\n\n    # basic package metadata\n    name='bokeh',\n    version=get_version(),\n    description='Interactive plots and applications in the browser from Python',\n    license='New BSD',\n    author='Continuum Analytics',\n    author_email='info@continuum.io',\n    url='http://github.com/bokeh/bokeh',\n    classifiers=open(\"classifiers.txt\").read().strip().split('\\n'),\n\n    # details needed by setup\n    install_requires=REQUIRES,\n    packages=find_packages(exclude=[\"scripts*\", \"tests*\"]),\n    package_data=get_package_data(),\n    entry_points={'console_scripts': ['bokeh = bokeh.__main__:main',], },\n    zip_safe=False,\n    cmdclass=get_cmdclass()\n\n)\n\n# if this is just conda-build skimming information, skip all this actual work\nif not conda_rendering():\n    if '--help'  in sys.argv: show_help(bokehjs_action)\n    if 'develop' in sys.argv: show_bokehjs(bokehjs_action, develop=True)\n    if 'install' in sys.argv: show_bokehjs(bokehjs_action)\n", "path": "setup.py"}]}