partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | BaseServer.show | Opens an app in a browser window or tab.
This method is useful for testing or running Bokeh server applications
on a local machine but should not call when running Bokeh server for
an actual deployment.
Args:
app_path (str) : the app path to open
The part of... | bokeh/server/server.py | def show(self, app_path, browser=None, new='tab'):
''' Opens an app in a browser window or tab.
This method is useful for testing or running Bokeh server applications
on a local machine but should not call when running Bokeh server for
an actual deployment.
Args:
ap... | def show(self, app_path, browser=None, new='tab'):
''' Opens an app in a browser window or tab.
This method is useful for testing or running Bokeh server applications
on a local machine but should not call when running Bokeh server for
an actual deployment.
Args:
ap... | [
"Opens",
"an",
"app",
"in",
"a",
"browser",
"window",
"or",
"tab",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/server.py#L226-L261 | [
"def",
"show",
"(",
"self",
",",
"app_path",
",",
"browser",
"=",
"None",
",",
"new",
"=",
"'tab'",
")",
":",
"if",
"not",
"app_path",
".",
"startswith",
"(",
"\"/\"",
")",
":",
"raise",
"ValueError",
"(",
"\"app_path must start with a /\"",
")",
"address_... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | CodeRunner.new_module | Make a fresh module to run in.
Returns:
Module | bokeh/application/handlers/code_runner.py | def new_module(self):
''' Make a fresh module to run in.
Returns:
Module
'''
self.reset_run_errors()
if self._code is None:
return None
module_name = 'bk_script_' + make_id().replace('-', '')
module = ModuleType(str(module_name)) # str ... | def new_module(self):
''' Make a fresh module to run in.
Returns:
Module
'''
self.reset_run_errors()
if self._code is None:
return None
module_name = 'bk_script_' + make_id().replace('-', '')
module = ModuleType(str(module_name)) # str ... | [
"Make",
"a",
"fresh",
"module",
"to",
"run",
"in",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/application/handlers/code_runner.py#L129-L145 | [
"def",
"new_module",
"(",
"self",
")",
":",
"self",
".",
"reset_run_errors",
"(",
")",
"if",
"self",
".",
"_code",
"is",
"None",
":",
"return",
"None",
"module_name",
"=",
"'bk_script_'",
"+",
"make_id",
"(",
")",
".",
"replace",
"(",
"'-'",
",",
"''",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | CodeRunner.run | Execute the configured source code in a module and run any post
checks.
Args:
module (Module) : a module to execute the configured code in.
post_check(callable) : a function that can raise an exception
if expected post-conditions are not met after code execution... | bokeh/application/handlers/code_runner.py | def run(self, module, post_check):
''' Execute the configured source code in a module and run any post
checks.
Args:
module (Module) : a module to execute the configured code in.
post_check(callable) : a function that can raise an exception
if expected p... | def run(self, module, post_check):
''' Execute the configured source code in a module and run any post
checks.
Args:
module (Module) : a module to execute the configured code in.
post_check(callable) : a function that can raise an exception
if expected p... | [
"Execute",
"the",
"configured",
"source",
"code",
"in",
"a",
"module",
"and",
"run",
"any",
"post",
"checks",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/application/handlers/code_runner.py#L158-L196 | [
"def",
"run",
"(",
"self",
",",
"module",
",",
"post_check",
")",
":",
"try",
":",
"# Simulate the sys.path behaviour decribed here:",
"#",
"# https://docs.python.org/2/library/sys.html#sys.path",
"_cwd",
"=",
"os",
".",
"getcwd",
"(",
")",
"_sys_path",
"=",
"list",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ClientConnection.loop_until_closed | Execute a blocking loop that runs and executes event callbacks
until the connection is closed (e.g. by hitting Ctrl-C).
While this method can be used to run Bokeh application code "outside"
the Bokeh server, this practice is HIGHLY DISCOURAGED for any real
use case. | bokeh/client/connection.py | def loop_until_closed(self):
''' Execute a blocking loop that runs and executes event callbacks
until the connection is closed (e.g. by hitting Ctrl-C).
While this method can be used to run Bokeh application code "outside"
the Bokeh server, this practice is HIGHLY DISCOURAGED for any re... | def loop_until_closed(self):
''' Execute a blocking loop that runs and executes event callbacks
until the connection is closed (e.g. by hitting Ctrl-C).
While this method can be used to run Bokeh application code "outside"
the Bokeh server, this practice is HIGHLY DISCOURAGED for any re... | [
"Execute",
"a",
"blocking",
"loop",
"that",
"runs",
"and",
"executes",
"event",
"callbacks",
"until",
"the",
"connection",
"is",
"closed",
"(",
"e",
".",
"g",
".",
"by",
"hitting",
"Ctrl",
"-",
"C",
")",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/client/connection.py#L134-L151 | [
"def",
"loop_until_closed",
"(",
"self",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"_state",
",",
"NOT_YET_CONNECTED",
")",
":",
"# we don't use self._transition_to_disconnected here",
"# because _transition is a coroutine",
"self",
".",
"_tell_session_about_disconnect"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ClientConnection.pull_doc | Pull a document from the server, overwriting the passed-in document
Args:
document : (Document)
The document to overwrite with server content.
Returns:
None | bokeh/client/connection.py | def pull_doc(self, document):
''' Pull a document from the server, overwriting the passed-in document
Args:
document : (Document)
The document to overwrite with server content.
Returns:
None
'''
msg = self._protocol.create('PULL-DOC-REQ')
... | def pull_doc(self, document):
''' Pull a document from the server, overwriting the passed-in document
Args:
document : (Document)
The document to overwrite with server content.
Returns:
None
'''
msg = self._protocol.create('PULL-DOC-REQ')
... | [
"Pull",
"a",
"document",
"from",
"the",
"server",
"overwriting",
"the",
"passed",
"-",
"in",
"document"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/client/connection.py#L153-L171 | [
"def",
"pull_doc",
"(",
"self",
",",
"document",
")",
":",
"msg",
"=",
"self",
".",
"_protocol",
".",
"create",
"(",
"'PULL-DOC-REQ'",
")",
"reply",
"=",
"self",
".",
"_send_message_wait_for_reply",
"(",
"msg",
")",
"if",
"reply",
"is",
"None",
":",
"rai... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ClientConnection.push_doc | Push a document to the server, overwriting any existing server-side doc.
Args:
document : (Document)
A Document to push to the server
Returns:
The server reply | bokeh/client/connection.py | def push_doc(self, document):
''' Push a document to the server, overwriting any existing server-side doc.
Args:
document : (Document)
A Document to push to the server
Returns:
The server reply
'''
msg = self._protocol.create('PUSH-DOC',... | def push_doc(self, document):
''' Push a document to the server, overwriting any existing server-side doc.
Args:
document : (Document)
A Document to push to the server
Returns:
The server reply
'''
msg = self._protocol.create('PUSH-DOC',... | [
"Push",
"a",
"document",
"to",
"the",
"server",
"overwriting",
"any",
"existing",
"server",
"-",
"side",
"doc",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/client/connection.py#L173-L191 | [
"def",
"push_doc",
"(",
"self",
",",
"document",
")",
":",
"msg",
"=",
"self",
".",
"_protocol",
".",
"create",
"(",
"'PUSH-DOC'",
",",
"document",
")",
"reply",
"=",
"self",
".",
"_send_message_wait_for_reply",
"(",
"msg",
")",
"if",
"reply",
"is",
"Non... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ClientConnection.request_server_info | Ask for information about the server.
Returns:
A dictionary of server attributes. | bokeh/client/connection.py | def request_server_info(self):
''' Ask for information about the server.
Returns:
A dictionary of server attributes.
'''
if self._server_info is None:
self._server_info = self._send_request_server_info()
return self._server_info | def request_server_info(self):
''' Ask for information about the server.
Returns:
A dictionary of server attributes.
'''
if self._server_info is None:
self._server_info = self._send_request_server_info()
return self._server_info | [
"Ask",
"for",
"information",
"about",
"the",
"server",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/client/connection.py#L193-L202 | [
"def",
"request_server_info",
"(",
"self",
")",
":",
"if",
"self",
".",
"_server_info",
"is",
"None",
":",
"self",
".",
"_server_info",
"=",
"self",
".",
"_send_request_server_info",
"(",
")",
"return",
"self",
".",
"_server_info"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | export_png | Export the ``LayoutDOM`` object or document as a PNG.
If the filename is not given, it is derived from the script name (e.g.
``/foo/myplot.py`` will create ``/foo/myplot.png``)
Args:
obj (LayoutDOM or Document) : a Layout (Row/Column), Plot or Widget
object or Document to export.
... | bokeh/io/export.py | def export_png(obj, filename=None, height=None, width=None, webdriver=None, timeout=5):
''' Export the ``LayoutDOM`` object or document as a PNG.
If the filename is not given, it is derived from the script name (e.g.
``/foo/myplot.py`` will create ``/foo/myplot.png``)
Args:
obj (LayoutDOM or D... | def export_png(obj, filename=None, height=None, width=None, webdriver=None, timeout=5):
''' Export the ``LayoutDOM`` object or document as a PNG.
If the filename is not given, it is derived from the script name (e.g.
``/foo/myplot.py`` will create ``/foo/myplot.png``)
Args:
obj (LayoutDOM or D... | [
"Export",
"the",
"LayoutDOM",
"object",
"or",
"document",
"as",
"a",
"PNG",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/export.py#L59-L107 | [
"def",
"export_png",
"(",
"obj",
",",
"filename",
"=",
"None",
",",
"height",
"=",
"None",
",",
"width",
"=",
"None",
",",
"webdriver",
"=",
"None",
",",
"timeout",
"=",
"5",
")",
":",
"image",
"=",
"get_screenshot_as_png",
"(",
"obj",
",",
"height",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | export_svgs | Export the SVG-enabled plots within a layout. Each plot will result
in a distinct SVG file.
If the filename is not given, it is derived from the script name
(e.g. ``/foo/myplot.py`` will create ``/foo/myplot.svg``)
Args:
obj (LayoutDOM object) : a Layout (Row/Column), Plot or Widget object to ... | bokeh/io/export.py | def export_svgs(obj, filename=None, height=None, width=None, webdriver=None, timeout=5):
''' Export the SVG-enabled plots within a layout. Each plot will result
in a distinct SVG file.
If the filename is not given, it is derived from the script name
(e.g. ``/foo/myplot.py`` will create ``/foo/myplot.sv... | def export_svgs(obj, filename=None, height=None, width=None, webdriver=None, timeout=5):
''' Export the SVG-enabled plots within a layout. Each plot will result
in a distinct SVG file.
If the filename is not given, it is derived from the script name
(e.g. ``/foo/myplot.py`` will create ``/foo/myplot.sv... | [
"Export",
"the",
"SVG",
"-",
"enabled",
"plots",
"within",
"a",
"layout",
".",
"Each",
"plot",
"will",
"result",
"in",
"a",
"distinct",
"SVG",
"file",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/export.py#L109-L166 | [
"def",
"export_svgs",
"(",
"obj",
",",
"filename",
"=",
"None",
",",
"height",
"=",
"None",
",",
"width",
"=",
"None",
",",
"webdriver",
"=",
"None",
",",
"timeout",
"=",
"5",
")",
":",
"svgs",
"=",
"get_svgs",
"(",
"obj",
",",
"height",
"=",
"heig... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | get_screenshot_as_png | Get a screenshot of a ``LayoutDOM`` object.
Args:
obj (LayoutDOM or Document) : a Layout (Row/Column), Plot or Widget
object or Document to export.
driver (selenium.webdriver) : a selenium webdriver instance to use
to export the image.
timeout (int) : the maximum a... | bokeh/io/export.py | def get_screenshot_as_png(obj, driver=None, timeout=5, **kwargs):
''' Get a screenshot of a ``LayoutDOM`` object.
Args:
obj (LayoutDOM or Document) : a Layout (Row/Column), Plot or Widget
object or Document to export.
driver (selenium.webdriver) : a selenium webdriver instance to u... | def get_screenshot_as_png(obj, driver=None, timeout=5, **kwargs):
''' Get a screenshot of a ``LayoutDOM`` object.
Args:
obj (LayoutDOM or Document) : a Layout (Row/Column), Plot or Widget
object or Document to export.
driver (selenium.webdriver) : a selenium webdriver instance to u... | [
"Get",
"a",
"screenshot",
"of",
"a",
"LayoutDOM",
"object",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/export.py#L186-L234 | [
"def",
"get_screenshot_as_png",
"(",
"obj",
",",
"driver",
"=",
"None",
",",
"timeout",
"=",
"5",
",",
"*",
"*",
"kwargs",
")",
":",
"Image",
"=",
"import_required",
"(",
"'PIL.Image'",
",",
"'To use bokeh.io.export_png you need pillow '",
"+",
"'(\"conda install ... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _crop_image | Crop the border from the layout | bokeh/io/export.py | def _crop_image(image, left=0, top=0, right=0, bottom=0, **kwargs):
''' Crop the border from the layout
'''
return image.crop((left, top, right, bottom)) | def _crop_image(image, left=0, top=0, right=0, bottom=0, **kwargs):
''' Crop the border from the layout
'''
return image.crop((left, top, right, bottom)) | [
"Crop",
"the",
"border",
"from",
"the",
"layout"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/export.py#L354-L358 | [
"def",
"_crop_image",
"(",
"image",
",",
"left",
"=",
"0",
",",
"top",
"=",
"0",
",",
"right",
"=",
"0",
",",
"bottom",
"=",
"0",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"image",
".",
"crop",
"(",
"(",
"left",
",",
"top",
",",
"right",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ColumnDataSource._data_from_df | Create a ``dict`` of columns from a Pandas ``DataFrame``,
suitable for creating a ColumnDataSource.
Args:
df (DataFrame) : data to convert
Returns:
dict[str, np.array] | bokeh/models/sources.py | def _data_from_df(df):
''' Create a ``dict`` of columns from a Pandas ``DataFrame``,
suitable for creating a ColumnDataSource.
Args:
df (DataFrame) : data to convert
Returns:
dict[str, np.array]
'''
_df = df.copy()
# Flatten columns
... | def _data_from_df(df):
''' Create a ``dict`` of columns from a Pandas ``DataFrame``,
suitable for creating a ColumnDataSource.
Args:
df (DataFrame) : data to convert
Returns:
dict[str, np.array]
'''
_df = df.copy()
# Flatten columns
... | [
"Create",
"a",
"dict",
"of",
"columns",
"from",
"a",
"Pandas",
"DataFrame",
"suitable",
"for",
"creating",
"a",
"ColumnDataSource",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/sources.py#L195-L232 | [
"def",
"_data_from_df",
"(",
"df",
")",
":",
"_df",
"=",
"df",
".",
"copy",
"(",
")",
"# Flatten columns",
"if",
"isinstance",
"(",
"df",
".",
"columns",
",",
"pd",
".",
"MultiIndex",
")",
":",
"try",
":",
"_df",
".",
"columns",
"=",
"[",
"'_'",
".... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ColumnDataSource._df_index_name | Return the Bokeh-appropriate column name for a ``DataFrame`` index
If there is no named index, then `"index" is returned.
If there is a single named index, then ``df.index.name`` is returned.
If there is a multi-index, and the index names are all strings, then
the names are joined wit... | bokeh/models/sources.py | def _df_index_name(df):
''' Return the Bokeh-appropriate column name for a ``DataFrame`` index
If there is no named index, then `"index" is returned.
If there is a single named index, then ``df.index.name`` is returned.
If there is a multi-index, and the index names are all strings, t... | def _df_index_name(df):
''' Return the Bokeh-appropriate column name for a ``DataFrame`` index
If there is no named index, then `"index" is returned.
If there is a single named index, then ``df.index.name`` is returned.
If there is a multi-index, and the index names are all strings, t... | [
"Return",
"the",
"Bokeh",
"-",
"appropriate",
"column",
"name",
"for",
"a",
"DataFrame",
"index"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/sources.py#L252-L280 | [
"def",
"_df_index_name",
"(",
"df",
")",
":",
"if",
"df",
".",
"index",
".",
"name",
":",
"return",
"df",
".",
"index",
".",
"name",
"elif",
"df",
".",
"index",
".",
"names",
":",
"try",
":",
"return",
"\"_\"",
".",
"join",
"(",
"df",
".",
"index... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ColumnDataSource.add | Appends a new column of data to the data source.
Args:
data (seq) : new data to add
name (str, optional) : column name to use.
If not supplied, generate a name of the form "Series ####"
Returns:
str: the column name used | bokeh/models/sources.py | def add(self, data, name=None):
''' Appends a new column of data to the data source.
Args:
data (seq) : new data to add
name (str, optional) : column name to use.
If not supplied, generate a name of the form "Series ####"
Returns:
str: the c... | def add(self, data, name=None):
''' Appends a new column of data to the data source.
Args:
data (seq) : new data to add
name (str, optional) : column name to use.
If not supplied, generate a name of the form "Series ####"
Returns:
str: the c... | [
"Appends",
"a",
"new",
"column",
"of",
"data",
"to",
"the",
"data",
"source",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/sources.py#L325-L343 | [
"def",
"add",
"(",
"self",
",",
"data",
",",
"name",
"=",
"None",
")",
":",
"if",
"name",
"is",
"None",
":",
"n",
"=",
"len",
"(",
"self",
".",
"data",
")",
"while",
"\"Series %d\"",
"%",
"n",
"in",
"self",
".",
"data",
":",
"n",
"+=",
"1",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ColumnDataSource.remove | Remove a column of data.
Args:
name (str) : name of the column to remove
Returns:
None
.. note::
If the column name does not exist, a warning is issued. | bokeh/models/sources.py | def remove(self, name):
''' Remove a column of data.
Args:
name (str) : name of the column to remove
Returns:
None
.. note::
If the column name does not exist, a warning is issued.
'''
try:
del self.data[name]
ex... | def remove(self, name):
''' Remove a column of data.
Args:
name (str) : name of the column to remove
Returns:
None
.. note::
If the column name does not exist, a warning is issued.
'''
try:
del self.data[name]
ex... | [
"Remove",
"a",
"column",
"of",
"data",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/sources.py#L346-L363 | [
"def",
"remove",
"(",
"self",
",",
"name",
")",
":",
"try",
":",
"del",
"self",
".",
"data",
"[",
"name",
"]",
"except",
"(",
"ValueError",
",",
"KeyError",
")",
":",
"import",
"warnings",
"warnings",
".",
"warn",
"(",
"\"Unable to find column '%s' in data... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ColumnDataSource._stream | Internal implementation to efficiently update data source columns
with new append-only data. The internal implementation adds the setter
attribute. [https://github.com/bokeh/bokeh/issues/6577]
In cases where it is necessary to update data columns in, this method
can efficiently send on... | bokeh/models/sources.py | def _stream(self, new_data, rollover=None, setter=None):
''' Internal implementation to efficiently update data source columns
with new append-only data. The internal implementation adds the setter
attribute. [https://github.com/bokeh/bokeh/issues/6577]
In cases where it is necessary t... | def _stream(self, new_data, rollover=None, setter=None):
''' Internal implementation to efficiently update data source columns
with new append-only data. The internal implementation adds the setter
attribute. [https://github.com/bokeh/bokeh/issues/6577]
In cases where it is necessary t... | [
"Internal",
"implementation",
"to",
"efficiently",
"update",
"data",
"source",
"columns",
"with",
"new",
"append",
"-",
"only",
"data",
".",
"The",
"internal",
"implementation",
"adds",
"the",
"setter",
"attribute",
".",
"[",
"https",
":",
"//",
"github",
".",... | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/sources.py#L407-L517 | [
"def",
"_stream",
"(",
"self",
",",
"new_data",
",",
"rollover",
"=",
"None",
",",
"setter",
"=",
"None",
")",
":",
"needs_length_check",
"=",
"True",
"if",
"pd",
"and",
"isinstance",
"(",
"new_data",
",",
"pd",
".",
"Series",
")",
":",
"new_data",
"="... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ColumnDataSource.patch | Efficiently update data source columns at specific locations
If it is only necessary to update a small subset of data in a
``ColumnDataSource``, this method can be used to efficiently update only
the subset, instead of requiring the entire data set to be sent.
This method should be pas... | bokeh/models/sources.py | def patch(self, patches, setter=None):
''' Efficiently update data source columns at specific locations
If it is only necessary to update a small subset of data in a
``ColumnDataSource``, this method can be used to efficiently update only
the subset, instead of requiring the entire data... | def patch(self, patches, setter=None):
''' Efficiently update data source columns at specific locations
If it is only necessary to update a small subset of data in a
``ColumnDataSource``, this method can be used to efficiently update only
the subset, instead of requiring the entire data... | [
"Efficiently",
"update",
"data",
"source",
"columns",
"at",
"specific",
"locations"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/sources.py#L519-L674 | [
"def",
"patch",
"(",
"self",
",",
"patches",
",",
"setter",
"=",
"None",
")",
":",
"import",
"numpy",
"as",
"np",
"extra",
"=",
"set",
"(",
"patches",
".",
"keys",
"(",
")",
")",
"-",
"set",
"(",
"self",
".",
"data",
".",
"keys",
"(",
")",
")",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | silence | Silence a particular warning on all Bokeh models.
Args:
warning (Warning) : Bokeh warning to silence
silence (bool) : Whether or not to silence the warning
Returns:
A set containing the all silenced warnings
This function adds or removes warnings from a set of silencers which
... | bokeh/core/validation/check.py | def silence(warning, silence=True):
''' Silence a particular warning on all Bokeh models.
Args:
warning (Warning) : Bokeh warning to silence
silence (bool) : Whether or not to silence the warning
Returns:
A set containing the all silenced warnings
This function adds or removes... | def silence(warning, silence=True):
''' Silence a particular warning on all Bokeh models.
Args:
warning (Warning) : Bokeh warning to silence
silence (bool) : Whether or not to silence the warning
Returns:
A set containing the all silenced warnings
This function adds or removes... | [
"Silence",
"a",
"particular",
"warning",
"on",
"all",
"Bokeh",
"models",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/validation/check.py#L43-L79 | [
"def",
"silence",
"(",
"warning",
",",
"silence",
"=",
"True",
")",
":",
"if",
"not",
"isinstance",
"(",
"warning",
",",
"int",
")",
":",
"raise",
"ValueError",
"(",
"'Input to silence should be a warning object '",
"'- not of type {}'",
".",
"format",
"(",
"typ... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | check_integrity | Apply validation and integrity checks to a collection of Bokeh models.
Args:
models (seq[Model]) : a collection of Models to test
Returns:
None
This function will emit log warning and error messages for all error or
warning conditions that are detected. For example, layouts without an... | bokeh/core/validation/check.py | def check_integrity(models):
''' Apply validation and integrity checks to a collection of Bokeh models.
Args:
models (seq[Model]) : a collection of Models to test
Returns:
None
This function will emit log warning and error messages for all error or
warning conditions that are dete... | def check_integrity(models):
''' Apply validation and integrity checks to a collection of Bokeh models.
Args:
models (seq[Model]) : a collection of Models to test
Returns:
None
This function will emit log warning and error messages for all error or
warning conditions that are dete... | [
"Apply",
"validation",
"and",
"integrity",
"checks",
"to",
"a",
"collection",
"of",
"Bokeh",
"models",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/validation/check.py#L82-L121 | [
"def",
"check_integrity",
"(",
"models",
")",
":",
"messages",
"=",
"dict",
"(",
"error",
"=",
"[",
"]",
",",
"warning",
"=",
"[",
"]",
")",
"for",
"model",
"in",
"models",
":",
"validators",
"=",
"[",
"]",
"for",
"name",
"in",
"dir",
"(",
"model",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Theme.apply_to_model | Apply this theme to a model.
.. warning::
Typically, don't call this method directly. Instead, set the theme
on the :class:`~bokeh.document.Document` the model is a part of. | bokeh/themes/theme.py | def apply_to_model(self, model):
''' Apply this theme to a model.
.. warning::
Typically, don't call this method directly. Instead, set the theme
on the :class:`~bokeh.document.Document` the model is a part of.
'''
model.apply_theme(self._for_class(model.__class... | def apply_to_model(self, model):
''' Apply this theme to a model.
.. warning::
Typically, don't call this method directly. Instead, set the theme
on the :class:`~bokeh.document.Document` the model is a part of.
'''
model.apply_theme(self._for_class(model.__class... | [
"Apply",
"this",
"theme",
"to",
"a",
"model",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/themes/theme.py#L186-L200 | [
"def",
"apply_to_model",
"(",
"self",
",",
"model",
")",
":",
"model",
".",
"apply_theme",
"(",
"self",
".",
"_for_class",
"(",
"model",
".",
"__class__",
")",
")",
"# a little paranoia because it would be Bad(tm) to mess",
"# this up... would be nicer if python had a way... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | OutputDocumentFor | Find or create a (possibly temporary) Document to use for serializing
Bokeh content.
Typical usage is similar to:
.. code-block:: python
with OutputDocumentFor(models):
(docs_json, [render_item]) = standalone_docs_json_and_render_items(models)
Inside the context manager, the mod... | bokeh/embed/util.py | def OutputDocumentFor(objs, apply_theme=None, always_new=False):
''' Find or create a (possibly temporary) Document to use for serializing
Bokeh content.
Typical usage is similar to:
.. code-block:: python
with OutputDocumentFor(models):
(docs_json, [render_item]) = standalone_do... | def OutputDocumentFor(objs, apply_theme=None, always_new=False):
''' Find or create a (possibly temporary) Document to use for serializing
Bokeh content.
Typical usage is similar to:
.. code-block:: python
with OutputDocumentFor(models):
(docs_json, [render_item]) = standalone_do... | [
"Find",
"or",
"create",
"a",
"(",
"possibly",
"temporary",
")",
"Document",
"to",
"use",
"for",
"serializing",
"Bokeh",
"content",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/util.py#L67-L168 | [
"def",
"OutputDocumentFor",
"(",
"objs",
",",
"apply_theme",
"=",
"None",
",",
"always_new",
"=",
"False",
")",
":",
"# Note: Comms handling relies on the fact that the new_doc returned",
"# has models with the same IDs as they were started with",
"if",
"not",
"isinstance",
"("... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | submodel_has_python_callbacks | Traverses submodels to check for Python (event) callbacks | bokeh/embed/util.py | def submodel_has_python_callbacks(models):
''' Traverses submodels to check for Python (event) callbacks
'''
has_python_callback = False
for model in collect_models(models):
if len(model._callbacks) > 0 or len(model._event_callbacks) > 0:
has_python_callback = True
break... | def submodel_has_python_callbacks(models):
''' Traverses submodels to check for Python (event) callbacks
'''
has_python_callback = False
for model in collect_models(models):
if len(model._callbacks) > 0 or len(model._event_callbacks) > 0:
has_python_callback = True
break... | [
"Traverses",
"submodels",
"to",
"check",
"for",
"Python",
"(",
"event",
")",
"callbacks"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/util.py#L305-L315 | [
"def",
"submodel_has_python_callbacks",
"(",
"models",
")",
":",
"has_python_callback",
"=",
"False",
"for",
"model",
"in",
"collect_models",
"(",
"models",
")",
":",
"if",
"len",
"(",
"model",
".",
"_callbacks",
")",
">",
"0",
"or",
"len",
"(",
"model",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | from_networkx | Generate a ``GraphRenderer`` from a ``networkx.Graph`` object and networkx
layout function. Any keyword arguments will be passed to the
layout function.
Only two dimensional layouts are supported.
Args:
graph (networkx.Graph) : a networkx graph to render
layout_... | bokeh/models/graphs.py | def from_networkx(graph, layout_function, **kwargs):
'''
Generate a ``GraphRenderer`` from a ``networkx.Graph`` object and networkx
layout function. Any keyword arguments will be passed to the
layout function.
Only two dimensional layouts are supported.
Args:
... | def from_networkx(graph, layout_function, **kwargs):
'''
Generate a ``GraphRenderer`` from a ``networkx.Graph`` object and networkx
layout function. Any keyword arguments will be passed to the
layout function.
Only two dimensional layouts are supported.
Args:
... | [
"Generate",
"a",
"GraphRenderer",
"from",
"a",
"networkx",
".",
"Graph",
"object",
"and",
"networkx",
"layout",
"function",
".",
"Any",
"keyword",
"arguments",
"will",
"be",
"passed",
"to",
"the",
"layout",
"function",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/graphs.py#L71-L169 | [
"def",
"from_networkx",
"(",
"graph",
",",
"layout_function",
",",
"*",
"*",
"kwargs",
")",
":",
"# inline import to prevent circular imports",
"from",
".",
".",
"models",
".",
"renderers",
"import",
"GraphRenderer",
"from",
".",
".",
"models",
".",
"graphs",
"i... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | enumeration | Create an |Enumeration| object from a sequence of values.
Call ``enumeration`` with a sequence of (unique) strings to create an
Enumeration object:
.. code-block:: python
#: Specify the horizontal alignment for rendering text
TextAlign = enumeration("left", "right", "center")
Args:
... | bokeh/core/enums.py | def enumeration(*values, **kwargs):
''' Create an |Enumeration| object from a sequence of values.
Call ``enumeration`` with a sequence of (unique) strings to create an
Enumeration object:
.. code-block:: python
#: Specify the horizontal alignment for rendering text
TextAlign = enumera... | def enumeration(*values, **kwargs):
''' Create an |Enumeration| object from a sequence of values.
Call ``enumeration`` with a sequence of (unique) strings to create an
Enumeration object:
.. code-block:: python
#: Specify the horizontal alignment for rendering text
TextAlign = enumera... | [
"Create",
"an",
"|Enumeration|",
"object",
"from",
"a",
"sequence",
"of",
"values",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/enums.py#L176-L223 | [
"def",
"enumeration",
"(",
"*",
"values",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"(",
"values",
"and",
"all",
"(",
"isinstance",
"(",
"value",
",",
"string_types",
")",
"and",
"value",
"for",
"value",
"in",
"values",
")",
")",
":",
"raise",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | generate_session_id | Generate a random session ID.
Typically, each browser tab connected to a Bokeh application
has its own session ID. In production deployments of a Bokeh
app, session IDs should be random and unguessable - otherwise
users of the app could interfere with one another.
If session IDs are signed with a... | bokeh/util/session_id.py | def generate_session_id(secret_key=settings.secret_key_bytes(), signed=settings.sign_sessions()):
"""Generate a random session ID.
Typically, each browser tab connected to a Bokeh application
has its own session ID. In production deployments of a Bokeh
app, session IDs should be random and unguessable... | def generate_session_id(secret_key=settings.secret_key_bytes(), signed=settings.sign_sessions()):
"""Generate a random session ID.
Typically, each browser tab connected to a Bokeh application
has its own session ID. In production deployments of a Bokeh
app, session IDs should be random and unguessable... | [
"Generate",
"a",
"random",
"session",
"ID",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/session_id.py#L63-L91 | [
"def",
"generate_session_id",
"(",
"secret_key",
"=",
"settings",
".",
"secret_key_bytes",
"(",
")",
",",
"signed",
"=",
"settings",
".",
"sign_sessions",
"(",
")",
")",
":",
"secret_key",
"=",
"_ensure_bytes",
"(",
"secret_key",
")",
"if",
"signed",
":",
"#... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | check_session_id_signature | Check the signature of a session ID, returning True if it's valid.
The server uses this function to check whether a session ID
was generated with the correct secret key. If signed sessions are disabled,
this function always returns True.
Args:
session_id (str) : The session ID to check
... | bokeh/util/session_id.py | def check_session_id_signature(session_id, secret_key=settings.secret_key_bytes(),
signed=settings.sign_sessions()):
"""Check the signature of a session ID, returning True if it's valid.
The server uses this function to check whether a session ID
was generated with the correc... | def check_session_id_signature(session_id, secret_key=settings.secret_key_bytes(),
signed=settings.sign_sessions()):
"""Check the signature of a session ID, returning True if it's valid.
The server uses this function to check whether a session ID
was generated with the correc... | [
"Check",
"the",
"signature",
"of",
"a",
"session",
"ID",
"returning",
"True",
"if",
"it",
"s",
"valid",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/session_id.py#L93-L121 | [
"def",
"check_session_id_signature",
"(",
"session_id",
",",
"secret_key",
"=",
"settings",
".",
"secret_key_bytes",
"(",
")",
",",
"signed",
"=",
"settings",
".",
"sign_sessions",
"(",
")",
")",
":",
"secret_key",
"=",
"_ensure_bytes",
"(",
"secret_key",
")",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _get_random_string | Return a securely generated random string.
With the a-z, A-Z, 0-9 character set:
Length 12 is a 71-bit value. log_2((26+26+10)^12) =~ 71
Length 44 is a 261-bit value. log_2((26+26+10)^44) = 261 | bokeh/util/session_id.py | def _get_random_string(length=44,
allowed_chars='abcdefghijklmnopqrstuvwxyz'
'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
secret_key=settings.secret_key_bytes()):
"""
Return a securely generated random string.
With the a-z, A-Z, 0-9 character s... | def _get_random_string(length=44,
allowed_chars='abcdefghijklmnopqrstuvwxyz'
'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
secret_key=settings.secret_key_bytes()):
"""
Return a securely generated random string.
With the a-z, A-Z, 0-9 character s... | [
"Return",
"a",
"securely",
"generated",
"random",
"string",
".",
"With",
"the",
"a",
"-",
"z",
"A",
"-",
"Z",
"0",
"-",
"9",
"character",
"set",
":",
"Length",
"12",
"is",
"a",
"71",
"-",
"bit",
"value",
".",
"log_2",
"((",
"26",
"+",
"26",
"+",
... | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/session_id.py#L192-L204 | [
"def",
"_get_random_string",
"(",
"length",
"=",
"44",
",",
"allowed_chars",
"=",
"'abcdefghijklmnopqrstuvwxyz'",
"'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'",
",",
"secret_key",
"=",
"settings",
".",
"secret_key_bytes",
"(",
")",
")",
":",
"secret_key",
"=",
"_ensure_bytes... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | notebook_content | Return script and div that will display a Bokeh plot in a Jupyter
Notebook.
The data for the plot is stored directly in the returned HTML.
Args:
model (Model) : Bokeh object to render
notebook_comms_target (str, optional) :
A target name for a Jupyter Comms object that can upd... | bokeh/embed/notebook.py | def notebook_content(model, notebook_comms_target=None, theme=FromCurdoc):
''' Return script and div that will display a Bokeh plot in a Jupyter
Notebook.
The data for the plot is stored directly in the returned HTML.
Args:
model (Model) : Bokeh object to render
notebook_comms_target ... | def notebook_content(model, notebook_comms_target=None, theme=FromCurdoc):
''' Return script and div that will display a Bokeh plot in a Jupyter
Notebook.
The data for the plot is stored directly in the returned HTML.
Args:
model (Model) : Bokeh object to render
notebook_comms_target ... | [
"Return",
"script",
"and",
"div",
"that",
"will",
"display",
"a",
"Bokeh",
"plot",
"in",
"a",
"Jupyter",
"Notebook",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/notebook.py#L51-L98 | [
"def",
"notebook_content",
"(",
"model",
",",
"notebook_comms_target",
"=",
"None",
",",
"theme",
"=",
"FromCurdoc",
")",
":",
"if",
"not",
"isinstance",
"(",
"model",
",",
"Model",
")",
":",
"raise",
"ValueError",
"(",
"\"notebook_content expects a single Model i... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | CustomJSTransform.from_py_func | Create a ``CustomJSTransform`` instance from a pair of Python
functions. The function is translated to JavaScript using PScript.
The python functions must have no positional arguments. It's
possible to pass Bokeh models (e.g. a ``ColumnDataSource``) as keyword
arguments to the functions... | bokeh/models/transforms.py | def from_py_func(cls, func, v_func):
''' Create a ``CustomJSTransform`` instance from a pair of Python
functions. The function is translated to JavaScript using PScript.
The python functions must have no positional arguments. It's
possible to pass Bokeh models (e.g. a ``ColumnDataSource... | def from_py_func(cls, func, v_func):
''' Create a ``CustomJSTransform`` instance from a pair of Python
functions. The function is translated to JavaScript using PScript.
The python functions must have no positional arguments. It's
possible to pass Bokeh models (e.g. a ``ColumnDataSource... | [
"Create",
"a",
"CustomJSTransform",
"instance",
"from",
"a",
"pair",
"of",
"Python",
"functions",
".",
"The",
"function",
"is",
"translated",
"to",
"JavaScript",
"using",
"PScript",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/transforms.py#L89-L167 | [
"def",
"from_py_func",
"(",
"cls",
",",
"func",
",",
"v_func",
")",
":",
"from",
"bokeh",
".",
"util",
".",
"deprecation",
"import",
"deprecated",
"deprecated",
"(",
"\"'from_py_func' is deprecated and will be removed in an eventual 2.0 release. \"",
"\"Use CustomJSTransfor... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | CustomJSTransform.from_coffeescript | Create a ``CustomJSTransform`` instance from a pair of CoffeeScript
snippets. The function bodies are translated to JavaScript functions
using node and therefore require return statements.
The ``func`` snippet namespace will contain the variable ``x`` (the
untransformed value) at render... | bokeh/models/transforms.py | def from_coffeescript(cls, func, v_func, args={}):
''' Create a ``CustomJSTransform`` instance from a pair of CoffeeScript
snippets. The function bodies are translated to JavaScript functions
using node and therefore require return statements.
The ``func`` snippet namespace will contain... | def from_coffeescript(cls, func, v_func, args={}):
''' Create a ``CustomJSTransform`` instance from a pair of CoffeeScript
snippets. The function bodies are translated to JavaScript functions
using node and therefore require return statements.
The ``func`` snippet namespace will contain... | [
"Create",
"a",
"CustomJSTransform",
"instance",
"from",
"a",
"pair",
"of",
"CoffeeScript",
"snippets",
".",
"The",
"function",
"bodies",
"are",
"translated",
"to",
"JavaScript",
"functions",
"using",
"node",
"and",
"therefore",
"require",
"return",
"statements",
"... | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/transforms.py#L170-L206 | [
"def",
"from_coffeescript",
"(",
"cls",
",",
"func",
",",
"v_func",
",",
"args",
"=",
"{",
"}",
")",
":",
"compiled",
"=",
"nodejs_compile",
"(",
"func",
",",
"lang",
"=",
"\"coffeescript\"",
",",
"file",
"=",
"\"???\"",
")",
"if",
"\"error\"",
"in",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | abstract | A decorator to mark abstract base classes derived from |HasProps|. | bokeh/core/has_props.py | def abstract(cls):
''' A decorator to mark abstract base classes derived from |HasProps|.
'''
if not issubclass(cls, HasProps):
raise TypeError("%s is not a subclass of HasProps" % cls.__name__)
# running python with -OO will discard docstrings -> __doc__ is None
if cls.__doc__ is not None... | def abstract(cls):
''' A decorator to mark abstract base classes derived from |HasProps|.
'''
if not issubclass(cls, HasProps):
raise TypeError("%s is not a subclass of HasProps" % cls.__name__)
# running python with -OO will discard docstrings -> __doc__ is None
if cls.__doc__ is not None... | [
"A",
"decorator",
"to",
"mark",
"abstract",
"base",
"classes",
"derived",
"from",
"|HasProps|",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/has_props.py#L65-L76 | [
"def",
"abstract",
"(",
"cls",
")",
":",
"if",
"not",
"issubclass",
"(",
"cls",
",",
"HasProps",
")",
":",
"raise",
"TypeError",
"(",
"\"%s is not a subclass of HasProps\"",
"%",
"cls",
".",
"__name__",
")",
"# running python with -OO will discard docstrings -> __doc_... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | accumulate_from_superclasses | Traverse the class hierarchy and accumulate the special sets of names
``MetaHasProps`` stores on classes:
Args:
name (str) : name of the special attribute to collect.
Typically meaningful values are: ``__container_props__``,
``__properties__``, ``__properties_with_refs__`` | bokeh/core/has_props.py | def accumulate_from_superclasses(cls, propname):
''' Traverse the class hierarchy and accumulate the special sets of names
``MetaHasProps`` stores on classes:
Args:
name (str) : name of the special attribute to collect.
Typically meaningful values are: ``__container_props__``,
... | def accumulate_from_superclasses(cls, propname):
''' Traverse the class hierarchy and accumulate the special sets of names
``MetaHasProps`` stores on classes:
Args:
name (str) : name of the special attribute to collect.
Typically meaningful values are: ``__container_props__``,
... | [
"Traverse",
"the",
"class",
"hierarchy",
"and",
"accumulate",
"the",
"special",
"sets",
"of",
"names",
"MetaHasProps",
"stores",
"on",
"classes",
":"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/has_props.py#L191-L212 | [
"def",
"accumulate_from_superclasses",
"(",
"cls",
",",
"propname",
")",
":",
"cachename",
"=",
"\"__cached_all\"",
"+",
"propname",
"# we MUST use cls.__dict__ NOT hasattr(). hasattr() would also look at base",
"# classes, and the cache must be separate for each class",
"if",
"cache... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | accumulate_dict_from_superclasses | Traverse the class hierarchy and accumulate the special dicts
``MetaHasProps`` stores on classes:
Args:
name (str) : name of the special attribute to collect.
Typically meaningful values are: ``__dataspecs__``,
``__overridden_defaults__`` | bokeh/core/has_props.py | def accumulate_dict_from_superclasses(cls, propname):
''' Traverse the class hierarchy and accumulate the special dicts
``MetaHasProps`` stores on classes:
Args:
name (str) : name of the special attribute to collect.
Typically meaningful values are: ``__dataspecs__``,
``__o... | def accumulate_dict_from_superclasses(cls, propname):
''' Traverse the class hierarchy and accumulate the special dicts
``MetaHasProps`` stores on classes:
Args:
name (str) : name of the special attribute to collect.
Typically meaningful values are: ``__dataspecs__``,
``__o... | [
"Traverse",
"the",
"class",
"hierarchy",
"and",
"accumulate",
"the",
"special",
"dicts",
"MetaHasProps",
"stores",
"on",
"classes",
":"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/has_props.py#L214-L237 | [
"def",
"accumulate_dict_from_superclasses",
"(",
"cls",
",",
"propname",
")",
":",
"cachename",
"=",
"\"__cached_all\"",
"+",
"propname",
"# we MUST use cls.__dict__ NOT hasattr(). hasattr() would also look at base",
"# classes, and the cache must be separate for each class",
"if",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | HasProps.equals | Structural equality of models.
Args:
other (HasProps) : the other instance to compare to
Returns:
True, if properties are structurally equal, otherwise False | bokeh/core/has_props.py | def equals(self, other):
''' Structural equality of models.
Args:
other (HasProps) : the other instance to compare to
Returns:
True, if properties are structurally equal, otherwise False
'''
# NOTE: don't try to use this to implement __eq__. Because th... | def equals(self, other):
''' Structural equality of models.
Args:
other (HasProps) : the other instance to compare to
Returns:
True, if properties are structurally equal, otherwise False
'''
# NOTE: don't try to use this to implement __eq__. Because th... | [
"Structural",
"equality",
"of",
"models",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/has_props.py#L295-L314 | [
"def",
"equals",
"(",
"self",
",",
"other",
")",
":",
"# NOTE: don't try to use this to implement __eq__. Because then",
"# you will be tempted to implement __hash__, which would interfere",
"# with mutability of models. However, not implementing __hash__",
"# will make bokeh unusable in Pytho... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | HasProps.set_from_json | Set a property value on this object from JSON.
Args:
name: (str) : name of the attribute to set
json: (JSON-value) : value to set to the attribute to
models (dict or None, optional) :
Mapping of model ids to models (default: None)
This is n... | bokeh/core/has_props.py | def set_from_json(self, name, json, models=None, setter=None):
''' Set a property value on this object from JSON.
Args:
name: (str) : name of the attribute to set
json: (JSON-value) : value to set to the attribute to
models (dict or None, optional) :
... | def set_from_json(self, name, json, models=None, setter=None):
''' Set a property value on this object from JSON.
Args:
name: (str) : name of the attribute to set
json: (JSON-value) : value to set to the attribute to
models (dict or None, optional) :
... | [
"Set",
"a",
"property",
"value",
"on",
"this",
"object",
"from",
"JSON",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/has_props.py#L316-L349 | [
"def",
"set_from_json",
"(",
"self",
",",
"name",
",",
"json",
",",
"models",
"=",
"None",
",",
"setter",
"=",
"None",
")",
":",
"if",
"name",
"in",
"self",
".",
"properties",
"(",
")",
":",
"log",
".",
"trace",
"(",
"\"Patching attribute %r of %r with %... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | HasProps.update_from_json | Updates the object's properties from a JSON attributes dictionary.
Args:
json_attributes: (JSON-dict) : attributes and values to update
models (dict or None, optional) :
Mapping of model ids to models (default: None)
This is needed in cases where the at... | bokeh/core/has_props.py | def update_from_json(self, json_attributes, models=None, setter=None):
''' Updates the object's properties from a JSON attributes dictionary.
Args:
json_attributes: (JSON-dict) : attributes and values to update
models (dict or None, optional) :
Mapping of model ... | def update_from_json(self, json_attributes, models=None, setter=None):
''' Updates the object's properties from a JSON attributes dictionary.
Args:
json_attributes: (JSON-dict) : attributes and values to update
models (dict or None, optional) :
Mapping of model ... | [
"Updates",
"the",
"object",
"s",
"properties",
"from",
"a",
"JSON",
"attributes",
"dictionary",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/has_props.py#L378-L405 | [
"def",
"update_from_json",
"(",
"self",
",",
"json_attributes",
",",
"models",
"=",
"None",
",",
"setter",
"=",
"None",
")",
":",
"for",
"k",
",",
"v",
"in",
"json_attributes",
".",
"items",
"(",
")",
":",
"self",
".",
"set_from_json",
"(",
"k",
",",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | HasProps.properties | Collect the names of properties on this class.
This method *optionally* traverses the class hierarchy and includes
properties defined on any parent classes.
Args:
with_bases (bool, optional) :
Whether to include properties defined on parent classes in
... | bokeh/core/has_props.py | def properties(cls, with_bases=True):
''' Collect the names of properties on this class.
This method *optionally* traverses the class hierarchy and includes
properties defined on any parent classes.
Args:
with_bases (bool, optional) :
Whether to include prop... | def properties(cls, with_bases=True):
''' Collect the names of properties on this class.
This method *optionally* traverses the class hierarchy and includes
properties defined on any parent classes.
Args:
with_bases (bool, optional) :
Whether to include prop... | [
"Collect",
"the",
"names",
"of",
"properties",
"on",
"this",
"class",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/has_props.py#L449-L467 | [
"def",
"properties",
"(",
"cls",
",",
"with_bases",
"=",
"True",
")",
":",
"if",
"with_bases",
":",
"return",
"accumulate_from_superclasses",
"(",
"cls",
",",
"\"__properties__\"",
")",
"else",
":",
"return",
"set",
"(",
"cls",
".",
"__properties__",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | HasProps.properties_with_values | Collect a dict mapping property names to their values.
This method *always* traverses the class hierarchy and includes
properties defined on any parent classes.
Non-serializable properties are skipped and property values are in
"serialized" format which may be slightly different from t... | bokeh/core/has_props.py | def properties_with_values(self, include_defaults=True):
''' Collect a dict mapping property names to their values.
This method *always* traverses the class hierarchy and includes
properties defined on any parent classes.
Non-serializable properties are skipped and property values are ... | def properties_with_values(self, include_defaults=True):
''' Collect a dict mapping property names to their values.
This method *always* traverses the class hierarchy and includes
properties defined on any parent classes.
Non-serializable properties are skipped and property values are ... | [
"Collect",
"a",
"dict",
"mapping",
"property",
"names",
"to",
"their",
"values",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/has_props.py#L496-L517 | [
"def",
"properties_with_values",
"(",
"self",
",",
"include_defaults",
"=",
"True",
")",
":",
"return",
"self",
".",
"query_properties_with_values",
"(",
"lambda",
"prop",
":",
"prop",
".",
"serialized",
",",
"include_defaults",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | HasProps.query_properties_with_values | Query the properties values of |HasProps| instances with a
predicate.
Args:
query (callable) :
A callable that accepts property descriptors and returns True
or False
include_defaults (bool, optional) :
Whether to include propertie... | bokeh/core/has_props.py | def query_properties_with_values(self, query, include_defaults=True):
''' Query the properties values of |HasProps| instances with a
predicate.
Args:
query (callable) :
A callable that accepts property descriptors and returns True
or False
... | def query_properties_with_values(self, query, include_defaults=True):
''' Query the properties values of |HasProps| instances with a
predicate.
Args:
query (callable) :
A callable that accepts property descriptors and returns True
or False
... | [
"Query",
"the",
"properties",
"values",
"of",
"|HasProps|",
"instances",
"with",
"a",
"predicate",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/has_props.py#L528-L570 | [
"def",
"query_properties_with_values",
"(",
"self",
",",
"query",
",",
"include_defaults",
"=",
"True",
")",
":",
"themed_keys",
"=",
"set",
"(",
")",
"result",
"=",
"dict",
"(",
")",
"if",
"include_defaults",
":",
"keys",
"=",
"self",
".",
"properties",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | HasProps.apply_theme | Apply a set of theme values which will be used rather than
defaults, but will not override application-set values.
The passed-in dictionary may be kept around as-is and shared with
other instances to save memory (so neither the caller nor the
|HasProps| instance should modify it).
... | bokeh/core/has_props.py | def apply_theme(self, property_values):
''' Apply a set of theme values which will be used rather than
defaults, but will not override application-set values.
The passed-in dictionary may be kept around as-is and shared with
other instances to save memory (so neither the caller nor the
... | def apply_theme(self, property_values):
''' Apply a set of theme values which will be used rather than
defaults, but will not override application-set values.
The passed-in dictionary may be kept around as-is and shared with
other instances to save memory (so neither the caller nor the
... | [
"Apply",
"a",
"set",
"of",
"theme",
"values",
"which",
"will",
"be",
"used",
"rather",
"than",
"defaults",
"but",
"will",
"not",
"override",
"application",
"-",
"set",
"values",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/has_props.py#L584-L629 | [
"def",
"apply_theme",
"(",
"self",
",",
"property_values",
")",
":",
"old_dict",
"=",
"self",
".",
"themed_values",
"(",
")",
"# if the same theme is set again, it should reuse the same dict",
"if",
"old_dict",
"is",
"property_values",
":",
"return",
"removed",
"=",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | indent | Indent all the lines in a given block of text by a specified amount.
Args:
text (str) :
The text to indent
n (int, optional) :
The amount to indent each line by (default: 2)
ch (char, optional) :
What character to fill the indentation with (default: " "... | bokeh/util/string.py | def indent(text, n=2, ch=" "):
''' Indent all the lines in a given block of text by a specified amount.
Args:
text (str) :
The text to indent
n (int, optional) :
The amount to indent each line by (default: 2)
ch (char, optional) :
What character to ... | def indent(text, n=2, ch=" "):
''' Indent all the lines in a given block of text by a specified amount.
Args:
text (str) :
The text to indent
n (int, optional) :
The amount to indent each line by (default: 2)
ch (char, optional) :
What character to ... | [
"Indent",
"all",
"the",
"lines",
"in",
"a",
"given",
"block",
"of",
"text",
"by",
"a",
"specified",
"amount",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/string.py#L105-L120 | [
"def",
"indent",
"(",
"text",
",",
"n",
"=",
"2",
",",
"ch",
"=",
"\" \"",
")",
":",
"padding",
"=",
"ch",
"*",
"n",
"return",
"\"\\n\"",
".",
"join",
"(",
"padding",
"+",
"line",
"for",
"line",
"in",
"text",
".",
"split",
"(",
"\"\\n\"",
")",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | nice_join | Join together sequences of strings into English-friendly phrases using
the conjunction ``or`` when appropriate.
Args:
seq (seq[str]) : a sequence of strings to nicely join
sep (str, optional) : a sequence delimiter to use (default: ", ")
conjunction (str or None, optional) : a conjuctio... | bokeh/util/string.py | def nice_join(seq, sep=", ", conjuction="or"):
''' Join together sequences of strings into English-friendly phrases using
the conjunction ``or`` when appropriate.
Args:
seq (seq[str]) : a sequence of strings to nicely join
sep (str, optional) : a sequence delimiter to use (default: ", ")
... | def nice_join(seq, sep=", ", conjuction="or"):
''' Join together sequences of strings into English-friendly phrases using
the conjunction ``or`` when appropriate.
Args:
seq (seq[str]) : a sequence of strings to nicely join
sep (str, optional) : a sequence delimiter to use (default: ", ")
... | [
"Join",
"together",
"sequences",
"of",
"strings",
"into",
"English",
"-",
"friendly",
"phrases",
"using",
"the",
"conjunction",
"or",
"when",
"appropriate",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/string.py#L122-L145 | [
"def",
"nice_join",
"(",
"seq",
",",
"sep",
"=",
"\", \"",
",",
"conjuction",
"=",
"\"or\"",
")",
":",
"seq",
"=",
"[",
"str",
"(",
"x",
")",
"for",
"x",
"in",
"seq",
"]",
"if",
"len",
"(",
"seq",
")",
"<=",
"1",
"or",
"conjuction",
"is",
"None... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | snakify | Convert CamelCase to snake_case. | bokeh/util/string.py | def snakify(name, sep='_'):
''' Convert CamelCase to snake_case. '''
name = re.sub("([A-Z]+)([A-Z][a-z])", r"\1%s\2" % sep, name)
name = re.sub("([a-z\\d])([A-Z])", r"\1%s\2" % sep, name)
return name.lower() | def snakify(name, sep='_'):
''' Convert CamelCase to snake_case. '''
name = re.sub("([A-Z]+)([A-Z][a-z])", r"\1%s\2" % sep, name)
name = re.sub("([a-z\\d])([A-Z])", r"\1%s\2" % sep, name)
return name.lower() | [
"Convert",
"CamelCase",
"to",
"snake_case",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/string.py#L147-L151 | [
"def",
"snakify",
"(",
"name",
",",
"sep",
"=",
"'_'",
")",
":",
"name",
"=",
"re",
".",
"sub",
"(",
"\"([A-Z]+)([A-Z][a-z])\"",
",",
"r\"\\1%s\\2\"",
"%",
"sep",
",",
"name",
")",
"name",
"=",
"re",
".",
"sub",
"(",
"\"([a-z\\\\d])([A-Z])\"",
",",
"r\... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _on_session_destroyed | Calls any on_session_destroyed callbacks defined on the Document | bokeh/application/handlers/document_lifecycle.py | def _on_session_destroyed(session_context):
'''
Calls any on_session_destroyed callbacks defined on the Document
'''
callbacks = session_context._document.session_destroyed_callbacks
session_context._document.session_destroyed_callbacks = set()
for callback in callbacks:
try:
... | def _on_session_destroyed(session_context):
'''
Calls any on_session_destroyed callbacks defined on the Document
'''
callbacks = session_context._document.session_destroyed_callbacks
session_context._document.session_destroyed_callbacks = set()
for callback in callbacks:
try:
... | [
"Calls",
"any",
"on_session_destroyed",
"callbacks",
"defined",
"on",
"the",
"Document"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/application/handlers/document_lifecycle.py#L60-L79 | [
"def",
"_on_session_destroyed",
"(",
"session_context",
")",
":",
"callbacks",
"=",
"session_context",
".",
"_document",
".",
"session_destroyed_callbacks",
"session_context",
".",
"_document",
".",
"session_destroyed_callbacks",
"=",
"set",
"(",
")",
"for",
"callback",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | register | Decorator to add a Message (and its revision) to the Protocol index.
Example:
.. code-block:: python
@register
class some_msg_1(Message):
msgtype = 'SOME-MSG'
revision = 1
@classmethod
def create(cls, **metadata):
... | bokeh/protocol/messages/__init__.py | def register(cls):
''' Decorator to add a Message (and its revision) to the Protocol index.
Example:
.. code-block:: python
@register
class some_msg_1(Message):
msgtype = 'SOME-MSG'
revision = 1
@classmethod
de... | def register(cls):
''' Decorator to add a Message (and its revision) to the Protocol index.
Example:
.. code-block:: python
@register
class some_msg_1(Message):
msgtype = 'SOME-MSG'
revision = 1
@classmethod
de... | [
"Decorator",
"to",
"add",
"a",
"Message",
"(",
"and",
"its",
"revision",
")",
"to",
"the",
"Protocol",
"index",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/protocol/messages/__init__.py#L49-L73 | [
"def",
"register",
"(",
"cls",
")",
":",
"key",
"=",
"(",
"cls",
".",
"msgtype",
",",
"cls",
".",
"revision",
")",
"if",
"key",
"in",
"index",
":",
"raise",
"ProtocolError",
"(",
"\"Duplicate message specification encountered: %r\"",
"%",
"key",
")",
"index"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | pull_session | Create a session by loading the current server-side document.
``session.document`` will be a fresh document loaded from
the server. While the connection to the server is open,
changes made on the server side will be applied to this
document, and changes made on the client side will be
synced to the... | bokeh/client/session.py | def pull_session(session_id=None, url='default', io_loop=None, arguments=None):
''' Create a session by loading the current server-side document.
``session.document`` will be a fresh document loaded from
the server. While the connection to the server is open,
changes made on the server side will be app... | def pull_session(session_id=None, url='default', io_loop=None, arguments=None):
''' Create a session by loading the current server-side document.
``session.document`` will be a fresh document loaded from
the server. While the connection to the server is open,
changes made on the server side will be app... | [
"Create",
"a",
"session",
"by",
"loading",
"the",
"current",
"server",
"-",
"side",
"document",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/client/session.py#L68-L125 | [
"def",
"pull_session",
"(",
"session_id",
"=",
"None",
",",
"url",
"=",
"'default'",
",",
"io_loop",
"=",
"None",
",",
"arguments",
"=",
"None",
")",
":",
"coords",
"=",
"_SessionCoordinates",
"(",
"session_id",
"=",
"session_id",
",",
"url",
"=",
"url",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | push_session | Create a session by pushing the given document to the server,
overwriting any existing server-side document.
``session.document`` in the returned session will be your supplied
document. While the connection to the server is open, changes made on the
server side will be applied to this document, and cha... | bokeh/client/session.py | def push_session(document, session_id=None, url='default', io_loop=None):
''' Create a session by pushing the given document to the server,
overwriting any existing server-side document.
``session.document`` in the returned session will be your supplied
document. While the connection to the server is o... | def push_session(document, session_id=None, url='default', io_loop=None):
''' Create a session by pushing the given document to the server,
overwriting any existing server-side document.
``session.document`` in the returned session will be your supplied
document. While the connection to the server is o... | [
"Create",
"a",
"session",
"by",
"pushing",
"the",
"given",
"document",
"to",
"the",
"server",
"overwriting",
"any",
"existing",
"server",
"-",
"side",
"document",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/client/session.py#L127-L169 | [
"def",
"push_session",
"(",
"document",
",",
"session_id",
"=",
"None",
",",
"url",
"=",
"'default'",
",",
"io_loop",
"=",
"None",
")",
":",
"coords",
"=",
"_SessionCoordinates",
"(",
"session_id",
"=",
"session_id",
",",
"url",
"=",
"url",
")",
"session",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | show_session | Open a browser displaying a session document.
If you have a session from ``pull_session()`` or ``push_session`` you
can ``show_session(session=mysession)``. If you don't need to open a
connection to the server yourself, you can show a new session in a
browser by providing just the ``url... | bokeh/client/session.py | def show_session(session_id=None, url='default', session=None, browser=None, new="tab", controller=None):
''' Open a browser displaying a session document.
If you have a session from ``pull_session()`` or ``push_session`` you
can ``show_session(session=mysession)``. If you don't need to open a
... | def show_session(session_id=None, url='default', session=None, browser=None, new="tab", controller=None):
''' Open a browser displaying a session document.
If you have a session from ``pull_session()`` or ``push_session`` you
can ``show_session(session=mysession)``. If you don't need to open a
... | [
"Open",
"a",
"browser",
"displaying",
"a",
"session",
"document",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/client/session.py#L171-L214 | [
"def",
"show_session",
"(",
"session_id",
"=",
"None",
",",
"url",
"=",
"'default'",
",",
"session",
"=",
"None",
",",
"browser",
"=",
"None",
",",
"new",
"=",
"\"tab\"",
",",
"controller",
"=",
"None",
")",
":",
"if",
"session",
"is",
"not",
"None",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ClientSession.loop_until_closed | Execute a blocking loop that runs and executes event callbacks
until the connection is closed (e.g. by hitting Ctrl-C).
While this method can be used to run Bokeh application code "outside"
the Bokeh server, this practice is HIGHLY DISCOURAGED for any real
use case. This function is int... | bokeh/client/session.py | def loop_until_closed(self, suppress_warning=False):
''' Execute a blocking loop that runs and executes event callbacks
until the connection is closed (e.g. by hitting Ctrl-C).
While this method can be used to run Bokeh application code "outside"
the Bokeh server, this practice is HIGHL... | def loop_until_closed(self, suppress_warning=False):
''' Execute a blocking loop that runs and executes event callbacks
until the connection is closed (e.g. by hitting Ctrl-C).
While this method can be used to run Bokeh application code "outside"
the Bokeh server, this practice is HIGHL... | [
"Execute",
"a",
"blocking",
"loop",
"that",
"runs",
"and",
"executes",
"event",
"callbacks",
"until",
"the",
"connection",
"is",
"closed",
"(",
"e",
".",
"g",
".",
"by",
"hitting",
"Ctrl",
"-",
"C",
")",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/client/session.py#L337-L354 | [
"def",
"loop_until_closed",
"(",
"self",
",",
"suppress_warning",
"=",
"False",
")",
":",
"suppress_warning",
"# shut up flake",
"from",
"bokeh",
".",
"util",
".",
"deprecation",
"import",
"deprecated",
"deprecated",
"(",
"\"ClientSession.loop_until_closed is deprecated, ... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ClientSession.pull | Pull the server's state and set it as session.document.
If this is called more than once, session.document will be the same
object instance but its contents will be overwritten.
Automatically calls :func:`connect` before pulling. | bokeh/client/session.py | def pull(self):
''' Pull the server's state and set it as session.document.
If this is called more than once, session.document will be the same
object instance but its contents will be overwritten.
Automatically calls :func:`connect` before pulling.
'''
self.connect()
... | def pull(self):
''' Pull the server's state and set it as session.document.
If this is called more than once, session.document will be the same
object instance but its contents will be overwritten.
Automatically calls :func:`connect` before pulling.
'''
self.connect()
... | [
"Pull",
"the",
"server",
"s",
"state",
"and",
"set",
"it",
"as",
"session",
".",
"document",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/client/session.py#L356-L375 | [
"def",
"pull",
"(",
"self",
")",
":",
"self",
".",
"connect",
"(",
")",
"if",
"not",
"self",
".",
"connected",
":",
"raise",
"IOError",
"(",
"\"Cannot pull session document because we failed to connect to the server (to start the server, try the 'bokeh serve' command)\"",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ClientSession.push | Push the given document to the server and record it as session.document.
If this is called more than once, the Document has to be the same (or None
to mean "session.document").
.. note::
Automatically calls :func:`~connect` before pushing.
Args:
document (:clas... | bokeh/client/session.py | def push(self, document=None):
''' Push the given document to the server and record it as session.document.
If this is called more than once, the Document has to be the same (or None
to mean "session.document").
.. note::
Automatically calls :func:`~connect` before pushing.... | def push(self, document=None):
''' Push the given document to the server and record it as session.document.
If this is called more than once, the Document has to be the same (or None
to mean "session.document").
.. note::
Automatically calls :func:`~connect` before pushing.... | [
"Push",
"the",
"given",
"document",
"to",
"the",
"server",
"and",
"record",
"it",
"as",
"session",
".",
"document",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/client/session.py#L377-L408 | [
"def",
"push",
"(",
"self",
",",
"document",
"=",
"None",
")",
":",
"if",
"self",
".",
"document",
"is",
"None",
":",
"if",
"document",
"is",
"None",
":",
"doc",
"=",
"Document",
"(",
")",
"else",
":",
"doc",
"=",
"document",
"else",
":",
"if",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ClientSession.show | Open a browser displaying this session.
Args:
obj (LayoutDOM object, optional) : a Layout (Row/Column),
Plot or Widget object to display. The object will be added
to the session's document.
browser (str, optional) : browser to show with (default: None)
... | bokeh/client/session.py | def show(self, obj=None, browser=None, new="tab"):
''' Open a browser displaying this session.
Args:
obj (LayoutDOM object, optional) : a Layout (Row/Column),
Plot or Widget object to display. The object will be added
to the session's document.
b... | def show(self, obj=None, browser=None, new="tab"):
''' Open a browser displaying this session.
Args:
obj (LayoutDOM object, optional) : a Layout (Row/Column),
Plot or Widget object to display. The object will be added
to the session's document.
b... | [
"Open",
"a",
"browser",
"displaying",
"this",
"session",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/client/session.py#L419-L441 | [
"def",
"show",
"(",
"self",
",",
"obj",
"=",
"None",
",",
"browser",
"=",
"None",
",",
"new",
"=",
"\"tab\"",
")",
":",
"if",
"obj",
"and",
"obj",
"not",
"in",
"self",
".",
"document",
".",
"roots",
":",
"self",
".",
"document",
".",
"add_root",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ClientSession._notify_disconnected | Called by the ClientConnection we are using to notify us of disconnect. | bokeh/client/session.py | def _notify_disconnected(self):
''' Called by the ClientConnection we are using to notify us of disconnect.
'''
if self.document is not None:
self.document.remove_on_change(self)
self._callbacks.remove_all_callbacks() | def _notify_disconnected(self):
''' Called by the ClientConnection we are using to notify us of disconnect.
'''
if self.document is not None:
self.document.remove_on_change(self)
self._callbacks.remove_all_callbacks() | [
"Called",
"by",
"the",
"ClientConnection",
"we",
"are",
"using",
"to",
"notify",
"us",
"of",
"disconnect",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/client/session.py#L471-L477 | [
"def",
"_notify_disconnected",
"(",
"self",
")",
":",
"if",
"self",
".",
"document",
"is",
"not",
"None",
":",
"self",
".",
"document",
".",
"remove_on_change",
"(",
"self",
")",
"self",
".",
"_callbacks",
".",
"remove_all_callbacks",
"(",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Message.assemble | Creates a new message, assembled from JSON fragments.
Args:
header_json (``JSON``) :
metadata_json (``JSON``) :
content_json (``JSON``) :
Returns:
Message subclass
Raises:
MessageError | bokeh/protocol/message.py | def assemble(cls, header_json, metadata_json, content_json):
''' Creates a new message, assembled from JSON fragments.
Args:
header_json (``JSON``) :
metadata_json (``JSON``) :
content_json (``JSON``) :
Returns:
Message subclass
Raises... | def assemble(cls, header_json, metadata_json, content_json):
''' Creates a new message, assembled from JSON fragments.
Args:
header_json (``JSON``) :
metadata_json (``JSON``) :
content_json (``JSON``) :
Returns:
Message subclass
Raises... | [
"Creates",
"a",
"new",
"message",
"assembled",
"from",
"JSON",
"fragments",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/protocol/message.py#L119-L158 | [
"def",
"assemble",
"(",
"cls",
",",
"header_json",
",",
"metadata_json",
",",
"content_json",
")",
":",
"try",
":",
"header",
"=",
"json_decode",
"(",
"header_json",
")",
"except",
"ValueError",
":",
"raise",
"MessageError",
"(",
"\"header could not be decoded\"",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Message.add_buffer | Associate a buffer header and payload with this message.
Args:
buf_header (``JSON``) : a buffer header
buf_payload (``JSON`` or bytes) : a buffer payload
Returns:
None
Raises:
MessageError | bokeh/protocol/message.py | def add_buffer(self, buf_header, buf_payload):
''' Associate a buffer header and payload with this message.
Args:
buf_header (``JSON``) : a buffer header
buf_payload (``JSON`` or bytes) : a buffer payload
Returns:
None
Raises:
MessageErr... | def add_buffer(self, buf_header, buf_payload):
''' Associate a buffer header and payload with this message.
Args:
buf_header (``JSON``) : a buffer header
buf_payload (``JSON`` or bytes) : a buffer payload
Returns:
None
Raises:
MessageErr... | [
"Associate",
"a",
"buffer",
"header",
"and",
"payload",
"with",
"this",
"message",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/protocol/message.py#L160-L181 | [
"def",
"add_buffer",
"(",
"self",
",",
"buf_header",
",",
"buf_payload",
")",
":",
"if",
"'num_buffers'",
"in",
"self",
".",
"_header",
":",
"self",
".",
"_header",
"[",
"'num_buffers'",
"]",
"+=",
"1",
"else",
":",
"self",
".",
"_header",
"[",
"'num_buf... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Message.assemble_buffer | Add a buffer header and payload that we read from the socket.
This differs from add_buffer() because we're validating vs.
the header's num_buffers, instead of filling in the header.
Args:
buf_header (``JSON``) : a buffer header
buf_payload (``JSON`` or bytes) : a buffer... | bokeh/protocol/message.py | def assemble_buffer(self, buf_header, buf_payload):
''' Add a buffer header and payload that we read from the socket.
This differs from add_buffer() because we're validating vs.
the header's num_buffers, instead of filling in the header.
Args:
buf_header (``JSON``) : a buff... | def assemble_buffer(self, buf_header, buf_payload):
''' Add a buffer header and payload that we read from the socket.
This differs from add_buffer() because we're validating vs.
the header's num_buffers, instead of filling in the header.
Args:
buf_header (``JSON``) : a buff... | [
"Add",
"a",
"buffer",
"header",
"and",
"payload",
"that",
"we",
"read",
"from",
"the",
"socket",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/protocol/message.py#L183-L201 | [
"def",
"assemble_buffer",
"(",
"self",
",",
"buf_header",
",",
"buf_payload",
")",
":",
"if",
"self",
".",
"header",
".",
"get",
"(",
"'num_buffers'",
",",
"0",
")",
"<=",
"len",
"(",
"self",
".",
"_buffers",
")",
":",
"raise",
"ProtocolError",
"(",
"\... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Message.write_buffers | Write any buffer headers and payloads to the given connection.
Args:
conn (object) :
May be any object with a ``write_message`` method. Typically,
a Tornado ``WSHandler`` or ``WebSocketClientConnection``
locked (bool) :
Returns:
int ... | bokeh/protocol/message.py | def write_buffers(self, conn, locked=True):
''' Write any buffer headers and payloads to the given connection.
Args:
conn (object) :
May be any object with a ``write_message`` method. Typically,
a Tornado ``WSHandler`` or ``WebSocketClientConnection``
... | def write_buffers(self, conn, locked=True):
''' Write any buffer headers and payloads to the given connection.
Args:
conn (object) :
May be any object with a ``write_message`` method. Typically,
a Tornado ``WSHandler`` or ``WebSocketClientConnection``
... | [
"Write",
"any",
"buffer",
"headers",
"and",
"payloads",
"to",
"the",
"given",
"connection",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/protocol/message.py#L204-L225 | [
"def",
"write_buffers",
"(",
"self",
",",
"conn",
",",
"locked",
"=",
"True",
")",
":",
"if",
"conn",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Cannot write_buffers to connection None\"",
")",
"sent",
"=",
"0",
"for",
"header",
",",
"payload",
"in",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Message.create_header | Return a message header fragment dict.
Args:
request_id (str or None) :
Message ID of the message this message replies to
Returns:
dict : a message header | bokeh/protocol/message.py | def create_header(cls, request_id=None):
''' Return a message header fragment dict.
Args:
request_id (str or None) :
Message ID of the message this message replies to
Returns:
dict : a message header
'''
header = {
'msgid' ... | def create_header(cls, request_id=None):
''' Return a message header fragment dict.
Args:
request_id (str or None) :
Message ID of the message this message replies to
Returns:
dict : a message header
'''
header = {
'msgid' ... | [
"Return",
"a",
"message",
"header",
"fragment",
"dict",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/protocol/message.py#L228-L245 | [
"def",
"create_header",
"(",
"cls",
",",
"request_id",
"=",
"None",
")",
":",
"header",
"=",
"{",
"'msgid'",
":",
"bkserial",
".",
"make_id",
"(",
")",
",",
"'msgtype'",
":",
"cls",
".",
"msgtype",
"}",
"if",
"request_id",
"is",
"not",
"None",
":",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Message.send | Send the message on the given connection.
Args:
conn (WebSocketHandler) : a WebSocketHandler to send messages
Returns:
int : number of bytes sent | bokeh/protocol/message.py | def send(self, conn):
''' Send the message on the given connection.
Args:
conn (WebSocketHandler) : a WebSocketHandler to send messages
Returns:
int : number of bytes sent
'''
if conn is None:
raise ValueError("Cannot send to connection None... | def send(self, conn):
''' Send the message on the given connection.
Args:
conn (WebSocketHandler) : a WebSocketHandler to send messages
Returns:
int : number of bytes sent
'''
if conn is None:
raise ValueError("Cannot send to connection None... | [
"Send",
"the",
"message",
"on",
"the",
"given",
"connection",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/protocol/message.py#L248-L281 | [
"def",
"send",
"(",
"self",
",",
"conn",
")",
":",
"if",
"conn",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Cannot send to connection None\"",
")",
"with",
"(",
"yield",
"conn",
".",
"write_lock",
".",
"acquire",
"(",
")",
")",
":",
"sent",
"=",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Message.complete | Returns whether all required parts of a message are present.
Returns:
bool : True if the message is complete, False otherwise | bokeh/protocol/message.py | def complete(self):
''' Returns whether all required parts of a message are present.
Returns:
bool : True if the message is complete, False otherwise
'''
return self.header is not None and \
self.metadata is not None and \
self.content is not None an... | def complete(self):
''' Returns whether all required parts of a message are present.
Returns:
bool : True if the message is complete, False otherwise
'''
return self.header is not None and \
self.metadata is not None and \
self.content is not None an... | [
"Returns",
"whether",
"all",
"required",
"parts",
"of",
"a",
"message",
"are",
"present",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/protocol/message.py#L284-L294 | [
"def",
"complete",
"(",
"self",
")",
":",
"return",
"self",
".",
"header",
"is",
"not",
"None",
"and",
"self",
".",
"metadata",
"is",
"not",
"None",
"and",
"self",
".",
"content",
"is",
"not",
"None",
"and",
"self",
".",
"header",
".",
"get",
"(",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | basicConfig | A logging.basicConfig() wrapper that also undoes the default
Bokeh-specific configuration. | bokeh/util/logconfig.py | def basicConfig(*args, **kwargs):
"""
A logging.basicConfig() wrapper that also undoes the default
Bokeh-specific configuration.
"""
if default_handler is not None:
bokeh_logger.removeHandler(default_handler)
bokeh_logger.propagate = True
return logging.basicConfig(*args, **kwarg... | def basicConfig(*args, **kwargs):
"""
A logging.basicConfig() wrapper that also undoes the default
Bokeh-specific configuration.
"""
if default_handler is not None:
bokeh_logger.removeHandler(default_handler)
bokeh_logger.propagate = True
return logging.basicConfig(*args, **kwarg... | [
"A",
"logging",
".",
"basicConfig",
"()",
"wrapper",
"that",
"also",
"undoes",
"the",
"default",
"Bokeh",
"-",
"specific",
"configuration",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/logconfig.py#L57-L65 | [
"def",
"basicConfig",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"default_handler",
"is",
"not",
"None",
":",
"bokeh_logger",
".",
"removeHandler",
"(",
"default_handler",
")",
"bokeh_logger",
".",
"propagate",
"=",
"True",
"return",
"logging... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | deprecated | Issue a nicely formatted deprecation warning. | bokeh/util/deprecation.py | def deprecated(since_or_msg, old=None, new=None, extra=None):
""" Issue a nicely formatted deprecation warning. """
if isinstance(since_or_msg, tuple):
if old is None or new is None:
raise ValueError("deprecated entity and a replacement are required")
if len(since_or_msg) != 3 or n... | def deprecated(since_or_msg, old=None, new=None, extra=None):
""" Issue a nicely formatted deprecation warning. """
if isinstance(since_or_msg, tuple):
if old is None or new is None:
raise ValueError("deprecated entity and a replacement are required")
if len(since_or_msg) != 3 or n... | [
"Issue",
"a",
"nicely",
"formatted",
"deprecation",
"warning",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/deprecation.py#L45-L68 | [
"def",
"deprecated",
"(",
"since_or_msg",
",",
"old",
"=",
"None",
",",
"new",
"=",
"None",
",",
"extra",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"since_or_msg",
",",
"tuple",
")",
":",
"if",
"old",
"is",
"None",
"or",
"new",
"is",
"None",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | main | Execute the "bokeh" command line program. | bokeh/__main__.py | def main():
''' Execute the "bokeh" command line program.
'''
import sys
from bokeh.command.bootstrap import main as _main
# Main entry point (see setup.py)
_main(sys.argv) | def main():
''' Execute the "bokeh" command line program.
'''
import sys
from bokeh.command.bootstrap import main as _main
# Main entry point (see setup.py)
_main(sys.argv) | [
"Execute",
"the",
"bokeh",
"command",
"line",
"program",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/__main__.py#L56-L64 | [
"def",
"main",
"(",
")",
":",
"import",
"sys",
"from",
"bokeh",
".",
"command",
".",
"bootstrap",
"import",
"main",
"as",
"_main",
"# Main entry point (see setup.py)",
"_main",
"(",
"sys",
".",
"argv",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ServerConnection.detach_session | Allow the session to be discarded and don't get change notifications from it anymore | bokeh/server/connection.py | def detach_session(self):
"""Allow the session to be discarded and don't get change notifications from it anymore"""
if self._session is not None:
self._session.unsubscribe(self)
self._session = None | def detach_session(self):
"""Allow the session to be discarded and don't get change notifications from it anymore"""
if self._session is not None:
self._session.unsubscribe(self)
self._session = None | [
"Allow",
"the",
"session",
"to",
"be",
"discarded",
"and",
"don",
"t",
"get",
"change",
"notifications",
"from",
"it",
"anymore"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/connection.py#L62-L66 | [
"def",
"detach_session",
"(",
"self",
")",
":",
"if",
"self",
".",
"_session",
"is",
"not",
"None",
":",
"self",
".",
"_session",
".",
"unsubscribe",
"(",
"self",
")",
"self",
".",
"_session",
"=",
"None"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ServerConnection.send_patch_document | Sends a PATCH-DOC message, returning a Future that's completed when it's written out. | bokeh/server/connection.py | def send_patch_document(self, event):
""" Sends a PATCH-DOC message, returning a Future that's completed when it's written out. """
msg = self.protocol.create('PATCH-DOC', [event])
return self._socket.send_message(msg) | def send_patch_document(self, event):
""" Sends a PATCH-DOC message, returning a Future that's completed when it's written out. """
msg = self.protocol.create('PATCH-DOC', [event])
return self._socket.send_message(msg) | [
"Sends",
"a",
"PATCH",
"-",
"DOC",
"message",
"returning",
"a",
"Future",
"that",
"s",
"completed",
"when",
"it",
"s",
"written",
"out",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/connection.py#L74-L77 | [
"def",
"send_patch_document",
"(",
"self",
",",
"event",
")",
":",
"msg",
"=",
"self",
".",
"protocol",
".",
"create",
"(",
"'PATCH-DOC'",
",",
"[",
"event",
"]",
")",
"return",
"self",
".",
"_socket",
".",
"send_message",
"(",
"msg",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | initialize_references_json | Given a JSON representation of the models in a graph, and new model
objects, set the properties on the models from the JSON
Args:
references_json (``JSON``)
JSON specifying attributes and values to initialize new model
objects with.
references (dict[str, Model])
... | bokeh/document/util.py | def initialize_references_json(references_json, references, setter=None):
''' Given a JSON representation of the models in a graph, and new model
objects, set the properties on the models from the JSON
Args:
references_json (``JSON``)
JSON specifying attributes and values to initialize ... | def initialize_references_json(references_json, references, setter=None):
''' Given a JSON representation of the models in a graph, and new model
objects, set the properties on the models from the JSON
Args:
references_json (``JSON``)
JSON specifying attributes and values to initialize ... | [
"Given",
"a",
"JSON",
"representation",
"of",
"the",
"models",
"in",
"a",
"graph",
"and",
"new",
"model",
"objects",
"set",
"the",
"properties",
"on",
"the",
"models",
"from",
"the",
"JSON"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/util.py#L50-L90 | [
"def",
"initialize_references_json",
"(",
"references_json",
",",
"references",
",",
"setter",
"=",
"None",
")",
":",
"for",
"obj",
"in",
"references_json",
":",
"obj_id",
"=",
"obj",
"[",
"'id'",
"]",
"obj_attrs",
"=",
"obj",
"[",
"'attributes'",
"]",
"inst... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | instantiate_references_json | Given a JSON representation of all the models in a graph, return a
dict of new model objects.
Args:
references_json (``JSON``)
JSON specifying new Bokeh models to create
Returns:
dict[str, Model] | bokeh/document/util.py | def instantiate_references_json(references_json):
''' Given a JSON representation of all the models in a graph, return a
dict of new model objects.
Args:
references_json (``JSON``)
JSON specifying new Bokeh models to create
Returns:
dict[str, Model]
'''
# Create a... | def instantiate_references_json(references_json):
''' Given a JSON representation of all the models in a graph, return a
dict of new model objects.
Args:
references_json (``JSON``)
JSON specifying new Bokeh models to create
Returns:
dict[str, Model]
'''
# Create a... | [
"Given",
"a",
"JSON",
"representation",
"of",
"all",
"the",
"models",
"in",
"a",
"graph",
"return",
"a",
"dict",
"of",
"new",
"model",
"objects",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/util.py#L92-L117 | [
"def",
"instantiate_references_json",
"(",
"references_json",
")",
":",
"# Create all instances, but without setting their props",
"references",
"=",
"{",
"}",
"for",
"obj",
"in",
"references_json",
":",
"obj_id",
"=",
"obj",
"[",
"'id'",
"]",
"obj_type",
"=",
"obj",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | references_json | Given a list of all models in a graph, return JSON representing
them and their properties.
Args:
references (seq[Model]) :
A list of models to convert to JSON
Returns:
list | bokeh/document/util.py | def references_json(references):
''' Given a list of all models in a graph, return JSON representing
them and their properties.
Args:
references (seq[Model]) :
A list of models to convert to JSON
Returns:
list
'''
references_json = []
for r in references:
... | def references_json(references):
''' Given a list of all models in a graph, return JSON representing
them and their properties.
Args:
references (seq[Model]) :
A list of models to convert to JSON
Returns:
list
'''
references_json = []
for r in references:
... | [
"Given",
"a",
"list",
"of",
"all",
"models",
"in",
"a",
"graph",
"return",
"JSON",
"representing",
"them",
"and",
"their",
"properties",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/util.py#L119-L138 | [
"def",
"references_json",
"(",
"references",
")",
":",
"references_json",
"=",
"[",
"]",
"for",
"r",
"in",
"references",
":",
"ref",
"=",
"r",
".",
"ref",
"ref",
"[",
"'attributes'",
"]",
"=",
"r",
".",
"_to_json_like",
"(",
"include_defaults",
"=",
"Fal... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Event.decode_json | Custom JSON decoder for Events.
Can be used as the ``object_hook`` argument of ``json.load`` or
``json.loads``.
Args:
dct (dict) : a JSON dictionary to decode
The dictionary should have keys ``event_name`` and ``event_values``
Raises:
ValueError... | bokeh/events.py | def decode_json(cls, dct):
''' Custom JSON decoder for Events.
Can be used as the ``object_hook`` argument of ``json.load`` or
``json.loads``.
Args:
dct (dict) : a JSON dictionary to decode
The dictionary should have keys ``event_name`` and ``event_values``
... | def decode_json(cls, dct):
''' Custom JSON decoder for Events.
Can be used as the ``object_hook`` argument of ``json.load`` or
``json.loads``.
Args:
dct (dict) : a JSON dictionary to decode
The dictionary should have keys ``event_name`` and ``event_values``
... | [
"Custom",
"JSON",
"decoder",
"for",
"Events",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/events.py#L150-L186 | [
"def",
"decode_json",
"(",
"cls",
",",
"dct",
")",
":",
"if",
"not",
"(",
"'event_name'",
"in",
"dct",
"and",
"'event_values'",
"in",
"dct",
")",
":",
"return",
"dct",
"event_name",
"=",
"dct",
"[",
"'event_name'",
"]",
"if",
"event_name",
"not",
"in",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | bokeh_palette | Generate an inline visual representations of a single color palette.
This function evaluates the expression ``"palette = %s" % text``, in the
context of a ``globals`` namespace that has previously imported all of
``bokeh.plotting``. The resulting value for ``palette`` is used to
construct a sequence of... | bokeh/sphinxext/bokeh_palette.py | def bokeh_palette(name, rawtext, text, lineno, inliner, options=None, content=None):
''' Generate an inline visual representations of a single color palette.
This function evaluates the expression ``"palette = %s" % text``, in the
context of a ``globals`` namespace that has previously imported all of
`... | def bokeh_palette(name, rawtext, text, lineno, inliner, options=None, content=None):
''' Generate an inline visual representations of a single color palette.
This function evaluates the expression ``"palette = %s" % text``, in the
context of a ``globals`` namespace that has previously imported all of
`... | [
"Generate",
"an",
"inline",
"visual",
"representations",
"of",
"a",
"single",
"color",
"palette",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_palette.py#L89-L115 | [
"def",
"bokeh_palette",
"(",
"name",
",",
"rawtext",
",",
"text",
",",
"lineno",
",",
"inliner",
",",
"options",
"=",
"None",
",",
"content",
"=",
"None",
")",
":",
"try",
":",
"exec",
"(",
"\"palette = %s\"",
"%",
"text",
",",
"_globals",
")",
"except... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | cumsum | Create a Create a ``DataSpec`` dict to generate a ``CumSum`` expression
for a ``ColumnDataSource``.
Examples:
.. code-block:: python
p.wedge(start_angle=cumsum('angle', include_zero=True),
end_angle=cumsum('angle'),
...)
will generate a ``C... | bokeh/transform.py | def cumsum(field, include_zero=False):
''' Create a Create a ``DataSpec`` dict to generate a ``CumSum`` expression
for a ``ColumnDataSource``.
Examples:
.. code-block:: python
p.wedge(start_angle=cumsum('angle', include_zero=True),
end_angle=cumsum('angle'),
... | def cumsum(field, include_zero=False):
''' Create a Create a ``DataSpec`` dict to generate a ``CumSum`` expression
for a ``ColumnDataSource``.
Examples:
.. code-block:: python
p.wedge(start_angle=cumsum('angle', include_zero=True),
end_angle=cumsum('angle'),
... | [
"Create",
"a",
"Create",
"a",
"DataSpec",
"dict",
"to",
"generate",
"a",
"CumSum",
"expression",
"for",
"a",
"ColumnDataSource",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/transform.py#L55-L74 | [
"def",
"cumsum",
"(",
"field",
",",
"include_zero",
"=",
"False",
")",
":",
"return",
"expr",
"(",
"CumSum",
"(",
"field",
"=",
"field",
",",
"include_zero",
"=",
"include_zero",
")",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | dodge | Create a ``DataSpec`` dict that applies a client-side ``Jitter``
transformation to a ``ColumnDataSource`` column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
value (float) : the fixed offset to add to column data
range (Range, optional) : a range to use for co... | bokeh/transform.py | def dodge(field_name, value, range=None):
''' Create a ``DataSpec`` dict that applies a client-side ``Jitter``
transformation to a ``ColumnDataSource`` column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
value (float) : the fixed offset to add to column data
... | def dodge(field_name, value, range=None):
''' Create a ``DataSpec`` dict that applies a client-side ``Jitter``
transformation to a ``ColumnDataSource`` column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
value (float) : the fixed offset to add to column data
... | [
"Create",
"a",
"DataSpec",
"dict",
"that",
"applies",
"a",
"client",
"-",
"side",
"Jitter",
"transformation",
"to",
"a",
"ColumnDataSource",
"column",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/transform.py#L76-L93 | [
"def",
"dodge",
"(",
"field_name",
",",
"value",
",",
"range",
"=",
"None",
")",
":",
"return",
"field",
"(",
"field_name",
",",
"Dodge",
"(",
"value",
"=",
"value",
",",
"range",
"=",
"range",
")",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | factor_cmap | Create a ``DataSpec`` dict that applies a client-side
``CategoricalColorMapper`` transformation to a ``ColumnDataSource``
column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
palette (seq[color]) : a list of colors to use for colormapping
factors (seq) : a ... | bokeh/transform.py | def factor_cmap(field_name, palette, factors, start=0, end=None, nan_color="gray"):
''' Create a ``DataSpec`` dict that applies a client-side
``CategoricalColorMapper`` transformation to a ``ColumnDataSource``
column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
... | def factor_cmap(field_name, palette, factors, start=0, end=None, nan_color="gray"):
''' Create a ``DataSpec`` dict that applies a client-side
``CategoricalColorMapper`` transformation to a ``ColumnDataSource``
column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
... | [
"Create",
"a",
"DataSpec",
"dict",
"that",
"applies",
"a",
"client",
"-",
"side",
"CategoricalColorMapper",
"transformation",
"to",
"a",
"ColumnDataSource",
"column",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/transform.py#L95-L125 | [
"def",
"factor_cmap",
"(",
"field_name",
",",
"palette",
",",
"factors",
",",
"start",
"=",
"0",
",",
"end",
"=",
"None",
",",
"nan_color",
"=",
"\"gray\"",
")",
":",
"return",
"field",
"(",
"field_name",
",",
"CategoricalColorMapper",
"(",
"palette",
"=",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | factor_hatch | Create a ``DataSpec`` dict that applies a client-side
``CategoricalPatternMapper`` transformation to a ``ColumnDataSource``
column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
patterns (seq[string]) : a list of hatch patterns to use to map to
factors (seq)... | bokeh/transform.py | def factor_hatch(field_name, patterns, factors, start=0, end=None):
''' Create a ``DataSpec`` dict that applies a client-side
``CategoricalPatternMapper`` transformation to a ``ColumnDataSource``
column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
patterns (seq... | def factor_hatch(field_name, patterns, factors, start=0, end=None):
''' Create a ``DataSpec`` dict that applies a client-side
``CategoricalPatternMapper`` transformation to a ``ColumnDataSource``
column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
patterns (seq... | [
"Create",
"a",
"DataSpec",
"dict",
"that",
"applies",
"a",
"client",
"-",
"side",
"CategoricalPatternMapper",
"transformation",
"to",
"a",
"ColumnDataSource",
"column",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/transform.py#L127-L155 | [
"def",
"factor_hatch",
"(",
"field_name",
",",
"patterns",
",",
"factors",
",",
"start",
"=",
"0",
",",
"end",
"=",
"None",
")",
":",
"return",
"field",
"(",
"field_name",
",",
"CategoricalPatternMapper",
"(",
"patterns",
"=",
"patterns",
",",
"factors",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | factor_mark | Create a ``DataSpec`` dict that applies a client-side
``CategoricalMarkerMapper`` transformation to a ``ColumnDataSource``
column.
.. note::
This transform is primarily only useful with ``scatter``, which
can be parameterized by glyph type.
Args:
field_name (str) : a field name... | bokeh/transform.py | def factor_mark(field_name, markers, factors, start=0, end=None):
''' Create a ``DataSpec`` dict that applies a client-side
``CategoricalMarkerMapper`` transformation to a ``ColumnDataSource``
column.
.. note::
This transform is primarily only useful with ``scatter``, which
can be param... | def factor_mark(field_name, markers, factors, start=0, end=None):
''' Create a ``DataSpec`` dict that applies a client-side
``CategoricalMarkerMapper`` transformation to a ``ColumnDataSource``
column.
.. note::
This transform is primarily only useful with ``scatter``, which
can be param... | [
"Create",
"a",
"DataSpec",
"dict",
"that",
"applies",
"a",
"client",
"-",
"side",
"CategoricalMarkerMapper",
"transformation",
"to",
"a",
"ColumnDataSource",
"column",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/transform.py#L157-L187 | [
"def",
"factor_mark",
"(",
"field_name",
",",
"markers",
",",
"factors",
",",
"start",
"=",
"0",
",",
"end",
"=",
"None",
")",
":",
"return",
"field",
"(",
"field_name",
",",
"CategoricalMarkerMapper",
"(",
"markers",
"=",
"markers",
",",
"factors",
"=",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | jitter | Create a ``DataSpec`` dict that applies a client-side ``Jitter``
transformation to a ``ColumnDataSource`` column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
width (float) : the width of the random distribution to apply
mean (float, optional) : an offset to ap... | bokeh/transform.py | def jitter(field_name, width, mean=0, distribution="uniform", range=None):
''' Create a ``DataSpec`` dict that applies a client-side ``Jitter``
transformation to a ``ColumnDataSource`` column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
width (float) : the width of... | def jitter(field_name, width, mean=0, distribution="uniform", range=None):
''' Create a ``DataSpec`` dict that applies a client-side ``Jitter``
transformation to a ``ColumnDataSource`` column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
width (float) : the width of... | [
"Create",
"a",
"DataSpec",
"dict",
"that",
"applies",
"a",
"client",
"-",
"side",
"Jitter",
"transformation",
"to",
"a",
"ColumnDataSource",
"column",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/transform.py#L189-L214 | [
"def",
"jitter",
"(",
"field_name",
",",
"width",
",",
"mean",
"=",
"0",
",",
"distribution",
"=",
"\"uniform\"",
",",
"range",
"=",
"None",
")",
":",
"return",
"field",
"(",
"field_name",
",",
"Jitter",
"(",
"mean",
"=",
"mean",
",",
"width",
"=",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | linear_cmap | Create a ``DataSpec`` dict that applyies a client-side
``LinearColorMapper`` transformation to a ``ColumnDataSource`` column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
palette (seq[color]) : a list of colors to use for colormapping
low (float) : a minimum va... | bokeh/transform.py | def linear_cmap(field_name, palette, low, high, low_color=None, high_color=None, nan_color="gray"):
''' Create a ``DataSpec`` dict that applyies a client-side
``LinearColorMapper`` transformation to a ``ColumnDataSource`` column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
... | def linear_cmap(field_name, palette, low, high, low_color=None, high_color=None, nan_color="gray"):
''' Create a ``DataSpec`` dict that applyies a client-side
``LinearColorMapper`` transformation to a ``ColumnDataSource`` column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
... | [
"Create",
"a",
"DataSpec",
"dict",
"that",
"applyies",
"a",
"client",
"-",
"side",
"LinearColorMapper",
"transformation",
"to",
"a",
"ColumnDataSource",
"column",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/transform.py#L216-L248 | [
"def",
"linear_cmap",
"(",
"field_name",
",",
"palette",
",",
"low",
",",
"high",
",",
"low_color",
"=",
"None",
",",
"high_color",
"=",
"None",
",",
"nan_color",
"=",
"\"gray\"",
")",
":",
"return",
"field",
"(",
"field_name",
",",
"LinearColorMapper",
"(... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | log_cmap | Create a ``DataSpec`` dict that applies a client-side ``LogColorMapper``
transformation to a ``ColumnDataSource`` column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
palette (seq[color]) : a list of colors to use for colormapping
low (float) : a minimum value ... | bokeh/transform.py | def log_cmap(field_name, palette, low, high, low_color=None, high_color=None, nan_color="gray"):
''' Create a ``DataSpec`` dict that applies a client-side ``LogColorMapper``
transformation to a ``ColumnDataSource`` column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
... | def log_cmap(field_name, palette, low, high, low_color=None, high_color=None, nan_color="gray"):
''' Create a ``DataSpec`` dict that applies a client-side ``LogColorMapper``
transformation to a ``ColumnDataSource`` column.
Args:
field_name (str) : a field name to configure ``DataSpec`` with
... | [
"Create",
"a",
"DataSpec",
"dict",
"that",
"applies",
"a",
"client",
"-",
"side",
"LogColorMapper",
"transformation",
"to",
"a",
"ColumnDataSource",
"column",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/transform.py#L250-L282 | [
"def",
"log_cmap",
"(",
"field_name",
",",
"palette",
",",
"low",
",",
"high",
",",
"low_color",
"=",
"None",
",",
"high_color",
"=",
"None",
",",
"nan_color",
"=",
"\"gray\"",
")",
":",
"return",
"field",
"(",
"field_name",
",",
"LogColorMapper",
"(",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | get_browser_controller | Return a browser controller.
Args:
browser (str or None) : browser name, or ``None`` (default: ``None``)
If passed the string ``'none'``, a dummy web browser controller
is returned
Otherwise, use the value to select an appropriate controller using
the ``webb... | bokeh/util/browser.py | def get_browser_controller(browser=None):
''' Return a browser controller.
Args:
browser (str or None) : browser name, or ``None`` (default: ``None``)
If passed the string ``'none'``, a dummy web browser controller
is returned
Otherwise, use the value to select an a... | def get_browser_controller(browser=None):
''' Return a browser controller.
Args:
browser (str or None) : browser name, or ``None`` (default: ``None``)
If passed the string ``'none'``, a dummy web browser controller
is returned
Otherwise, use the value to select an a... | [
"Return",
"a",
"browser",
"controller",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/browser.py#L56-L86 | [
"def",
"get_browser_controller",
"(",
"browser",
"=",
"None",
")",
":",
"browser",
"=",
"settings",
".",
"browser",
"(",
"browser",
")",
"if",
"browser",
"is",
"not",
"None",
":",
"if",
"browser",
"==",
"'none'",
":",
"controller",
"=",
"DummyWebBrowser",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | view | Open a browser to view the specified location.
Args:
location (str) : Location to open
If location does not begin with "http:" it is assumed
to be a file path on the local filesystem.
browser (str or None) : what browser to use (default: None)
... | bokeh/util/browser.py | def view(location, browser=None, new="same", autoraise=True):
''' Open a browser to view the specified location.
Args:
location (str) : Location to open
If location does not begin with "http:" it is assumed
to be a file path on the local filesystem.
... | def view(location, browser=None, new="same", autoraise=True):
''' Open a browser to view the specified location.
Args:
location (str) : Location to open
If location does not begin with "http:" it is assumed
to be a file path on the local filesystem.
... | [
"Open",
"a",
"browser",
"to",
"view",
"the",
"specified",
"location",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/browser.py#L88-L127 | [
"def",
"view",
"(",
"location",
",",
"browser",
"=",
"None",
",",
"new",
"=",
"\"same\"",
",",
"autoraise",
"=",
"True",
")",
":",
"try",
":",
"new",
"=",
"{",
"\"same\"",
":",
"0",
",",
"\"window\"",
":",
"1",
",",
"\"tab\"",
":",
"2",
"}",
"[",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | CustomJSFilter.from_py_func | Create a ``CustomJSFilter`` instance from a Python function. The
function is translated to JavaScript using PScript.
The ``func`` function namespace will contain the variable ``source``
at render time. This will be the data source associated with the ``CDSView``
that this filter is adde... | bokeh/models/filters.py | def from_py_func(cls, func):
''' Create a ``CustomJSFilter`` instance from a Python function. The
function is translated to JavaScript using PScript.
The ``func`` function namespace will contain the variable ``source``
at render time. This will be the data source associated with the ``C... | def from_py_func(cls, func):
''' Create a ``CustomJSFilter`` instance from a Python function. The
function is translated to JavaScript using PScript.
The ``func`` function namespace will contain the variable ``source``
at render time. This will be the data source associated with the ``C... | [
"Create",
"a",
"CustomJSFilter",
"instance",
"from",
"a",
"Python",
"function",
".",
"The",
"function",
"is",
"translated",
"to",
"JavaScript",
"using",
"PScript",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/filters.py#L125-L162 | [
"def",
"from_py_func",
"(",
"cls",
",",
"func",
")",
":",
"from",
"bokeh",
".",
"util",
".",
"deprecation",
"import",
"deprecated",
"deprecated",
"(",
"\"'from_py_func' is deprecated and will be removed in an eventual 2.0 release. \"",
"\"Use CustomJSFilter directly instead.\""... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | streamlines | Return streamlines of a vector flow.
* x and y are 1d arrays defining an *evenly spaced* grid.
* u and v are 2d arrays (shape [y,x]) giving velocities.
* density controls the closeness of the streamlines. For different
densities in each direction, use a tuple or list [densityx, densityy]. | examples/plotting/file/vector.py | def streamlines(x, y, u, v, density=1):
''' Return streamlines of a vector flow.
* x and y are 1d arrays defining an *evenly spaced* grid.
* u and v are 2d arrays (shape [y,x]) giving velocities.
* density controls the closeness of the streamlines. For different
densities in each direction, use a... | def streamlines(x, y, u, v, density=1):
''' Return streamlines of a vector flow.
* x and y are 1d arrays defining an *evenly spaced* grid.
* u and v are 2d arrays (shape [y,x]) giving velocities.
* density controls the closeness of the streamlines. For different
densities in each direction, use a... | [
"Return",
"streamlines",
"of",
"a",
"vector",
"flow",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/examples/plotting/file/vector.py#L8-L172 | [
"def",
"streamlines",
"(",
"x",
",",
"y",
",",
"u",
",",
"v",
",",
"density",
"=",
"1",
")",
":",
"## Set up some constants - size of the grid used.",
"NGX",
"=",
"len",
"(",
"x",
")",
"NGY",
"=",
"len",
"(",
"y",
")",
"## Constants used to convert between g... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | display_event | Function to build a suitable CustomJS to display the current event
in the div model. | examples/howto/events_app.py | def display_event(div, attributes=[]):
"""
Function to build a suitable CustomJS to display the current event
in the div model.
"""
style = 'float: left; clear: left; font-size: 10pt'
return CustomJS(args=dict(div=div), code="""
var attrs = %s;
var args = [];
for (var i =... | def display_event(div, attributes=[]):
"""
Function to build a suitable CustomJS to display the current event
in the div model.
"""
style = 'float: left; clear: left; font-size: 10pt'
return CustomJS(args=dict(div=div), code="""
var attrs = %s;
var args = [];
for (var i =... | [
"Function",
"to",
"build",
"a",
"suitable",
"CustomJS",
"to",
"display",
"the",
"current",
"event",
"in",
"the",
"div",
"model",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/examples/howto/events_app.py#L16-L37 | [
"def",
"display_event",
"(",
"div",
",",
"attributes",
"=",
"[",
"]",
")",
":",
"style",
"=",
"'float: left; clear: left; font-size: 10pt'",
"return",
"CustomJS",
"(",
"args",
"=",
"dict",
"(",
"div",
"=",
"div",
")",
",",
"code",
"=",
"\"\"\"\n var att... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | print_event | Function that returns a Python callback to pretty print the events. | examples/howto/events_app.py | def print_event(attributes=[]):
"""
Function that returns a Python callback to pretty print the events.
"""
def python_callback(event):
cls_name = event.__class__.__name__
attrs = ', '.join(['{attr}={val}'.format(attr=attr, val=event.__dict__[attr])
for attr in att... | def print_event(attributes=[]):
"""
Function that returns a Python callback to pretty print the events.
"""
def python_callback(event):
cls_name = event.__class__.__name__
attrs = ', '.join(['{attr}={val}'.format(attr=attr, val=event.__dict__[attr])
for attr in att... | [
"Function",
"that",
"returns",
"a",
"Python",
"callback",
"to",
"pretty",
"print",
"the",
"events",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/examples/howto/events_app.py#L39-L48 | [
"def",
"print_event",
"(",
"attributes",
"=",
"[",
"]",
")",
":",
"def",
"python_callback",
"(",
"event",
")",
":",
"cls_name",
"=",
"event",
".",
"__class__",
".",
"__name__",
"attrs",
"=",
"', '",
".",
"join",
"(",
"[",
"'{attr}={val}'",
".",
"format",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Protocol.create | Create a new Message instance for the given type.
Args:
msgtype (str) : | bokeh/protocol/__init__.py | def create(self, msgtype, *args, **kwargs):
''' Create a new Message instance for the given type.
Args:
msgtype (str) :
'''
if msgtype not in self._messages:
raise ProtocolError("Unknown message type %r for protocol version %s" % (msgtype, self._version))
... | def create(self, msgtype, *args, **kwargs):
''' Create a new Message instance for the given type.
Args:
msgtype (str) :
'''
if msgtype not in self._messages:
raise ProtocolError("Unknown message type %r for protocol version %s" % (msgtype, self._version))
... | [
"Create",
"a",
"new",
"Message",
"instance",
"for",
"the",
"given",
"type",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/protocol/__init__.py#L71-L80 | [
"def",
"create",
"(",
"self",
",",
"msgtype",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"msgtype",
"not",
"in",
"self",
".",
"_messages",
":",
"raise",
"ProtocolError",
"(",
"\"Unknown message type %r for protocol version %s\"",
"%",
"(",
"m... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Protocol.assemble | Create a Message instance assembled from json fragments.
Args:
header_json (``JSON``) :
metadata_json (``JSON``) :
content_json (``JSON``) :
Returns:
message | bokeh/protocol/__init__.py | def assemble(self, header_json, metadata_json, content_json):
''' Create a Message instance assembled from json fragments.
Args:
header_json (``JSON``) :
metadata_json (``JSON``) :
content_json (``JSON``) :
Returns:
message
'''
... | def assemble(self, header_json, metadata_json, content_json):
''' Create a Message instance assembled from json fragments.
Args:
header_json (``JSON``) :
metadata_json (``JSON``) :
content_json (``JSON``) :
Returns:
message
'''
... | [
"Create",
"a",
"Message",
"instance",
"assembled",
"from",
"json",
"fragments",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/protocol/__init__.py#L82-L102 | [
"def",
"assemble",
"(",
"self",
",",
"header_json",
",",
"metadata_json",
",",
"content_json",
")",
":",
"header",
"=",
"json_decode",
"(",
"header_json",
")",
"if",
"'msgtype'",
"not",
"in",
"header",
":",
"log",
".",
"error",
"(",
"\"Bad header with no msgty... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _combine_document_events | Attempt to combine a new event with a list of previous events.
The ``old_event`` will be scanned in reverse, and ``.combine(new_event)``
will be called on each. If a combination can be made, the function
will return immediately. Otherwise, ``new_event`` will be appended to
``old_events``.
Args:
... | bokeh/document/document.py | def _combine_document_events(new_event, old_events):
''' Attempt to combine a new event with a list of previous events.
The ``old_event`` will be scanned in reverse, and ``.combine(new_event)``
will be called on each. If a combination can be made, the function
will return immediately. Otherwise, ``new_... | def _combine_document_events(new_event, old_events):
''' Attempt to combine a new event with a list of previous events.
The ``old_event`` will be scanned in reverse, and ``.combine(new_event)``
will be called on each. If a combination can be made, the function
will return immediately. Otherwise, ``new_... | [
"Attempt",
"to",
"combine",
"a",
"new",
"event",
"with",
"a",
"list",
"of",
"previous",
"events",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/document.py#L1131-L1158 | [
"def",
"_combine_document_events",
"(",
"new_event",
",",
"old_events",
")",
":",
"for",
"event",
"in",
"reversed",
"(",
"old_events",
")",
":",
"if",
"event",
".",
"combine",
"(",
"new_event",
")",
":",
"return",
"# no combination was possible",
"old_events",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Document.add_next_tick_callback | Add callback to be invoked once on the next tick of the event loop.
Args:
callback (callable) :
A callback function to execute on the next tick.
Returns:
NextTickCallback : can be used with ``remove_next_tick_callback``
.. note::
Next tick c... | bokeh/document/document.py | def add_next_tick_callback(self, callback):
''' Add callback to be invoked once on the next tick of the event loop.
Args:
callback (callable) :
A callback function to execute on the next tick.
Returns:
NextTickCallback : can be used with ``remove_next_ti... | def add_next_tick_callback(self, callback):
''' Add callback to be invoked once on the next tick of the event loop.
Args:
callback (callable) :
A callback function to execute on the next tick.
Returns:
NextTickCallback : can be used with ``remove_next_ti... | [
"Add",
"callback",
"to",
"be",
"invoked",
"once",
"on",
"the",
"next",
"tick",
"of",
"the",
"event",
"loop",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/document.py#L226-L244 | [
"def",
"add_next_tick_callback",
"(",
"self",
",",
"callback",
")",
":",
"from",
".",
".",
"server",
".",
"callbacks",
"import",
"NextTickCallback",
"cb",
"=",
"NextTickCallback",
"(",
"self",
",",
"None",
")",
"return",
"self",
".",
"_add_session_callback",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Document.add_periodic_callback | Add a callback to be invoked on a session periodically.
Args:
callback (callable) :
A callback function to execute periodically
period_milliseconds (int) :
Number of milliseconds between each callback execution.
Returns:
PeriodicCall... | bokeh/document/document.py | def add_periodic_callback(self, callback, period_milliseconds):
''' Add a callback to be invoked on a session periodically.
Args:
callback (callable) :
A callback function to execute periodically
period_milliseconds (int) :
Number of milliseconds... | def add_periodic_callback(self, callback, period_milliseconds):
''' Add a callback to be invoked on a session periodically.
Args:
callback (callable) :
A callback function to execute periodically
period_milliseconds (int) :
Number of milliseconds... | [
"Add",
"a",
"callback",
"to",
"be",
"invoked",
"on",
"a",
"session",
"periodically",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/document.py#L246-L269 | [
"def",
"add_periodic_callback",
"(",
"self",
",",
"callback",
",",
"period_milliseconds",
")",
":",
"from",
".",
".",
"server",
".",
"callbacks",
"import",
"PeriodicCallback",
"cb",
"=",
"PeriodicCallback",
"(",
"self",
",",
"None",
",",
"period_milliseconds",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Document.add_root | Add a model as a root of this Document.
Any changes to this model (including to other models referred to
by it) will trigger ``on_change`` callbacks registered on this
document.
Args:
model (Model) :
The model to add as a root of this document.
... | bokeh/document/document.py | def add_root(self, model, setter=None):
''' Add a model as a root of this Document.
Any changes to this model (including to other models referred to
by it) will trigger ``on_change`` callbacks registered on this
document.
Args:
model (Model) :
The mo... | def add_root(self, model, setter=None):
''' Add a model as a root of this Document.
Any changes to this model (including to other models referred to
by it) will trigger ``on_change`` callbacks registered on this
document.
Args:
model (Model) :
The mo... | [
"Add",
"a",
"model",
"as",
"a",
"root",
"of",
"this",
"Document",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/document.py#L271-L305 | [
"def",
"add_root",
"(",
"self",
",",
"model",
",",
"setter",
"=",
"None",
")",
":",
"if",
"model",
"in",
"self",
".",
"_roots",
":",
"return",
"self",
".",
"_push_all_models_freeze",
"(",
")",
"# TODO (bird) Should we do some kind of reporting of how many",
"# Lay... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Document.add_timeout_callback | Add callback to be invoked once, after a specified timeout passes.
Args:
callback (callable) :
A callback function to execute after timeout
timeout_milliseconds (int) :
Number of milliseconds before callback execution.
Returns:
Timeo... | bokeh/document/document.py | def add_timeout_callback(self, callback, timeout_milliseconds):
''' Add callback to be invoked once, after a specified timeout passes.
Args:
callback (callable) :
A callback function to execute after timeout
timeout_milliseconds (int) :
Number of... | def add_timeout_callback(self, callback, timeout_milliseconds):
''' Add callback to be invoked once, after a specified timeout passes.
Args:
callback (callable) :
A callback function to execute after timeout
timeout_milliseconds (int) :
Number of... | [
"Add",
"callback",
"to",
"be",
"invoked",
"once",
"after",
"a",
"specified",
"timeout",
"passes",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/document.py#L307-L330 | [
"def",
"add_timeout_callback",
"(",
"self",
",",
"callback",
",",
"timeout_milliseconds",
")",
":",
"from",
".",
".",
"server",
".",
"callbacks",
"import",
"TimeoutCallback",
"cb",
"=",
"TimeoutCallback",
"(",
"self",
",",
"None",
",",
"timeout_milliseconds",
")... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Document.apply_json_patch | Apply a JSON patch object and process any resulting events.
Args:
patch (JSON-data) :
The JSON-object containing the patch to apply.
setter (ClientSession or ServerSession or None, optional) :
This is used to prevent "boomerang" updates to Bokeh apps.
... | bokeh/document/document.py | def apply_json_patch(self, patch, setter=None):
''' Apply a JSON patch object and process any resulting events.
Args:
patch (JSON-data) :
The JSON-object containing the patch to apply.
setter (ClientSession or ServerSession or None, optional) :
T... | def apply_json_patch(self, patch, setter=None):
''' Apply a JSON patch object and process any resulting events.
Args:
patch (JSON-data) :
The JSON-object containing the patch to apply.
setter (ClientSession or ServerSession or None, optional) :
T... | [
"Apply",
"a",
"JSON",
"patch",
"object",
"and",
"process",
"any",
"resulting",
"events",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/document.py#L341-L435 | [
"def",
"apply_json_patch",
"(",
"self",
",",
"patch",
",",
"setter",
"=",
"None",
")",
":",
"references_json",
"=",
"patch",
"[",
"'references'",
"]",
"events_json",
"=",
"patch",
"[",
"'events'",
"]",
"references",
"=",
"instantiate_references_json",
"(",
"re... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Document.clear | Remove all content from the document but do not reset title.
Returns:
None | bokeh/document/document.py | def clear(self):
''' Remove all content from the document but do not reset title.
Returns:
None
'''
self._push_all_models_freeze()
try:
while len(self._roots) > 0:
r = next(iter(self._roots))
self.remove_root(r)
fi... | def clear(self):
''' Remove all content from the document but do not reset title.
Returns:
None
'''
self._push_all_models_freeze()
try:
while len(self._roots) > 0:
r = next(iter(self._roots))
self.remove_root(r)
fi... | [
"Remove",
"all",
"content",
"from",
"the",
"document",
"but",
"do",
"not",
"reset",
"title",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/document.py#L450-L463 | [
"def",
"clear",
"(",
"self",
")",
":",
"self",
".",
"_push_all_models_freeze",
"(",
")",
"try",
":",
"while",
"len",
"(",
"self",
".",
"_roots",
")",
">",
"0",
":",
"r",
"=",
"next",
"(",
"iter",
"(",
"self",
".",
"_roots",
")",
")",
"self",
".",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Document.delete_modules | Clean up after any modules created by this Document when its session is
destroyed. | bokeh/document/document.py | def delete_modules(self):
''' Clean up after any modules created by this Document when its session is
destroyed.
'''
from gc import get_referrers
from types import FrameType
log.debug("Deleting %s modules for %s" % (len(self._modules), self))
for module in self... | def delete_modules(self):
''' Clean up after any modules created by this Document when its session is
destroyed.
'''
from gc import get_referrers
from types import FrameType
log.debug("Deleting %s modules for %s" % (len(self._modules), self))
for module in self... | [
"Clean",
"up",
"after",
"any",
"modules",
"created",
"by",
"this",
"Document",
"when",
"its",
"session",
"is",
"destroyed",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/document.py#L485-L520 | [
"def",
"delete_modules",
"(",
"self",
")",
":",
"from",
"gc",
"import",
"get_referrers",
"from",
"types",
"import",
"FrameType",
"log",
".",
"debug",
"(",
"\"Deleting %s modules for %s\"",
"%",
"(",
"len",
"(",
"self",
".",
"_modules",
")",
",",
"self",
")",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Document.from_json | Load a document from JSON.
json (JSON-data) :
A JSON-encoded document to create a new Document from.
Returns:
Document : | bokeh/document/document.py | def from_json(cls, json):
''' Load a document from JSON.
json (JSON-data) :
A JSON-encoded document to create a new Document from.
Returns:
Document :
'''
roots_json = json['roots']
root_ids = roots_json['root_ids']
references_json = roo... | def from_json(cls, json):
''' Load a document from JSON.
json (JSON-data) :
A JSON-encoded document to create a new Document from.
Returns:
Document :
'''
roots_json = json['roots']
root_ids = roots_json['root_ids']
references_json = roo... | [
"Load",
"a",
"document",
"from",
"JSON",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/document.py#L525-L548 | [
"def",
"from_json",
"(",
"cls",
",",
"json",
")",
":",
"roots_json",
"=",
"json",
"[",
"'roots'",
"]",
"root_ids",
"=",
"roots_json",
"[",
"'root_ids'",
"]",
"references_json",
"=",
"roots_json",
"[",
"'references'",
"]",
"references",
"=",
"instantiate_refere... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Document.hold | Activate a document hold.
While a hold is active, no model changes will be applied, or trigger
callbacks. Once ``unhold`` is called, the events collected during the
hold will be applied according to the hold policy.
Args:
hold ('combine' or 'collect', optional)
... | bokeh/document/document.py | def hold(self, policy="combine"):
''' Activate a document hold.
While a hold is active, no model changes will be applied, or trigger
callbacks. Once ``unhold`` is called, the events collected during the
hold will be applied according to the hold policy.
Args:
hold (... | def hold(self, policy="combine"):
''' Activate a document hold.
While a hold is active, no model changes will be applied, or trigger
callbacks. Once ``unhold`` is called, the events collected during the
hold will be applied according to the hold policy.
Args:
hold (... | [
"Activate",
"a",
"document",
"hold",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/document.py#L591-L635 | [
"def",
"hold",
"(",
"self",
",",
"policy",
"=",
"\"combine\"",
")",
":",
"if",
"self",
".",
"_hold",
"is",
"not",
"None",
"and",
"self",
".",
"_hold",
"!=",
"policy",
":",
"log",
".",
"warning",
"(",
"\"hold already active with '%s', ignoring '%s'\"",
"%",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Document.unhold | Turn off any active document hold and apply any collected events.
Returns:
None | bokeh/document/document.py | def unhold(self):
''' Turn off any active document hold and apply any collected events.
Returns:
None
'''
# no-op if we are already no holding
if self._hold is None: return
self._hold = None
events = list(self._held_events)
self._held_events... | def unhold(self):
''' Turn off any active document hold and apply any collected events.
Returns:
None
'''
# no-op if we are already no holding
if self._hold is None: return
self._hold = None
events = list(self._held_events)
self._held_events... | [
"Turn",
"off",
"any",
"active",
"document",
"hold",
"and",
"apply",
"any",
"collected",
"events",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/document.py#L637-L652 | [
"def",
"unhold",
"(",
"self",
")",
":",
"# no-op if we are already no holding",
"if",
"self",
".",
"_hold",
"is",
"None",
":",
"return",
"self",
".",
"_hold",
"=",
"None",
"events",
"=",
"list",
"(",
"self",
".",
"_held_events",
")",
"self",
".",
"_held_ev... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Document.on_change | Provide callbacks to invoke if the document or any Model reachable
from its roots changes. | bokeh/document/document.py | def on_change(self, *callbacks):
''' Provide callbacks to invoke if the document or any Model reachable
from its roots changes.
'''
for callback in callbacks:
if callback in self._callbacks: continue
_check_callback(callback, ('event',))
self._call... | def on_change(self, *callbacks):
''' Provide callbacks to invoke if the document or any Model reachable
from its roots changes.
'''
for callback in callbacks:
if callback in self._callbacks: continue
_check_callback(callback, ('event',))
self._call... | [
"Provide",
"callbacks",
"to",
"invoke",
"if",
"the",
"document",
"or",
"any",
"Model",
"reachable",
"from",
"its",
"roots",
"changes",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/document.py#L654-L665 | [
"def",
"on_change",
"(",
"self",
",",
"*",
"callbacks",
")",
":",
"for",
"callback",
"in",
"callbacks",
":",
"if",
"callback",
"in",
"self",
".",
"_callbacks",
":",
"continue",
"_check_callback",
"(",
"callback",
",",
"(",
"'event'",
",",
")",
")",
"self... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Document.on_session_destroyed | Provide callbacks to invoke when the session serving the Document
is destroyed | bokeh/document/document.py | def on_session_destroyed(self, *callbacks):
''' Provide callbacks to invoke when the session serving the Document
is destroyed
'''
for callback in callbacks:
_check_callback(callback, ('session_context',))
self._session_destroyed_callbacks.add(callback) | def on_session_destroyed(self, *callbacks):
''' Provide callbacks to invoke when the session serving the Document
is destroyed
'''
for callback in callbacks:
_check_callback(callback, ('session_context',))
self._session_destroyed_callbacks.add(callback) | [
"Provide",
"callbacks",
"to",
"invoke",
"when",
"the",
"session",
"serving",
"the",
"Document",
"is",
"destroyed"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/document.py#L671-L678 | [
"def",
"on_session_destroyed",
"(",
"self",
",",
"*",
"callbacks",
")",
":",
"for",
"callback",
"in",
"callbacks",
":",
"_check_callback",
"(",
"callback",
",",
"(",
"'session_context'",
",",
")",
")",
"self",
".",
"_session_destroyed_callbacks",
".",
"add",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Document.remove_root | Remove a model as root model from this Document.
Changes to this model may still trigger ``on_change`` callbacks
on this document, if the model is still referred to by other
root models.
Args:
model (Model) :
The model to add as a root of this document.
... | bokeh/document/document.py | def remove_root(self, model, setter=None):
''' Remove a model as root model from this Document.
Changes to this model may still trigger ``on_change`` callbacks
on this document, if the model is still referred to by other
root models.
Args:
model (Model) :
... | def remove_root(self, model, setter=None):
''' Remove a model as root model from this Document.
Changes to this model may still trigger ``on_change`` callbacks
on this document, if the model is still referred to by other
root models.
Args:
model (Model) :
... | [
"Remove",
"a",
"model",
"as",
"root",
"model",
"from",
"this",
"Document",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/document.py#L720-L750 | [
"def",
"remove_root",
"(",
"self",
",",
"model",
",",
"setter",
"=",
"None",
")",
":",
"if",
"model",
"not",
"in",
"self",
".",
"_roots",
":",
"return",
"# TODO (bev) ValueError?",
"self",
".",
"_push_all_models_freeze",
"(",
")",
"try",
":",
"self",
".",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.