We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Fix deprecated datetime64 use for NP_EPOCH
From https://github.com/numpy/numpy/pull/6453 this causes a deprecation warning.
/cc @shoyer

--- 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/core/json_encoder.py`
Content:
```
1 ''' Provide a functions and classes to implement a custom JSON encoder for
2 serializing objects for BokehJS.
3 
4 The primary interface is provided by the |serialize_json| function, which
5 uses the custom |BokehJSONEncoder| to produce JSON output.
6 
7 In general, functions in this module convert values in the following way:
8 
9 * Datetime values (Python, Pandas, NumPy) are converted to floating point
10   milliseconds since epoch.
11 
12 * Decimal values are converted to floating point.
13 
14 * Sequences (Pandas Series, NumPy arrays, python sequences) that are passed
15   though this interface are converted to lists. Note, however, that arrays in
16   data sources inside Bokeh Documents are converted elsewhere, and by default
17   use a binary encoded format.
18 
19 * Bokeh ``Model`` instances are usually serialized elsewhere in the context
20   of an entire Bokeh Document. Models passed trough this interface are
21   converted to references.
22 
23 * ``HasProps`` (that are not Bokeh models) are converted to key/value dicts or
24   all their properties and values.
25 
26 * ``Color`` instances are converted to CSS color values.
27 
28 .. |serialize_json| replace:: :class:`~bokeh.core.json_encoder.serialize_json`
29 .. |BokehJSONEncoder| replace:: :class:`~bokeh.core.json_encoder.BokehJSONEncoder`
30 
31 '''
32 from __future__ import absolute_import
33 
34 import logging
35 log = logging.getLogger(__name__)
36 
37 import collections
38 import datetime as dt
39 import decimal
40 import json
41 import time
42 
43 import numpy as np
44 
45 from ..settings import settings
46 from ..util.dependencies import import_optional
47 from ..util.serialization import transform_series, transform_array
48 
49 pd = import_optional('pandas')
50 rd = import_optional("dateutil.relativedelta")
51 
52 NP_EPOCH = np.datetime64('1970-01-01T00:00:00Z')
53 NP_MS_DELTA = np.timedelta64(1, 'ms')
54 
55 class BokehJSONEncoder(json.JSONEncoder):
56     ''' A custom ``json.JSONEncoder`` subclass for encoding objects in
57     accordance with the BokehJS protocol.
58 
59     '''
60     def transform_python_types(self, obj):
61         ''' Handle special scalars such as (Python, NumPy, or Pandas)
62         datetimes, or Decimal values.
63 
64         Args:
65             obj (obj) :
66 
67                 The object to encode. Anything not specifically handled in
68                 this method is passed on to the default system JSON encoder.
69 
70         '''
71 
72         # Pandas Timestamp
73         if pd and isinstance(obj, pd.tslib.Timestamp):
74             return obj.value / 10**6.0  #nanosecond to millisecond
75         elif np.issubdtype(type(obj), np.float):
76             return float(obj)
77         elif np.issubdtype(type(obj), np.integer):
78             return int(obj)
79         elif np.issubdtype(type(obj), np.bool_):
80             return bool(obj)
81 
82         # Datetime (datetime is a subclass of date)
83         elif isinstance(obj, dt.datetime):
84             return time.mktime(obj.timetuple()) * 1000. + obj.microsecond / 1000.
85 
86         # Timedelta (timedelta is class in the datetime library)
87         elif isinstance(obj, dt.timedelta):
88             return obj.total_seconds() * 1000.
89 
90         # Date
91         elif isinstance(obj, dt.date):
92             return time.mktime(obj.timetuple()) * 1000.
93 
94         # Numpy datetime64
95         elif isinstance(obj, np.datetime64):
96             epoch_delta = obj - NP_EPOCH
97             return (epoch_delta / NP_MS_DELTA)
98 
99         # Time
100         elif isinstance(obj, dt.time):
101             return (obj.hour * 3600 + obj.minute * 60 + obj.second) * 1000 + obj.microsecond / 1000.
102         elif rd and isinstance(obj, rd.relativedelta):
103             return dict(years=obj.years,
104                         months=obj.months,
105                         days=obj.days,
106                         hours=obj.hours,
107                         minutes=obj.minutes,
108                         seconds=obj.seconds,
109                         microseconds=obj.microseconds)
110 
111         # Decimal
112         elif isinstance(obj, decimal.Decimal):
113             return float(obj)
114 
115         else:
116             return super(BokehJSONEncoder, self).default(obj)
117 
118     def default(self, obj):
119         ''' The required ``default`` method for JSONEncoder subclasses.
120 
121         Args:
122             obj (obj) :
123 
124                 The object to encode. Anything not specifically handled in
125                 this method is passed on to the default system JSON encoder.
126 
127         '''
128 
129         from ..model import Model
130         from ..colors import Color
131         from .has_props import HasProps
132 
133         # array types -- use force_list here, only binary
134         # encoding CDS columns for now
135         if pd and isinstance(obj, (pd.Series, pd.Index)):
136             return transform_series(obj, force_list=True)
137         elif isinstance(obj, np.ndarray):
138             return transform_array(obj, force_list=True)
139         elif isinstance(obj, collections.deque):
140             return list(map(self.default, obj))
141         elif isinstance(obj, Model):
142             return obj.ref
143         elif isinstance(obj, HasProps):
144             return obj.properties_with_values(include_defaults=False)
145         elif isinstance(obj, Color):
146             return obj.to_css()
147 
148         else:
149             return self.transform_python_types(obj)
150 
151 def serialize_json(obj, pretty=False, indent=None, **kwargs):
152     ''' Return a serialized JSON representation of objects, suitable to
153     send to BokehJS.
154 
155     This function is typically used to serialize single python objects in
156     the manner expected by BokehJS. In particular, many datetime values are
157     automatically normalized to an expected format. Some Bokeh objects can
158     also be passed, but note that Bokeh models are typically properly
159     serialized in the context of an entire Bokeh document.
160 
161     The resulting JSON always has sorted keys. By default. the output is
162     as compact as possible unless pretty output or indentation is requested.
163 
164     Args:
165         obj (obj) : the object to serialize to JSON format
166 
167         pretty (bool, optional) :
168 
169             Whether to generate prettified output. If ``True``, spaces are
170             added after added after separators, and indentation and newlines
171             are applied. (default: False)
172 
173             Pretty output can also be enabled with the environment variable
174             ``BOKEH_PRETTY``, which overrides this argument, if set.
175 
176         indent (int or None, optional) :
177 
178             Amount of indentation to use in generated JSON output. If ``None``
179             then no indentation is used, unless pretty output is enabled,
180             in which case two spaces are used. (default: None)
181 
182     Any additional keyword arguments are passed to ``json.dumps``, except for
183     some that  are computed internally, and cannot be overridden:
184 
185     * allow_nan
186     * indent
187     * separators
188     * sort_keys
189 
190     Examples:
191 
192         .. code-block:: python
193 
194             >>> data = dict(b=np.datetime64('2017-01-01'), a = np.arange(3))
195 
196             >>>print(serialize_json(data))
197             {"a":[0,1,2],"b":1483228800000.0}
198 
199             >>> print(serialize_json(data, pretty=True))
200             {
201               "a": [
202                 0,
203                 1,
204                 2
205               ],
206               "b": 1483228800000.0
207             }
208 
209     '''
210 
211     # these args to json.dumps are computed internally and should not be passed along
212     for name in ['allow_nan', 'separators', 'sort_keys']:
213         if name in kwargs:
214             raise ValueError("The value of %r is computed internally, overriding is not permissable." % name)
215 
216     pretty = settings.pretty(pretty)
217 
218     if pretty:
219         separators=(",", ": ")
220     else:
221         separators=(",", ":")
222 
223     if pretty and indent is None:
224         indent = 2
225 
226     return json.dumps(obj, cls=BokehJSONEncoder, allow_nan=False, indent=indent, separators=separators, sort_keys=True, **kwargs)
227
```
--- 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/core/json_encoder.py b/bokeh/core/json_encoder.py
--- a/bokeh/core/json_encoder.py
+++ b/bokeh/core/json_encoder.py
@@ -49,8 +49,8 @@
 pd = import_optional('pandas')
 rd = import_optional("dateutil.relativedelta")
 
-NP_EPOCH = np.datetime64('1970-01-01T00:00:00Z')
-NP_MS_DELTA = np.timedelta64(1, 'ms')
+_NP_EPOCH = np.datetime64(0, 'ms')
+_NP_MS_DELTA = np.timedelta64(1, 'ms')
 
 class BokehJSONEncoder(json.JSONEncoder):
     ''' A custom ``json.JSONEncoder`` subclass for encoding objects in
@@ -93,8 +93,8 @@
 
         # Numpy datetime64
         elif isinstance(obj, np.datetime64):
-            epoch_delta = obj - NP_EPOCH
-            return (epoch_delta / NP_MS_DELTA)
+            epoch_delta = obj - _NP_EPOCH
+            return (epoch_delta / _NP_MS_DELTA)
 
         # Time
         elif isinstance(obj, dt.time):

{"golden_diff": "diff --git a/bokeh/core/json_encoder.py b/bokeh/core/json_encoder.py\n--- a/bokeh/core/json_encoder.py\n+++ b/bokeh/core/json_encoder.py\n@@ -49,8 +49,8 @@\n pd = import_optional('pandas')\n rd = import_optional(\"dateutil.relativedelta\")\n \n-NP_EPOCH = np.datetime64('1970-01-01T00:00:00Z')\n-NP_MS_DELTA = np.timedelta64(1, 'ms')\n+_NP_EPOCH = np.datetime64(0, 'ms')\n+_NP_MS_DELTA = np.timedelta64(1, 'ms')\n \n class BokehJSONEncoder(json.JSONEncoder):\n     ''' A custom ``json.JSONEncoder`` subclass for encoding objects in\n@@ -93,8 +93,8 @@\n \n         # Numpy datetime64\n         elif isinstance(obj, np.datetime64):\n-            epoch_delta = obj - NP_EPOCH\n-            return (epoch_delta / NP_MS_DELTA)\n+            epoch_delta = obj - _NP_EPOCH\n+            return (epoch_delta / _NP_MS_DELTA)\n \n         # Time\n         elif isinstance(obj, dt.time):\n", "issue": "Fix deprecated datetime64 use for NP_EPOCH\nFrom https://github.com/numpy/numpy/pull/6453 this causes a deprecation warning.\r\n/cc @shoyer\n", "before_files": [{"content": "''' Provide a functions and classes to implement a custom JSON encoder for\nserializing objects for BokehJS.\n\nThe primary interface is provided by the |serialize_json| function, which\nuses the custom |BokehJSONEncoder| to produce JSON output.\n\nIn general, functions in this module convert values in the following way:\n\n* Datetime values (Python, Pandas, NumPy) are converted to floating point\n  milliseconds since epoch.\n\n* Decimal values are converted to floating point.\n\n* Sequences (Pandas Series, NumPy arrays, python sequences) that are passed\n  though this interface are converted to lists. Note, however, that arrays in\n  data sources inside Bokeh Documents are converted elsewhere, and by default\n  use a binary encoded format.\n\n* Bokeh ``Model`` instances are usually serialized elsewhere in the context\n  of an entire Bokeh Document. Models passed trough this interface are\n  converted to references.\n\n* ``HasProps`` (that are not Bokeh models) are converted to key/value dicts or\n  all their properties and values.\n\n* ``Color`` instances are converted to CSS color values.\n\n.. |serialize_json| replace:: :class:`~bokeh.core.json_encoder.serialize_json`\n.. |BokehJSONEncoder| replace:: :class:`~bokeh.core.json_encoder.BokehJSONEncoder`\n\n'''\nfrom __future__ import absolute_import\n\nimport logging\nlog = logging.getLogger(__name__)\n\nimport collections\nimport datetime as dt\nimport decimal\nimport json\nimport time\n\nimport numpy as np\n\nfrom ..settings import settings\nfrom ..util.dependencies import import_optional\nfrom ..util.serialization import transform_series, transform_array\n\npd = import_optional('pandas')\nrd = import_optional(\"dateutil.relativedelta\")\n\nNP_EPOCH = np.datetime64('1970-01-01T00:00:00Z')\nNP_MS_DELTA = np.timedelta64(1, 'ms')\n\nclass BokehJSONEncoder(json.JSONEncoder):\n    ''' A custom ``json.JSONEncoder`` subclass for encoding objects in\n    accordance with the BokehJS protocol.\n\n    '''\n    def transform_python_types(self, obj):\n        ''' Handle special scalars such as (Python, NumPy, or Pandas)\n        datetimes, or Decimal values.\n\n        Args:\n            obj (obj) :\n\n                The object to encode. Anything not specifically handled in\n                this method is passed on to the default system JSON encoder.\n\n        '''\n\n        # Pandas Timestamp\n        if pd and isinstance(obj, pd.tslib.Timestamp):\n            return obj.value / 10**6.0  #nanosecond to millisecond\n        elif np.issubdtype(type(obj), np.float):\n            return float(obj)\n        elif np.issubdtype(type(obj), np.integer):\n            return int(obj)\n        elif np.issubdtype(type(obj), np.bool_):\n            return bool(obj)\n\n        # Datetime (datetime is a subclass of date)\n        elif isinstance(obj, dt.datetime):\n            return time.mktime(obj.timetuple()) * 1000. + obj.microsecond / 1000.\n\n        # Timedelta (timedelta is class in the datetime library)\n        elif isinstance(obj, dt.timedelta):\n            return obj.total_seconds() * 1000.\n\n        # Date\n        elif isinstance(obj, dt.date):\n            return time.mktime(obj.timetuple()) * 1000.\n\n        # Numpy datetime64\n        elif isinstance(obj, np.datetime64):\n            epoch_delta = obj - NP_EPOCH\n            return (epoch_delta / NP_MS_DELTA)\n\n        # Time\n        elif isinstance(obj, dt.time):\n            return (obj.hour * 3600 + obj.minute * 60 + obj.second) * 1000 + obj.microsecond / 1000.\n        elif rd and isinstance(obj, rd.relativedelta):\n            return dict(years=obj.years,\n                        months=obj.months,\n                        days=obj.days,\n                        hours=obj.hours,\n                        minutes=obj.minutes,\n                        seconds=obj.seconds,\n                        microseconds=obj.microseconds)\n\n        # Decimal\n        elif isinstance(obj, decimal.Decimal):\n            return float(obj)\n\n        else:\n            return super(BokehJSONEncoder, self).default(obj)\n\n    def default(self, obj):\n        ''' The required ``default`` method for JSONEncoder subclasses.\n\n        Args:\n            obj (obj) :\n\n                The object to encode. Anything not specifically handled in\n                this method is passed on to the default system JSON encoder.\n\n        '''\n\n        from ..model import Model\n        from ..colors import Color\n        from .has_props import HasProps\n\n        # array types -- use force_list here, only binary\n        # encoding CDS columns for now\n        if pd and isinstance(obj, (pd.Series, pd.Index)):\n            return transform_series(obj, force_list=True)\n        elif isinstance(obj, np.ndarray):\n            return transform_array(obj, force_list=True)\n        elif isinstance(obj, collections.deque):\n            return list(map(self.default, obj))\n        elif isinstance(obj, Model):\n            return obj.ref\n        elif isinstance(obj, HasProps):\n            return obj.properties_with_values(include_defaults=False)\n        elif isinstance(obj, Color):\n            return obj.to_css()\n\n        else:\n            return self.transform_python_types(obj)\n\ndef serialize_json(obj, pretty=False, indent=None, **kwargs):\n    ''' Return a serialized JSON representation of objects, suitable to\n    send to BokehJS.\n\n    This function is typically used to serialize single python objects in\n    the manner expected by BokehJS. In particular, many datetime values are\n    automatically normalized to an expected format. Some Bokeh objects can\n    also be passed, but note that Bokeh models are typically properly\n    serialized in the context of an entire Bokeh document.\n\n    The resulting JSON always has sorted keys. By default. the output is\n    as compact as possible unless pretty output or indentation is requested.\n\n    Args:\n        obj (obj) : the object to serialize to JSON format\n\n        pretty (bool, optional) :\n\n            Whether to generate prettified output. If ``True``, spaces are\n            added after added after separators, and indentation and newlines\n            are applied. (default: False)\n\n            Pretty output can also be enabled with the environment variable\n            ``BOKEH_PRETTY``, which overrides this argument, if set.\n\n        indent (int or None, optional) :\n\n            Amount of indentation to use in generated JSON output. If ``None``\n            then no indentation is used, unless pretty output is enabled,\n            in which case two spaces are used. (default: None)\n\n    Any additional keyword arguments are passed to ``json.dumps``, except for\n    some that  are computed internally, and cannot be overridden:\n\n    * allow_nan\n    * indent\n    * separators\n    * sort_keys\n\n    Examples:\n\n        .. code-block:: python\n\n            >>> data = dict(b=np.datetime64('2017-01-01'), a = np.arange(3))\n\n            >>>print(serialize_json(data))\n            {\"a\":[0,1,2],\"b\":1483228800000.0}\n\n            >>> print(serialize_json(data, pretty=True))\n            {\n              \"a\": [\n                0,\n                1,\n                2\n              ],\n              \"b\": 1483228800000.0\n            }\n\n    '''\n\n    # these args to json.dumps are computed internally and should not be passed along\n    for name in ['allow_nan', 'separators', 'sort_keys']:\n        if name in kwargs:\n            raise ValueError(\"The value of %r is computed internally, overriding is not permissable.\" % name)\n\n    pretty = settings.pretty(pretty)\n\n    if pretty:\n        separators=(\",\", \": \")\n    else:\n        separators=(\",\", \":\")\n\n    if pretty and indent is None:\n        indent = 2\n\n    return json.dumps(obj, cls=BokehJSONEncoder, allow_nan=False, indent=indent, separators=separators, sort_keys=True, **kwargs)\n", "path": "bokeh/core/json_encoder.py"}], "after_files": [{"content": "''' Provide a functions and classes to implement a custom JSON encoder for\nserializing objects for BokehJS.\n\nThe primary interface is provided by the |serialize_json| function, which\nuses the custom |BokehJSONEncoder| to produce JSON output.\n\nIn general, functions in this module convert values in the following way:\n\n* Datetime values (Python, Pandas, NumPy) are converted to floating point\n  milliseconds since epoch.\n\n* Decimal values are converted to floating point.\n\n* Sequences (Pandas Series, NumPy arrays, python sequences) that are passed\n  though this interface are converted to lists. Note, however, that arrays in\n  data sources inside Bokeh Documents are converted elsewhere, and by default\n  use a binary encoded format.\n\n* Bokeh ``Model`` instances are usually serialized elsewhere in the context\n  of an entire Bokeh Document. Models passed trough this interface are\n  converted to references.\n\n* ``HasProps`` (that are not Bokeh models) are converted to key/value dicts or\n  all their properties and values.\n\n* ``Color`` instances are converted to CSS color values.\n\n.. |serialize_json| replace:: :class:`~bokeh.core.json_encoder.serialize_json`\n.. |BokehJSONEncoder| replace:: :class:`~bokeh.core.json_encoder.BokehJSONEncoder`\n\n'''\nfrom __future__ import absolute_import\n\nimport logging\nlog = logging.getLogger(__name__)\n\nimport collections\nimport datetime as dt\nimport decimal\nimport json\nimport time\n\nimport numpy as np\n\nfrom ..settings import settings\nfrom ..util.dependencies import import_optional\nfrom ..util.serialization import transform_series, transform_array\n\npd = import_optional('pandas')\nrd = import_optional(\"dateutil.relativedelta\")\n\n_NP_EPOCH = np.datetime64(0, 'ms')\n_NP_MS_DELTA = np.timedelta64(1, 'ms')\n\nclass BokehJSONEncoder(json.JSONEncoder):\n    ''' A custom ``json.JSONEncoder`` subclass for encoding objects in\n    accordance with the BokehJS protocol.\n\n    '''\n    def transform_python_types(self, obj):\n        ''' Handle special scalars such as (Python, NumPy, or Pandas)\n        datetimes, or Decimal values.\n\n        Args:\n            obj (obj) :\n\n                The object to encode. Anything not specifically handled in\n                this method is passed on to the default system JSON encoder.\n\n        '''\n\n        # Pandas Timestamp\n        if pd and isinstance(obj, pd.tslib.Timestamp):\n            return obj.value / 10**6.0  #nanosecond to millisecond\n        elif np.issubdtype(type(obj), np.float):\n            return float(obj)\n        elif np.issubdtype(type(obj), np.integer):\n            return int(obj)\n        elif np.issubdtype(type(obj), np.bool_):\n            return bool(obj)\n\n        # Datetime (datetime is a subclass of date)\n        elif isinstance(obj, dt.datetime):\n            return time.mktime(obj.timetuple()) * 1000. + obj.microsecond / 1000.\n\n        # Timedelta (timedelta is class in the datetime library)\n        elif isinstance(obj, dt.timedelta):\n            return obj.total_seconds() * 1000.\n\n        # Date\n        elif isinstance(obj, dt.date):\n            return time.mktime(obj.timetuple()) * 1000.\n\n        # Numpy datetime64\n        elif isinstance(obj, np.datetime64):\n            epoch_delta = obj - _NP_EPOCH\n            return (epoch_delta / _NP_MS_DELTA)\n\n        # Time\n        elif isinstance(obj, dt.time):\n            return (obj.hour * 3600 + obj.minute * 60 + obj.second) * 1000 + obj.microsecond / 1000.\n        elif rd and isinstance(obj, rd.relativedelta):\n            return dict(years=obj.years,\n                        months=obj.months,\n                        days=obj.days,\n                        hours=obj.hours,\n                        minutes=obj.minutes,\n                        seconds=obj.seconds,\n                        microseconds=obj.microseconds)\n\n        # Decimal\n        elif isinstance(obj, decimal.Decimal):\n            return float(obj)\n\n        else:\n            return super(BokehJSONEncoder, self).default(obj)\n\n    def default(self, obj):\n        ''' The required ``default`` method for JSONEncoder subclasses.\n\n        Args:\n            obj (obj) :\n\n                The object to encode. Anything not specifically handled in\n                this method is passed on to the default system JSON encoder.\n\n        '''\n\n        from ..model import Model\n        from ..colors import Color\n        from .has_props import HasProps\n\n        # array types -- use force_list here, only binary\n        # encoding CDS columns for now\n        if pd and isinstance(obj, (pd.Series, pd.Index)):\n            return transform_series(obj, force_list=True)\n        elif isinstance(obj, np.ndarray):\n            return transform_array(obj, force_list=True)\n        elif isinstance(obj, collections.deque):\n            return list(map(self.default, obj))\n        elif isinstance(obj, Model):\n            return obj.ref\n        elif isinstance(obj, HasProps):\n            return obj.properties_with_values(include_defaults=False)\n        elif isinstance(obj, Color):\n            return obj.to_css()\n\n        else:\n            return self.transform_python_types(obj)\n\ndef serialize_json(obj, pretty=False, indent=None, **kwargs):\n    ''' Return a serialized JSON representation of objects, suitable to\n    send to BokehJS.\n\n    This function is typically used to serialize single python objects in\n    the manner expected by BokehJS. In particular, many datetime values are\n    automatically normalized to an expected format. Some Bokeh objects can\n    also be passed, but note that Bokeh models are typically properly\n    serialized in the context of an entire Bokeh document.\n\n    The resulting JSON always has sorted keys. By default. the output is\n    as compact as possible unless pretty output or indentation is requested.\n\n    Args:\n        obj (obj) : the object to serialize to JSON format\n\n        pretty (bool, optional) :\n\n            Whether to generate prettified output. If ``True``, spaces are\n            added after added after separators, and indentation and newlines\n            are applied. (default: False)\n\n            Pretty output can also be enabled with the environment variable\n            ``BOKEH_PRETTY``, which overrides this argument, if set.\n\n        indent (int or None, optional) :\n\n            Amount of indentation to use in generated JSON output. If ``None``\n            then no indentation is used, unless pretty output is enabled,\n            in which case two spaces are used. (default: None)\n\n    Any additional keyword arguments are passed to ``json.dumps``, except for\n    some that  are computed internally, and cannot be overridden:\n\n    * allow_nan\n    * indent\n    * separators\n    * sort_keys\n\n    Examples:\n\n        .. code-block:: python\n\n            >>> data = dict(b=np.datetime64('2017-01-01'), a = np.arange(3))\n\n            >>>print(serialize_json(data))\n            {\"a\":[0,1,2],\"b\":1483228800000.0}\n\n            >>> print(serialize_json(data, pretty=True))\n            {\n              \"a\": [\n                0,\n                1,\n                2\n              ],\n              \"b\": 1483228800000.0\n            }\n\n    '''\n\n    # these args to json.dumps are computed internally and should not be passed along\n    for name in ['allow_nan', 'separators', 'sort_keys']:\n        if name in kwargs:\n            raise ValueError(\"The value of %r is computed internally, overriding is not permissable.\" % name)\n\n    pretty = settings.pretty(pretty)\n\n    if pretty:\n        separators=(\",\", \": \")\n    else:\n        separators=(\",\", \":\")\n\n    if pretty and indent is None:\n        indent = 2\n\n    return json.dumps(obj, cls=BokehJSONEncoder, allow_nan=False, indent=indent, separators=separators, sort_keys=True, **kwargs)\n", "path": "bokeh/core/json_encoder.py"}]}