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 | _Settings.css_files | The CSS files in the BokehJS directory. | bokeh/settings.py | def css_files(self):
''' The CSS files in the BokehJS directory.
'''
bokehjsdir = self.bokehjsdir()
js_files = []
for root, dirnames, files in os.walk(bokehjsdir):
for fname in files:
if fname.endswith(".css"):
js_files.append(join... | def css_files(self):
''' The CSS files in the BokehJS directory.
'''
bokehjsdir = self.bokehjsdir()
js_files = []
for root, dirnames, files in os.walk(bokehjsdir):
for fname in files:
if fname.endswith(".css"):
js_files.append(join... | [
"The",
"CSS",
"files",
"in",
"the",
"BokehJS",
"directory",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/settings.py#L375-L385 | [
"def",
"css_files",
"(",
"self",
")",
":",
"bokehjsdir",
"=",
"self",
".",
"bokehjsdir",
"(",
")",
"js_files",
"=",
"[",
"]",
"for",
"root",
",",
"dirnames",
",",
"files",
"in",
"os",
".",
"walk",
"(",
"bokehjsdir",
")",
":",
"for",
"fname",
"in",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | serialize_json | Return a serialized JSON representation of objects, suitable to
send to BokehJS.
This function is typically used to serialize single python objects in
the manner expected by BokehJS. In particular, many datetime values are
automatically normalized to an expected format. Some Bokeh objects can
also ... | bokeh/core/json_encoder.py | def serialize_json(obj, pretty=None, indent=None, **kwargs):
''' Return a serialized JSON representation of objects, suitable to
send to BokehJS.
This function is typically used to serialize single python objects in
the manner expected by BokehJS. In particular, many datetime values are
automatical... | def serialize_json(obj, pretty=None, indent=None, **kwargs):
''' Return a serialized JSON representation of objects, suitable to
send to BokehJS.
This function is typically used to serialize single python objects in
the manner expected by BokehJS. In particular, many datetime values are
automatical... | [
"Return",
"a",
"serialized",
"JSON",
"representation",
"of",
"objects",
"suitable",
"to",
"send",
"to",
"BokehJS",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/json_encoder.py#L85-L161 | [
"def",
"serialize_json",
"(",
"obj",
",",
"pretty",
"=",
"None",
",",
"indent",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# these args to json.dumps are computed internally and should not be passed along",
"for",
"name",
"in",
"[",
"'allow_nan'",
",",
"'separ... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BokehJSONEncoder.transform_python_types | Handle special scalars such as (Python, NumPy, or Pandas)
datetimes, or Decimal values.
Args:
obj (obj) :
The object to encode. Anything not specifically handled in
this method is passed on to the default system JSON encoder. | bokeh/core/json_encoder.py | def transform_python_types(self, obj):
''' Handle special scalars such as (Python, NumPy, or Pandas)
datetimes, or Decimal values.
Args:
obj (obj) :
The object to encode. Anything not specifically handled in
this method is passed on to the default sy... | def transform_python_types(self, obj):
''' Handle special scalars such as (Python, NumPy, or Pandas)
datetimes, or Decimal values.
Args:
obj (obj) :
The object to encode. Anything not specifically handled in
this method is passed on to the default sy... | [
"Handle",
"special",
"scalars",
"such",
"as",
"(",
"Python",
"NumPy",
"or",
"Pandas",
")",
"datetimes",
"or",
"Decimal",
"values",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/json_encoder.py#L173-L219 | [
"def",
"transform_python_types",
"(",
"self",
",",
"obj",
")",
":",
"# date/time values that get serialized as milliseconds",
"if",
"is_datetime_type",
"(",
"obj",
")",
":",
"return",
"convert_datetime_type",
"(",
"obj",
")",
"if",
"is_timedelta_type",
"(",
"obj",
")"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BokehJSONEncoder.default | The required ``default`` method for ``JSONEncoder`` subclasses.
Args:
obj (obj) :
The object to encode. Anything not specifically handled in
this method is passed on to the default system JSON encoder. | bokeh/core/json_encoder.py | def default(self, obj):
''' The required ``default`` method for ``JSONEncoder`` subclasses.
Args:
obj (obj) :
The object to encode. Anything not specifically handled in
this method is passed on to the default system JSON encoder.
'''
from .... | def default(self, obj):
''' The required ``default`` method for ``JSONEncoder`` subclasses.
Args:
obj (obj) :
The object to encode. Anything not specifically handled in
this method is passed on to the default system JSON encoder.
'''
from .... | [
"The",
"required",
"default",
"method",
"for",
"JSONEncoder",
"subclasses",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/json_encoder.py#L221-L252 | [
"def",
"default",
"(",
"self",
",",
"obj",
")",
":",
"from",
".",
".",
"model",
"import",
"Model",
"from",
".",
".",
"colors",
"import",
"Color",
"from",
".",
"has_props",
"import",
"HasProps",
"# array types -- use force_list here, only binary",
"# encoding CDS c... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Application.add | Add a handler to the pipeline used to initialize new documents.
Args:
handler (Handler) : a handler for this Application to use to
process Documents | bokeh/application/application.py | def add(self, handler):
''' Add a handler to the pipeline used to initialize new documents.
Args:
handler (Handler) : a handler for this Application to use to
process Documents
'''
self._handlers.append(handler)
# make sure there is at most one stat... | def add(self, handler):
''' Add a handler to the pipeline used to initialize new documents.
Args:
handler (Handler) : a handler for this Application to use to
process Documents
'''
self._handlers.append(handler)
# make sure there is at most one stat... | [
"Add",
"a",
"handler",
"to",
"the",
"pipeline",
"used",
"to",
"initialize",
"new",
"documents",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/application/application.py#L142-L160 | [
"def",
"add",
"(",
"self",
",",
"handler",
")",
":",
"self",
".",
"_handlers",
".",
"append",
"(",
"handler",
")",
"# make sure there is at most one static path",
"static_paths",
"=",
"set",
"(",
"h",
".",
"static_path",
"(",
")",
"for",
"h",
"in",
"self",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Application.initialize_document | Fills in a new document using the Application's handlers. | bokeh/application/application.py | def initialize_document(self, doc):
''' Fills in a new document using the Application's handlers.
'''
for h in self._handlers:
# TODO (havocp) we need to check the 'failed' flag on each handler
# and build a composite error display. In develop mode, we want to
... | def initialize_document(self, doc):
''' Fills in a new document using the Application's handlers.
'''
for h in self._handlers:
# TODO (havocp) we need to check the 'failed' flag on each handler
# and build a composite error display. In develop mode, we want to
... | [
"Fills",
"in",
"a",
"new",
"document",
"using",
"the",
"Application",
"s",
"handlers",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/application/application.py#L170-L183 | [
"def",
"initialize_document",
"(",
"self",
",",
"doc",
")",
":",
"for",
"h",
"in",
"self",
".",
"_handlers",
":",
"# TODO (havocp) we need to check the 'failed' flag on each handler",
"# and build a composite error display. In develop mode, we want to",
"# somehow get these errors ... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Application.on_session_created | Invoked to execute code when a new session is created.
This method calls ``on_session_created`` on each handler, in order,
with the session context passed as the only argument.
May return a ``Future`` which will delay session creation until the
``Future`` completes. | bokeh/application/application.py | def on_session_created(self, session_context):
''' Invoked to execute code when a new session is created.
This method calls ``on_session_created`` on each handler, in order,
with the session context passed as the only argument.
May return a ``Future`` which will delay session creation ... | def on_session_created(self, session_context):
''' Invoked to execute code when a new session is created.
This method calls ``on_session_created`` on each handler, in order,
with the session context passed as the only argument.
May return a ``Future`` which will delay session creation ... | [
"Invoked",
"to",
"execute",
"code",
"when",
"a",
"new",
"session",
"is",
"created",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/application/application.py#L211-L224 | [
"def",
"on_session_created",
"(",
"self",
",",
"session_context",
")",
":",
"for",
"h",
"in",
"self",
".",
"_handlers",
":",
"result",
"=",
"h",
".",
"on_session_created",
"(",
"session_context",
")",
"yield",
"yield_for_all_futures",
"(",
"result",
")",
"rais... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _select_helper | Allow flexible selector syntax.
Returns:
dict | bokeh/models/plots.py | def _select_helper(args, kwargs):
""" Allow flexible selector syntax.
Returns:
dict
"""
if len(args) > 1:
raise TypeError("select accepts at most ONE positional argument.")
if len(args) > 0 and len(kwargs) > 0:
raise TypeError("select accepts EITHER a positional argument, ... | def _select_helper(args, kwargs):
""" Allow flexible selector syntax.
Returns:
dict
"""
if len(args) > 1:
raise TypeError("select accepts at most ONE positional argument.")
if len(args) > 0 and len(kwargs) > 0:
raise TypeError("select accepts EITHER a positional argument, ... | [
"Allow",
"flexible",
"selector",
"syntax",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/plots.py#L759-L795 | [
"def",
"_select_helper",
"(",
"args",
",",
"kwargs",
")",
":",
"if",
"len",
"(",
"args",
")",
">",
"1",
":",
"raise",
"TypeError",
"(",
"\"select accepts at most ONE positional argument.\"",
")",
"if",
"len",
"(",
"args",
")",
">",
"0",
"and",
"len",
"(",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Plot.select | Query this object and all of its references for objects that
match the given selector.
There are a few different ways to call the ``select`` method.
The most general is to supply a JSON-like query dictionary as the
single argument or as keyword arguments:
Args:
sele... | bokeh/models/plots.py | def select(self, *args, **kwargs):
''' Query this object and all of its references for objects that
match the given selector.
There are a few different ways to call the ``select`` method.
The most general is to supply a JSON-like query dictionary as the
single argument or as key... | def select(self, *args, **kwargs):
''' Query this object and all of its references for objects that
match the given selector.
There are a few different ways to call the ``select`` method.
The most general is to supply a JSON-like query dictionary as the
single argument or as key... | [
"Query",
"this",
"object",
"and",
"all",
"of",
"its",
"references",
"for",
"objects",
"that",
"match",
"the",
"given",
"selector",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/plots.py#L69-L124 | [
"def",
"select",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"selector",
"=",
"_select_helper",
"(",
"args",
",",
"kwargs",
")",
"# Want to pass selector that is a dictionary",
"return",
"_list_attr_splat",
"(",
"find",
"(",
"self",
".",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Plot.legend | Splattable list of :class:`~bokeh.models.annotations.Legend` objects. | bokeh/models/plots.py | def legend(self):
''' Splattable list of :class:`~bokeh.models.annotations.Legend` objects.
'''
panels = self.above + self.below + self.left + self.right + self.center
legends = [obj for obj in panels if isinstance(obj, Legend)]
return _legend_attr_splat(legends) | def legend(self):
''' Splattable list of :class:`~bokeh.models.annotations.Legend` objects.
'''
panels = self.above + self.below + self.left + self.right + self.center
legends = [obj for obj in panels if isinstance(obj, Legend)]
return _legend_attr_splat(legends) | [
"Splattable",
"list",
"of",
":",
"class",
":",
"~bokeh",
".",
"models",
".",
"annotations",
".",
"Legend",
"objects",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/plots.py#L181-L187 | [
"def",
"legend",
"(",
"self",
")",
":",
"panels",
"=",
"self",
".",
"above",
"+",
"self",
".",
"below",
"+",
"self",
".",
"left",
"+",
"self",
".",
"right",
"+",
"self",
".",
"center",
"legends",
"=",
"[",
"obj",
"for",
"obj",
"in",
"panels",
"if... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Plot.hover | Splattable list of :class:`~bokeh.models.tools.HoverTool` objects. | bokeh/models/plots.py | def hover(self):
''' Splattable list of :class:`~bokeh.models.tools.HoverTool` objects.
'''
hovers = [obj for obj in self.tools if isinstance(obj, HoverTool)]
return _list_attr_splat(hovers) | def hover(self):
''' Splattable list of :class:`~bokeh.models.tools.HoverTool` objects.
'''
hovers = [obj for obj in self.tools if isinstance(obj, HoverTool)]
return _list_attr_splat(hovers) | [
"Splattable",
"list",
"of",
":",
"class",
":",
"~bokeh",
".",
"models",
".",
"tools",
".",
"HoverTool",
"objects",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/plots.py#L190-L195 | [
"def",
"hover",
"(",
"self",
")",
":",
"hovers",
"=",
"[",
"obj",
"for",
"obj",
"in",
"self",
".",
"tools",
"if",
"isinstance",
"(",
"obj",
",",
"HoverTool",
")",
"]",
"return",
"_list_attr_splat",
"(",
"hovers",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Plot.add_layout | Adds an object to the plot in a specified place.
Args:
obj (Renderer) : the object to add to the Plot
place (str, optional) : where to add the object (default: 'center')
Valid places are: 'left', 'right', 'above', 'below', 'center'.
Returns:
None | bokeh/models/plots.py | def add_layout(self, obj, place='center'):
''' Adds an object to the plot in a specified place.
Args:
obj (Renderer) : the object to add to the Plot
place (str, optional) : where to add the object (default: 'center')
Valid places are: 'left', 'right', 'above', 'b... | def add_layout(self, obj, place='center'):
''' Adds an object to the plot in a specified place.
Args:
obj (Renderer) : the object to add to the Plot
place (str, optional) : where to add the object (default: 'center')
Valid places are: 'left', 'right', 'above', 'b... | [
"Adds",
"an",
"object",
"to",
"the",
"plot",
"in",
"a",
"specified",
"place",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/plots.py#L230-L248 | [
"def",
"add_layout",
"(",
"self",
",",
"obj",
",",
"place",
"=",
"'center'",
")",
":",
"valid_places",
"=",
"[",
"'left'",
",",
"'right'",
",",
"'above'",
",",
"'below'",
",",
"'center'",
"]",
"if",
"place",
"not",
"in",
"valid_places",
":",
"raise",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Plot.add_tools | Adds tools to the plot.
Args:
*tools (Tool) : the tools to add to the Plot
Returns:
None | bokeh/models/plots.py | def add_tools(self, *tools):
''' Adds tools to the plot.
Args:
*tools (Tool) : the tools to add to the Plot
Returns:
None
'''
for tool in tools:
if not isinstance(tool, Tool):
raise ValueError("All arguments to add_tool must ... | def add_tools(self, *tools):
''' Adds tools to the plot.
Args:
*tools (Tool) : the tools to add to the Plot
Returns:
None
'''
for tool in tools:
if not isinstance(tool, Tool):
raise ValueError("All arguments to add_tool must ... | [
"Adds",
"tools",
"to",
"the",
"plot",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/plots.py#L250-L264 | [
"def",
"add_tools",
"(",
"self",
",",
"*",
"tools",
")",
":",
"for",
"tool",
"in",
"tools",
":",
"if",
"not",
"isinstance",
"(",
"tool",
",",
"Tool",
")",
":",
"raise",
"ValueError",
"(",
"\"All arguments to add_tool must be Tool subclasses.\"",
")",
"self",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Plot.add_glyph | Adds a glyph to the plot with associated data sources and ranges.
This function will take care of creating and configuring a Glyph object,
and then add it to the plot's list of renderers.
Args:
source (DataSource) : a data source for the glyphs to all use
glyph (Glyph) ... | bokeh/models/plots.py | def add_glyph(self, source_or_glyph, glyph=None, **kw):
''' Adds a glyph to the plot with associated data sources and ranges.
This function will take care of creating and configuring a Glyph object,
and then add it to the plot's list of renderers.
Args:
source (DataSource) ... | def add_glyph(self, source_or_glyph, glyph=None, **kw):
''' Adds a glyph to the plot with associated data sources and ranges.
This function will take care of creating and configuring a Glyph object,
and then add it to the plot's list of renderers.
Args:
source (DataSource) ... | [
"Adds",
"a",
"glyph",
"to",
"the",
"plot",
"with",
"associated",
"data",
"sources",
"and",
"ranges",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/plots.py#L266-L298 | [
"def",
"add_glyph",
"(",
"self",
",",
"source_or_glyph",
",",
"glyph",
"=",
"None",
",",
"*",
"*",
"kw",
")",
":",
"if",
"glyph",
"is",
"not",
"None",
":",
"source",
"=",
"source_or_glyph",
"else",
":",
"source",
",",
"glyph",
"=",
"ColumnDataSource",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Plot.add_tile | Adds new ``TileRenderer`` into ``Plot.renderers``
Args:
tile_source (TileSource) : a tile source instance which contain tileset configuration
Keyword Arguments:
Additional keyword arguments are passed on as-is to the tile renderer
Returns:
TileRenderer : Ti... | bokeh/models/plots.py | def add_tile(self, tile_source, **kw):
''' Adds new ``TileRenderer`` into ``Plot.renderers``
Args:
tile_source (TileSource) : a tile source instance which contain tileset configuration
Keyword Arguments:
Additional keyword arguments are passed on as-is to the tile rende... | def add_tile(self, tile_source, **kw):
''' Adds new ``TileRenderer`` into ``Plot.renderers``
Args:
tile_source (TileSource) : a tile source instance which contain tileset configuration
Keyword Arguments:
Additional keyword arguments are passed on as-is to the tile rende... | [
"Adds",
"new",
"TileRenderer",
"into",
"Plot",
".",
"renderers"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/plots.py#L300-L315 | [
"def",
"add_tile",
"(",
"self",
",",
"tile_source",
",",
"*",
"*",
"kw",
")",
":",
"tile_renderer",
"=",
"TileRenderer",
"(",
"tile_source",
"=",
"tile_source",
",",
"*",
"*",
"kw",
")",
"self",
".",
"renderers",
".",
"append",
"(",
"tile_renderer",
")",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | row | Create a row of Bokeh Layout objects. Forces all objects to
have the same sizing_mode, which is required for complex layouts to work.
Args:
children (list of :class:`~bokeh.models.layouts.LayoutDOM` ): A list of instances for
the row. Can be any of the following - :class:`~bokeh.models.plot... | bokeh/layouts.py | def row(*args, **kwargs):
""" Create a row of Bokeh Layout objects. Forces all objects to
have the same sizing_mode, which is required for complex layouts to work.
Args:
children (list of :class:`~bokeh.models.layouts.LayoutDOM` ): A list of instances for
the row. Can be any of the foll... | def row(*args, **kwargs):
""" Create a row of Bokeh Layout objects. Forces all objects to
have the same sizing_mode, which is required for complex layouts to work.
Args:
children (list of :class:`~bokeh.models.layouts.LayoutDOM` ): A list of instances for
the row. Can be any of the foll... | [
"Create",
"a",
"row",
"of",
"Bokeh",
"Layout",
"objects",
".",
"Forces",
"all",
"objects",
"to",
"have",
"the",
"same",
"sizing_mode",
"which",
"is",
"required",
"for",
"complex",
"layouts",
"to",
"work",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/layouts.py#L55-L97 | [
"def",
"row",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"sizing_mode",
"=",
"kwargs",
".",
"pop",
"(",
"'sizing_mode'",
",",
"None",
")",
"children",
"=",
"kwargs",
".",
"pop",
"(",
"'children'",
",",
"None",
")",
"children",
"=",
"_handle... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | column | Create a column of Bokeh Layout objects. Forces all objects to
have the same sizing_mode, which is required for complex layouts to work.
Args:
children (list of :class:`~bokeh.models.layouts.LayoutDOM` ): A list of instances for
the column. Can be any of the following - :class:`~bokeh.model... | bokeh/layouts.py | def column(*args, **kwargs):
""" Create a column of Bokeh Layout objects. Forces all objects to
have the same sizing_mode, which is required for complex layouts to work.
Args:
children (list of :class:`~bokeh.models.layouts.LayoutDOM` ): A list of instances for
the column. Can be any of... | def column(*args, **kwargs):
""" Create a column of Bokeh Layout objects. Forces all objects to
have the same sizing_mode, which is required for complex layouts to work.
Args:
children (list of :class:`~bokeh.models.layouts.LayoutDOM` ): A list of instances for
the column. Can be any of... | [
"Create",
"a",
"column",
"of",
"Bokeh",
"Layout",
"objects",
".",
"Forces",
"all",
"objects",
"to",
"have",
"the",
"same",
"sizing_mode",
"which",
"is",
"required",
"for",
"complex",
"layouts",
"to",
"work",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/layouts.py#L100-L142 | [
"def",
"column",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"sizing_mode",
"=",
"kwargs",
".",
"pop",
"(",
"'sizing_mode'",
",",
"None",
")",
"children",
"=",
"kwargs",
".",
"pop",
"(",
"'children'",
",",
"None",
")",
"children",
"=",
"_han... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | widgetbox | Create a column of bokeh widgets with predefined styling.
Args:
children (list of :class:`~bokeh.models.widgets.widget.Widget`): A list of widgets.
sizing_mode (``"fixed"``, ``"stretch_both"``, ``"scale_width"``, ``"scale_height"``, ``"scale_both"`` ): How
will the items in the layout ... | bokeh/layouts.py | def widgetbox(*args, **kwargs):
""" Create a column of bokeh widgets with predefined styling.
Args:
children (list of :class:`~bokeh.models.widgets.widget.Widget`): A list of widgets.
sizing_mode (``"fixed"``, ``"stretch_both"``, ``"scale_width"``, ``"scale_height"``, ``"scale_both"`` ): How
... | def widgetbox(*args, **kwargs):
""" Create a column of bokeh widgets with predefined styling.
Args:
children (list of :class:`~bokeh.models.widgets.widget.Widget`): A list of widgets.
sizing_mode (``"fixed"``, ``"stretch_both"``, ``"scale_width"``, ``"scale_height"``, ``"scale_both"`` ): How
... | [
"Create",
"a",
"column",
"of",
"bokeh",
"widgets",
"with",
"predefined",
"styling",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/layouts.py#L145-L179 | [
"def",
"widgetbox",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"sizing_mode",
"=",
"kwargs",
".",
"pop",
"(",
"'sizing_mode'",
",",
"None",
")",
"children",
"=",
"kwargs",
".",
"pop",
"(",
"'children'",
",",
"None",
")",
"children",
"=",
"_... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | layout | Create a grid-based arrangement of Bokeh Layout objects.
Args:
children (list of lists of :class:`~bokeh.models.layouts.LayoutDOM` ): A list of lists of instances
for a grid layout. Can be any of the following - :class:`~bokeh.models.plots.Plot`,
:class:`~bokeh.models.widgets.widget... | bokeh/layouts.py | def layout(*args, **kwargs):
""" Create a grid-based arrangement of Bokeh Layout objects.
Args:
children (list of lists of :class:`~bokeh.models.layouts.LayoutDOM` ): A list of lists of instances
for a grid layout. Can be any of the following - :class:`~bokeh.models.plots.Plot`,
... | def layout(*args, **kwargs):
""" Create a grid-based arrangement of Bokeh Layout objects.
Args:
children (list of lists of :class:`~bokeh.models.layouts.LayoutDOM` ): A list of lists of instances
for a grid layout. Can be any of the following - :class:`~bokeh.models.plots.Plot`,
... | [
"Create",
"a",
"grid",
"-",
"based",
"arrangement",
"of",
"Bokeh",
"Layout",
"objects",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/layouts.py#L182-L222 | [
"def",
"layout",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"sizing_mode",
"=",
"kwargs",
".",
"pop",
"(",
"'sizing_mode'",
",",
"None",
")",
"children",
"=",
"kwargs",
".",
"pop",
"(",
"'children'",
",",
"None",
")",
"children",
"=",
"_han... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | gridplot | Create a grid of plots rendered on separate canvases.
The ``gridplot`` function builds a single toolbar for all the plots in the
grid. ``gridplot`` is designed to layout a set of plots. For general
grid layout, use the :func:`~bokeh.layouts.layout` function.
Args:
children (list of lists of :c... | bokeh/layouts.py | def gridplot(children, sizing_mode=None, toolbar_location='above', ncols=None,
plot_width=None, plot_height=None, toolbar_options=None, merge_tools=True):
''' Create a grid of plots rendered on separate canvases.
The ``gridplot`` function builds a single toolbar for all the plots in the
grid. ... | def gridplot(children, sizing_mode=None, toolbar_location='above', ncols=None,
plot_width=None, plot_height=None, toolbar_options=None, merge_tools=True):
''' Create a grid of plots rendered on separate canvases.
The ``gridplot`` function builds a single toolbar for all the plots in the
grid. ... | [
"Create",
"a",
"grid",
"of",
"plots",
"rendered",
"on",
"separate",
"canvases",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/layouts.py#L224-L340 | [
"def",
"gridplot",
"(",
"children",
",",
"sizing_mode",
"=",
"None",
",",
"toolbar_location",
"=",
"'above'",
",",
"ncols",
"=",
"None",
",",
"plot_width",
"=",
"None",
",",
"plot_height",
"=",
"None",
",",
"toolbar_options",
"=",
"None",
",",
"merge_tools",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | grid | Conveniently create a grid of layoutable objects.
Grids are created by using ``GridBox`` model. This gives the most control over
the layout of a grid, but is also tedious and may result in unreadable code in
practical applications. ``grid()`` function remedies this by reducing the level
of control, but... | bokeh/layouts.py | def grid(children=[], sizing_mode=None, nrows=None, ncols=None):
"""
Conveniently create a grid of layoutable objects.
Grids are created by using ``GridBox`` model. This gives the most control over
the layout of a grid, but is also tedious and may result in unreadable code in
practical applications... | def grid(children=[], sizing_mode=None, nrows=None, ncols=None):
"""
Conveniently create a grid of layoutable objects.
Grids are created by using ``GridBox`` model. This gives the most control over
the layout of a grid, but is also tedious and may result in unreadable code in
practical applications... | [
"Conveniently",
"create",
"a",
"grid",
"of",
"layoutable",
"objects",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/layouts.py#L342-L504 | [
"def",
"grid",
"(",
"children",
"=",
"[",
"]",
",",
"sizing_mode",
"=",
"None",
",",
"nrows",
"=",
"None",
",",
"ncols",
"=",
"None",
")",
":",
"row",
"=",
"namedtuple",
"(",
"\"row\"",
",",
"[",
"\"children\"",
"]",
")",
"col",
"=",
"namedtuple",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _create_grid | Recursively create grid from input lists. | bokeh/layouts.py | def _create_grid(iterable, sizing_mode, layer=0):
"""Recursively create grid from input lists."""
return_list = []
for item in iterable:
if isinstance(item, list):
return_list.append(_create_grid(item, sizing_mode, layer+1))
elif isinstance(item, LayoutDOM):
if sizing... | def _create_grid(iterable, sizing_mode, layer=0):
"""Recursively create grid from input lists."""
return_list = []
for item in iterable:
if isinstance(item, list):
return_list.append(_create_grid(item, sizing_mode, layer+1))
elif isinstance(item, LayoutDOM):
if sizing... | [
"Recursively",
"create",
"grid",
"from",
"input",
"lists",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/layouts.py#L593-L610 | [
"def",
"_create_grid",
"(",
"iterable",
",",
"sizing_mode",
",",
"layer",
"=",
"0",
")",
":",
"return_list",
"=",
"[",
"]",
"for",
"item",
"in",
"iterable",
":",
"if",
"isinstance",
"(",
"item",
",",
"list",
")",
":",
"return_list",
".",
"append",
"(",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _chunks | Yield successive n-sized chunks from list, l. | bokeh/layouts.py | def _chunks(l, ncols):
"""Yield successive n-sized chunks from list, l."""
assert isinstance(ncols, int), "ncols must be an integer"
for i in range(0, len(l), ncols):
yield l[i: i+ncols] | def _chunks(l, ncols):
"""Yield successive n-sized chunks from list, l."""
assert isinstance(ncols, int), "ncols must be an integer"
for i in range(0, len(l), ncols):
yield l[i: i+ncols] | [
"Yield",
"successive",
"n",
"-",
"sized",
"chunks",
"from",
"list",
"l",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/layouts.py#L613-L617 | [
"def",
"_chunks",
"(",
"l",
",",
"ncols",
")",
":",
"assert",
"isinstance",
"(",
"ncols",
",",
"int",
")",
",",
"\"ncols must be an integer\"",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"len",
"(",
"l",
")",
",",
"ncols",
")",
":",
"yield",
"l",
"[... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | without_document_lock | Wrap a callback function to execute without first obtaining the
document lock.
Args:
func (callable) : The function to wrap
Returns:
callable : a function wrapped to execute without a |Document| lock.
While inside an unlocked callback, it is completely *unsafe* to modify
``curdoc(... | bokeh/document/locking.py | def without_document_lock(func):
''' Wrap a callback function to execute without first obtaining the
document lock.
Args:
func (callable) : The function to wrap
Returns:
callable : a function wrapped to execute without a |Document| lock.
While inside an unlocked callback, it is co... | def without_document_lock(func):
''' Wrap a callback function to execute without first obtaining the
document lock.
Args:
func (callable) : The function to wrap
Returns:
callable : a function wrapped to execute without a |Document| lock.
While inside an unlocked callback, it is co... | [
"Wrap",
"a",
"callback",
"function",
"to",
"execute",
"without",
"first",
"obtaining",
"the",
"document",
"lock",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/locking.py#L43-L73 | [
"def",
"without_document_lock",
"(",
"func",
")",
":",
"@",
"wraps",
"(",
"func",
")",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"return",
"func",
"(",
"*",
"args",
",",
"*",
"*",
"kw",
")",
"wrapper",
".",
"nolock",
"=",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | server_document | Return a script tag that embeds content from a Bokeh server.
Bokeh apps embedded using these methods will NOT set the browser window title.
Args:
url (str, optional) :
A URL to a Bokeh application on a Bokeh server (default: "default")
If ``"default"`` the default URL ``{DEFAU... | bokeh/embed/server.py | def server_document(url="default", relative_urls=False, resources="default", arguments=None):
''' Return a script tag that embeds content from a Bokeh server.
Bokeh apps embedded using these methods will NOT set the browser window title.
Args:
url (str, optional) :
A URL to a Bokeh app... | def server_document(url="default", relative_urls=False, resources="default", arguments=None):
''' Return a script tag that embeds content from a Bokeh server.
Bokeh apps embedded using these methods will NOT set the browser window title.
Args:
url (str, optional) :
A URL to a Bokeh app... | [
"Return",
"a",
"script",
"tag",
"that",
"embeds",
"content",
"from",
"a",
"Bokeh",
"server",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/server.py#L51-L110 | [
"def",
"server_document",
"(",
"url",
"=",
"\"default\"",
",",
"relative_urls",
"=",
"False",
",",
"resources",
"=",
"\"default\"",
",",
"arguments",
"=",
"None",
")",
":",
"url",
"=",
"_clean_url",
"(",
"url",
")",
"app_path",
"=",
"_get_app_path",
"(",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | server_session | Return a script tag that embeds content from a specific existing session on
a Bokeh server.
This function is typically only useful for serving from a a specific session
that was previously created using the ``bokeh.client`` API.
Bokeh apps embedded using these methods will NOT set the browser window t... | bokeh/embed/server.py | def server_session(model=None, session_id=None, url="default", relative_urls=False, resources="default"):
''' Return a script tag that embeds content from a specific existing session on
a Bokeh server.
This function is typically only useful for serving from a a specific session
that was previously crea... | def server_session(model=None, session_id=None, url="default", relative_urls=False, resources="default"):
''' Return a script tag that embeds content from a specific existing session on
a Bokeh server.
This function is typically only useful for serving from a a specific session
that was previously crea... | [
"Return",
"a",
"script",
"tag",
"that",
"embeds",
"content",
"from",
"a",
"specific",
"existing",
"session",
"on",
"a",
"Bokeh",
"server",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/server.py#L112-L194 | [
"def",
"server_session",
"(",
"model",
"=",
"None",
",",
"session_id",
"=",
"None",
",",
"url",
"=",
"\"default\"",
",",
"relative_urls",
"=",
"False",
",",
"resources",
"=",
"\"default\"",
")",
":",
"if",
"session_id",
"is",
"None",
":",
"raise",
"ValueEr... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _clean_url | Produce a canonical Bokeh server URL.
Args:
url (str)
A URL to clean, or "defatul". If "default" then the
``BOKEH_SERVER_HTTP_URL`` will be returned.
Returns:
str | bokeh/embed/server.py | def _clean_url(url):
''' Produce a canonical Bokeh server URL.
Args:
url (str)
A URL to clean, or "defatul". If "default" then the
``BOKEH_SERVER_HTTP_URL`` will be returned.
Returns:
str
'''
if url == 'default':
url = DEFAULT_SERVER_HTTP_URL
i... | def _clean_url(url):
''' Produce a canonical Bokeh server URL.
Args:
url (str)
A URL to clean, or "defatul". If "default" then the
``BOKEH_SERVER_HTTP_URL`` will be returned.
Returns:
str
'''
if url == 'default':
url = DEFAULT_SERVER_HTTP_URL
i... | [
"Produce",
"a",
"canonical",
"Bokeh",
"server",
"URL",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/server.py#L236-L254 | [
"def",
"_clean_url",
"(",
"url",
")",
":",
"if",
"url",
"==",
"'default'",
":",
"url",
"=",
"DEFAULT_SERVER_HTTP_URL",
"if",
"url",
".",
"startswith",
"(",
"\"ws\"",
")",
":",
"raise",
"ValueError",
"(",
"\"url should be the http or https URL for the server, not the... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _get_app_path | Extract the app path from a Bokeh server URL
Args:
url (str) :
Returns:
str | bokeh/embed/server.py | def _get_app_path(url):
''' Extract the app path from a Bokeh server URL
Args:
url (str) :
Returns:
str
'''
app_path = urlparse(url).path.rstrip("/")
if not app_path.startswith("/"):
app_path = "/" + app_path
return app_path | def _get_app_path(url):
''' Extract the app path from a Bokeh server URL
Args:
url (str) :
Returns:
str
'''
app_path = urlparse(url).path.rstrip("/")
if not app_path.startswith("/"):
app_path = "/" + app_path
return app_path | [
"Extract",
"the",
"app",
"path",
"from",
"a",
"Bokeh",
"server",
"URL"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/server.py#L256-L269 | [
"def",
"_get_app_path",
"(",
"url",
")",
":",
"app_path",
"=",
"urlparse",
"(",
"url",
")",
".",
"path",
".",
"rstrip",
"(",
"\"/\"",
")",
"if",
"not",
"app_path",
".",
"startswith",
"(",
"\"/\"",
")",
":",
"app_path",
"=",
"\"/\"",
"+",
"app_path",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _process_arguments | Return user-supplied HTML arguments to add to a Bokeh server URL.
Args:
arguments (dict[str, object]) :
Key/value pairs to add to the URL
Returns:
str | bokeh/embed/server.py | def _process_arguments(arguments):
''' Return user-supplied HTML arguments to add to a Bokeh server URL.
Args:
arguments (dict[str, object]) :
Key/value pairs to add to the URL
Returns:
str
'''
if arguments is None: return ""
result = ""
for key, value in argum... | def _process_arguments(arguments):
''' Return user-supplied HTML arguments to add to a Bokeh server URL.
Args:
arguments (dict[str, object]) :
Key/value pairs to add to the URL
Returns:
str
'''
if arguments is None: return ""
result = ""
for key, value in argum... | [
"Return",
"user",
"-",
"supplied",
"HTML",
"arguments",
"to",
"add",
"to",
"a",
"Bokeh",
"server",
"URL",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/server.py#L271-L287 | [
"def",
"_process_arguments",
"(",
"arguments",
")",
":",
"if",
"arguments",
"is",
"None",
":",
"return",
"\"\"",
"result",
"=",
"\"\"",
"for",
"key",
",",
"value",
"in",
"arguments",
".",
"items",
"(",
")",
":",
"if",
"not",
"key",
".",
"startswith",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | WSHandler.check_origin | Implement a check_origin policy for Tornado to call.
The supplied origin will be compared to the Bokeh server whitelist. If the
origin is not allow, an error will be logged and ``False`` will be returned.
Args:
origin (str) :
The URL of the connection origin
... | bokeh/server/views/ws.py | def check_origin(self, origin):
''' Implement a check_origin policy for Tornado to call.
The supplied origin will be compared to the Bokeh server whitelist. If the
origin is not allow, an error will be logged and ``False`` will be returned.
Args:
origin (str) :
... | def check_origin(self, origin):
''' Implement a check_origin policy for Tornado to call.
The supplied origin will be compared to the Bokeh server whitelist. If the
origin is not allow, an error will be logged and ``False`` will be returned.
Args:
origin (str) :
... | [
"Implement",
"a",
"check_origin",
"policy",
"for",
"Tornado",
"to",
"call",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/views/ws.py#L79-L108 | [
"def",
"check_origin",
"(",
"self",
",",
"origin",
")",
":",
"from",
".",
".",
"util",
"import",
"check_whitelist",
"parsed_origin",
"=",
"urlparse",
"(",
"origin",
")",
"origin_host",
"=",
"parsed_origin",
".",
"netloc",
".",
"lower",
"(",
")",
"allowed_hos... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | WSHandler.open | Initialize a connection to a client.
Returns:
None | bokeh/server/views/ws.py | def open(self):
''' Initialize a connection to a client.
Returns:
None
'''
log.info('WebSocket connection opened')
proto_version = self.get_argument("bokeh-protocol-version", default=None)
if proto_version is None:
self.close()
raise... | def open(self):
''' Initialize a connection to a client.
Returns:
None
'''
log.info('WebSocket connection opened')
proto_version = self.get_argument("bokeh-protocol-version", default=None)
if proto_version is None:
self.close()
raise... | [
"Initialize",
"a",
"connection",
"to",
"a",
"client",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/views/ws.py#L110-L144 | [
"def",
"open",
"(",
"self",
")",
":",
"log",
".",
"info",
"(",
"'WebSocket connection opened'",
")",
"proto_version",
"=",
"self",
".",
"get_argument",
"(",
"\"bokeh-protocol-version\"",
",",
"default",
"=",
"None",
")",
"if",
"proto_version",
"is",
"None",
":... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | WSHandler._async_open | Perform the specific steps needed to open a connection to a Bokeh session
Specifically, this method coordinates:
* Getting a session for a session ID (creating a new one if needed)
* Creating a protocol receiver and hander
* Opening a new ServerConnection and sending it an ACK
... | bokeh/server/views/ws.py | def _async_open(self, session_id, proto_version):
''' Perform the specific steps needed to open a connection to a Bokeh session
Specifically, this method coordinates:
* Getting a session for a session ID (creating a new one if needed)
* Creating a protocol receiver and hander
*... | def _async_open(self, session_id, proto_version):
''' Perform the specific steps needed to open a connection to a Bokeh session
Specifically, this method coordinates:
* Getting a session for a session ID (creating a new one if needed)
* Creating a protocol receiver and hander
*... | [
"Perform",
"the",
"specific",
"steps",
"needed",
"to",
"open",
"a",
"connection",
"to",
"a",
"Bokeh",
"session"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/views/ws.py#L147-L191 | [
"def",
"_async_open",
"(",
"self",
",",
"session_id",
",",
"proto_version",
")",
":",
"try",
":",
"yield",
"self",
".",
"application_context",
".",
"create_session_if_needed",
"(",
"session_id",
",",
"self",
".",
"request",
")",
"session",
"=",
"self",
".",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | WSHandler.on_message | Process an individual wire protocol fragment.
The websocket RFC specifies opcodes for distinguishing text frames
from binary frames. Tornado passes us either a text or binary string
depending on that opcode, we have to look at the type of the fragment
to see what we got.
Args:
... | bokeh/server/views/ws.py | def on_message(self, fragment):
''' Process an individual wire protocol fragment.
The websocket RFC specifies opcodes for distinguishing text frames
from binary frames. Tornado passes us either a text or binary string
depending on that opcode, we have to look at the type of the fragment... | def on_message(self, fragment):
''' Process an individual wire protocol fragment.
The websocket RFC specifies opcodes for distinguishing text frames
from binary frames. Tornado passes us either a text or binary string
depending on that opcode, we have to look at the type of the fragment... | [
"Process",
"an",
"individual",
"wire",
"protocol",
"fragment",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/views/ws.py#L194-L230 | [
"def",
"on_message",
"(",
"self",
",",
"fragment",
")",
":",
"# We shouldn't throw exceptions from on_message because the caller is",
"# just Tornado and it doesn't know what to do with them other than",
"# report them as an unhandled Future",
"try",
":",
"message",
"=",
"yield",
"se... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | WSHandler.send_message | Send a Bokeh Server protocol message to the connected client.
Args:
message (Message) : a message to send | bokeh/server/views/ws.py | def send_message(self, message):
''' Send a Bokeh Server protocol message to the connected client.
Args:
message (Message) : a message to send
'''
try:
if _message_test_port is not None:
_message_test_port.sent.append(message)
yield m... | def send_message(self, message):
''' Send a Bokeh Server protocol message to the connected client.
Args:
message (Message) : a message to send
'''
try:
if _message_test_port is not None:
_message_test_port.sent.append(message)
yield m... | [
"Send",
"a",
"Bokeh",
"Server",
"protocol",
"message",
"to",
"the",
"connected",
"client",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/views/ws.py#L243-L257 | [
"def",
"send_message",
"(",
"self",
",",
"message",
")",
":",
"try",
":",
"if",
"_message_test_port",
"is",
"not",
"None",
":",
"_message_test_port",
".",
"sent",
".",
"append",
"(",
"message",
")",
"yield",
"message",
".",
"send",
"(",
"self",
")",
"exc... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | WSHandler.write_message | Override parent write_message with a version that acquires a
write lock before writing. | bokeh/server/views/ws.py | def write_message(self, message, binary=False, locked=True):
''' Override parent write_message with a version that acquires a
write lock before writing.
'''
if locked:
with (yield self.write_lock.acquire()):
yield super(WSHandler, self).write_message(message,... | def write_message(self, message, binary=False, locked=True):
''' Override parent write_message with a version that acquires a
write lock before writing.
'''
if locked:
with (yield self.write_lock.acquire()):
yield super(WSHandler, self).write_message(message,... | [
"Override",
"parent",
"write_message",
"with",
"a",
"version",
"that",
"acquires",
"a",
"write",
"lock",
"before",
"writing",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/views/ws.py#L260-L269 | [
"def",
"write_message",
"(",
"self",
",",
"message",
",",
"binary",
"=",
"False",
",",
"locked",
"=",
"True",
")",
":",
"if",
"locked",
":",
"with",
"(",
"yield",
"self",
".",
"write_lock",
".",
"acquire",
"(",
")",
")",
":",
"yield",
"super",
"(",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | WSHandler.on_close | Clean up when the connection is closed. | bokeh/server/views/ws.py | def on_close(self):
''' Clean up when the connection is closed.
'''
log.info('WebSocket connection closed: code=%s, reason=%r', self.close_code, self.close_reason)
if self.connection is not None:
self.application.client_lost(self.connection) | def on_close(self):
''' Clean up when the connection is closed.
'''
log.info('WebSocket connection closed: code=%s, reason=%r', self.close_code, self.close_reason)
if self.connection is not None:
self.application.client_lost(self.connection) | [
"Clean",
"up",
"when",
"the",
"connection",
"is",
"closed",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/views/ws.py#L271-L277 | [
"def",
"on_close",
"(",
"self",
")",
":",
"log",
".",
"info",
"(",
"'WebSocket connection closed: code=%s, reason=%r'",
",",
"self",
".",
"close_code",
",",
"self",
".",
"close_reason",
")",
"if",
"self",
".",
"connection",
"is",
"not",
"None",
":",
"self",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | bundle_for_objs_and_resources | Generate rendered CSS and JS resources suitable for the given
collection of Bokeh objects
Args:
objs (seq[Model or Document]) :
resources (BaseResources or tuple[BaseResources])
Returns:
tuple | bokeh/embed/bundle.py | def bundle_for_objs_and_resources(objs, resources):
''' Generate rendered CSS and JS resources suitable for the given
collection of Bokeh objects
Args:
objs (seq[Model or Document]) :
resources (BaseResources or tuple[BaseResources])
Returns:
tuple
'''
if isinstance(r... | def bundle_for_objs_and_resources(objs, resources):
''' Generate rendered CSS and JS resources suitable for the given
collection of Bokeh objects
Args:
objs (seq[Model or Document]) :
resources (BaseResources or tuple[BaseResources])
Returns:
tuple
'''
if isinstance(r... | [
"Generate",
"rendered",
"CSS",
"and",
"JS",
"resources",
"suitable",
"for",
"the",
"given",
"collection",
"of",
"Bokeh",
"objects"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/bundle.py#L50-L116 | [
"def",
"bundle_for_objs_and_resources",
"(",
"objs",
",",
"resources",
")",
":",
"if",
"isinstance",
"(",
"resources",
",",
"BaseResources",
")",
":",
"js_resources",
"=",
"css_resources",
"=",
"resources",
"elif",
"isinstance",
"(",
"resources",
",",
"tuple",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _any | Whether any of a collection of objects satisfies a given query predicate
Args:
objs (seq[Model or Document]) :
query (callable)
Returns:
True, if ``query(obj)`` is True for some object in ``objs``, else False | bokeh/embed/bundle.py | def _any(objs, query):
''' Whether any of a collection of objects satisfies a given query predicate
Args:
objs (seq[Model or Document]) :
query (callable)
Returns:
True, if ``query(obj)`` is True for some object in ``objs``, else False
'''
for obj in objs:
if isin... | def _any(objs, query):
''' Whether any of a collection of objects satisfies a given query predicate
Args:
objs (seq[Model or Document]) :
query (callable)
Returns:
True, if ``query(obj)`` is True for some object in ``objs``, else False
'''
for obj in objs:
if isin... | [
"Whether",
"any",
"of",
"a",
"collection",
"of",
"objects",
"satisfies",
"a",
"given",
"query",
"predicate"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/bundle.py#L134-L154 | [
"def",
"_any",
"(",
"objs",
",",
"query",
")",
":",
"for",
"obj",
"in",
"objs",
":",
"if",
"isinstance",
"(",
"obj",
",",
"Document",
")",
":",
"if",
"_any",
"(",
"obj",
".",
"roots",
",",
"query",
")",
":",
"return",
"True",
"else",
":",
"if",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _use_gl | Whether a collection of Bokeh objects contains a plot requesting WebGL
Args:
objs (seq[Model or Document]) :
Returns:
bool | bokeh/embed/bundle.py | def _use_gl(objs):
''' Whether a collection of Bokeh objects contains a plot requesting WebGL
Args:
objs (seq[Model or Document]) :
Returns:
bool
'''
from ..models.plots import Plot
return _any(objs, lambda obj: isinstance(obj, Plot) and obj.output_backend == "webgl") | def _use_gl(objs):
''' Whether a collection of Bokeh objects contains a plot requesting WebGL
Args:
objs (seq[Model or Document]) :
Returns:
bool
'''
from ..models.plots import Plot
return _any(objs, lambda obj: isinstance(obj, Plot) and obj.output_backend == "webgl") | [
"Whether",
"a",
"collection",
"of",
"Bokeh",
"objects",
"contains",
"a",
"plot",
"requesting",
"WebGL"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/bundle.py#L156-L167 | [
"def",
"_use_gl",
"(",
"objs",
")",
":",
"from",
".",
".",
"models",
".",
"plots",
"import",
"Plot",
"return",
"_any",
"(",
"objs",
",",
"lambda",
"obj",
":",
"isinstance",
"(",
"obj",
",",
"Plot",
")",
"and",
"obj",
".",
"output_backend",
"==",
"\"w... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _use_tables | Whether a collection of Bokeh objects contains a TableWidget
Args:
objs (seq[Model or Document]) :
Returns:
bool | bokeh/embed/bundle.py | def _use_tables(objs):
''' Whether a collection of Bokeh objects contains a TableWidget
Args:
objs (seq[Model or Document]) :
Returns:
bool
'''
from ..models.widgets import TableWidget
return _any(objs, lambda obj: isinstance(obj, TableWidget)) | def _use_tables(objs):
''' Whether a collection of Bokeh objects contains a TableWidget
Args:
objs (seq[Model or Document]) :
Returns:
bool
'''
from ..models.widgets import TableWidget
return _any(objs, lambda obj: isinstance(obj, TableWidget)) | [
"Whether",
"a",
"collection",
"of",
"Bokeh",
"objects",
"contains",
"a",
"TableWidget"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/bundle.py#L169-L180 | [
"def",
"_use_tables",
"(",
"objs",
")",
":",
"from",
".",
".",
"models",
".",
"widgets",
"import",
"TableWidget",
"return",
"_any",
"(",
"objs",
",",
"lambda",
"obj",
":",
"isinstance",
"(",
"obj",
",",
"TableWidget",
")",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _use_widgets | Whether a collection of Bokeh objects contains a any Widget
Args:
objs (seq[Model or Document]) :
Returns:
bool | bokeh/embed/bundle.py | def _use_widgets(objs):
''' Whether a collection of Bokeh objects contains a any Widget
Args:
objs (seq[Model or Document]) :
Returns:
bool
'''
from ..models.widgets import Widget
return _any(objs, lambda obj: isinstance(obj, Widget)) | def _use_widgets(objs):
''' Whether a collection of Bokeh objects contains a any Widget
Args:
objs (seq[Model or Document]) :
Returns:
bool
'''
from ..models.widgets import Widget
return _any(objs, lambda obj: isinstance(obj, Widget)) | [
"Whether",
"a",
"collection",
"of",
"Bokeh",
"objects",
"contains",
"a",
"any",
"Widget"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/bundle.py#L182-L193 | [
"def",
"_use_widgets",
"(",
"objs",
")",
":",
"from",
".",
".",
"models",
".",
"widgets",
"import",
"Widget",
"return",
"_any",
"(",
"objs",
",",
"lambda",
"obj",
":",
"isinstance",
"(",
"obj",
",",
"Widget",
")",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | PropertyDescriptor.add_prop_descriptor_to_class | ``MetaHasProps`` calls this during class creation as it iterates
over properties to add, to update its registry of new properties.
The parameters passed in are mutable and this function is expected to
update them accordingly.
Args:
class_name (str) :
name of... | bokeh/core/property/descriptors.py | def add_prop_descriptor_to_class(self, class_name, new_class_attrs, names_with_refs, container_names, dataspecs):
''' ``MetaHasProps`` calls this during class creation as it iterates
over properties to add, to update its registry of new properties.
The parameters passed in are mutable and this ... | def add_prop_descriptor_to_class(self, class_name, new_class_attrs, names_with_refs, container_names, dataspecs):
''' ``MetaHasProps`` calls this during class creation as it iterates
over properties to add, to update its registry of new properties.
The parameters passed in are mutable and this ... | [
"MetaHasProps",
"calls",
"this",
"during",
"class",
"creation",
"as",
"it",
"iterates",
"over",
"properties",
"to",
"add",
"to",
"update",
"its",
"registry",
"of",
"new",
"properties",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/descriptors.py#L221-L267 | [
"def",
"add_prop_descriptor_to_class",
"(",
"self",
",",
"class_name",
",",
"new_class_attrs",
",",
"names_with_refs",
",",
"container_names",
",",
"dataspecs",
")",
":",
"from",
".",
"bases",
"import",
"ContainerProperty",
"from",
".",
"dataspec",
"import",
"DataSp... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | PropertyDescriptor.serializable_value | Produce the value as it should be serialized.
Sometimes it is desirable for the serialized value to differ from
the ``__get__`` in order for the ``__get__`` value to appear simpler
for user or developer convenience.
Args:
obj (HasProps) : the object to get the serialized at... | bokeh/core/property/descriptors.py | def serializable_value(self, obj):
''' Produce the value as it should be serialized.
Sometimes it is desirable for the serialized value to differ from
the ``__get__`` in order for the ``__get__`` value to appear simpler
for user or developer convenience.
Args:
obj (... | def serializable_value(self, obj):
''' Produce the value as it should be serialized.
Sometimes it is desirable for the serialized value to differ from
the ``__get__`` in order for the ``__get__`` value to appear simpler
for user or developer convenience.
Args:
obj (... | [
"Produce",
"the",
"value",
"as",
"it",
"should",
"be",
"serialized",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/descriptors.py#L281-L296 | [
"def",
"serializable_value",
"(",
"self",
",",
"obj",
")",
":",
"value",
"=",
"self",
".",
"__get__",
"(",
"obj",
",",
"obj",
".",
"__class__",
")",
"return",
"self",
".",
"property",
".",
"serialize_value",
"(",
"value",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | PropertyDescriptor.set_from_json | Sets the value of this property from a JSON value.
Args:
obj: (HasProps) : instance to set the property value on
json: (JSON-value) : value to set to the attribute to
models (dict or None, optional) :
Mapping of model ids to models (default: None)
... | bokeh/core/property/descriptors.py | def set_from_json(self, obj, json, models=None, setter=None):
'''Sets the value of this property from a JSON value.
Args:
obj: (HasProps) : instance to set the property value on
json: (JSON-value) : value to set to the attribute to
models (dict or None, optional) :... | def set_from_json(self, obj, json, models=None, setter=None):
'''Sets the value of this property from a JSON value.
Args:
obj: (HasProps) : instance to set the property value on
json: (JSON-value) : value to set to the attribute to
models (dict or None, optional) :... | [
"Sets",
"the",
"value",
"of",
"this",
"property",
"from",
"a",
"JSON",
"value",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/descriptors.py#L298-L327 | [
"def",
"set_from_json",
"(",
"self",
",",
"obj",
",",
"json",
",",
"models",
"=",
"None",
",",
"setter",
"=",
"None",
")",
":",
"self",
".",
"_internal_set",
"(",
"obj",
",",
"json",
",",
"setter",
"=",
"setter",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BasicPropertyDescriptor.instance_default | Get the default value that will be used for a specific instance.
Args:
obj (HasProps) : The instance to get the default value for.
Returns:
object | bokeh/core/property/descriptors.py | def instance_default(self, obj):
''' Get the default value that will be used for a specific instance.
Args:
obj (HasProps) : The instance to get the default value for.
Returns:
object
'''
return self.property.themed_default(obj.__class__, self.name, obj... | def instance_default(self, obj):
''' Get the default value that will be used for a specific instance.
Args:
obj (HasProps) : The instance to get the default value for.
Returns:
object
'''
return self.property.themed_default(obj.__class__, self.name, obj... | [
"Get",
"the",
"default",
"value",
"that",
"will",
"be",
"used",
"for",
"a",
"specific",
"instance",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/descriptors.py#L577-L587 | [
"def",
"instance_default",
"(",
"self",
",",
"obj",
")",
":",
"return",
"self",
".",
"property",
".",
"themed_default",
"(",
"obj",
".",
"__class__",
",",
"self",
".",
"name",
",",
"obj",
".",
"themed_values",
"(",
")",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BasicPropertyDescriptor.set_from_json | Sets the value of this property from a JSON value.
This method first
Args:
obj (HasProps) :
json (JSON-dict) :
models(seq[Model], optional) :
setter (ClientSession or ServerSession or None, optional) :
This is used to prevent "boomeran... | bokeh/core/property/descriptors.py | def set_from_json(self, obj, json, models=None, setter=None):
''' Sets the value of this property from a JSON value.
This method first
Args:
obj (HasProps) :
json (JSON-dict) :
models(seq[Model], optional) :
setter (ClientSession or ServerSess... | def set_from_json(self, obj, json, models=None, setter=None):
''' Sets the value of this property from a JSON value.
This method first
Args:
obj (HasProps) :
json (JSON-dict) :
models(seq[Model], optional) :
setter (ClientSession or ServerSess... | [
"Sets",
"the",
"value",
"of",
"this",
"property",
"from",
"a",
"JSON",
"value",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/descriptors.py#L589-L618 | [
"def",
"set_from_json",
"(",
"self",
",",
"obj",
",",
"json",
",",
"models",
"=",
"None",
",",
"setter",
"=",
"None",
")",
":",
"return",
"super",
"(",
"BasicPropertyDescriptor",
",",
"self",
")",
".",
"set_from_json",
"(",
"obj",
",",
"self",
".",
"pr... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BasicPropertyDescriptor.trigger_if_changed | Send a change event notification if the property is set to a
value is not equal to ``old``.
Args:
obj (HasProps)
The object the property is being set on.
old (obj) :
The previous value of the property to compare
Returns:
None | bokeh/core/property/descriptors.py | def trigger_if_changed(self, obj, old):
''' Send a change event notification if the property is set to a
value is not equal to ``old``.
Args:
obj (HasProps)
The object the property is being set on.
old (obj) :
The previous value of the pr... | def trigger_if_changed(self, obj, old):
''' Send a change event notification if the property is set to a
value is not equal to ``old``.
Args:
obj (HasProps)
The object the property is being set on.
old (obj) :
The previous value of the pr... | [
"Send",
"a",
"change",
"event",
"notification",
"if",
"the",
"property",
"is",
"set",
"to",
"a",
"value",
"is",
"not",
"equal",
"to",
"old",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/descriptors.py#L620-L637 | [
"def",
"trigger_if_changed",
"(",
"self",
",",
"obj",
",",
"old",
")",
":",
"new_value",
"=",
"self",
".",
"__get__",
"(",
"obj",
",",
"obj",
".",
"__class__",
")",
"if",
"not",
"self",
".",
"property",
".",
"matches",
"(",
"old",
",",
"new_value",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BasicPropertyDescriptor._get | Internal implementation of instance attribute access for the
``BasicPropertyDescriptor`` getter.
If the value has not been explicitly set by a user, return that
value. Otherwise, return the default.
Args:
obj (HasProps) : the instance to get a value of this property for
... | bokeh/core/property/descriptors.py | def _get(self, obj):
''' Internal implementation of instance attribute access for the
``BasicPropertyDescriptor`` getter.
If the value has not been explicitly set by a user, return that
value. Otherwise, return the default.
Args:
obj (HasProps) : the instance to get... | def _get(self, obj):
''' Internal implementation of instance attribute access for the
``BasicPropertyDescriptor`` getter.
If the value has not been explicitly set by a user, return that
value. Otherwise, return the default.
Args:
obj (HasProps) : the instance to get... | [
"Internal",
"implementation",
"of",
"instance",
"attribute",
"access",
"for",
"the",
"BasicPropertyDescriptor",
"getter",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/descriptors.py#L671-L697 | [
"def",
"_get",
"(",
"self",
",",
"obj",
")",
":",
"if",
"not",
"hasattr",
"(",
"obj",
",",
"'_property_values'",
")",
":",
"raise",
"RuntimeError",
"(",
"\"Cannot get a property value '%s' from a %s instance before HasProps.__init__\"",
"%",
"(",
"self",
".",
"name"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BasicPropertyDescriptor._get_default | Internal implementation of instance attribute access for default
values.
Handles bookeeping around |PropertyContainer| value, etc. | bokeh/core/property/descriptors.py | def _get_default(self, obj):
''' Internal implementation of instance attribute access for default
values.
Handles bookeeping around |PropertyContainer| value, etc.
'''
if self.name in obj._property_values:
# this shouldn't happen because we should have checked befor... | def _get_default(self, obj):
''' Internal implementation of instance attribute access for default
values.
Handles bookeeping around |PropertyContainer| value, etc.
'''
if self.name in obj._property_values:
# this shouldn't happen because we should have checked befor... | [
"Internal",
"implementation",
"of",
"instance",
"attribute",
"access",
"for",
"default",
"values",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/descriptors.py#L699-L727 | [
"def",
"_get_default",
"(",
"self",
",",
"obj",
")",
":",
"if",
"self",
".",
"name",
"in",
"obj",
".",
"_property_values",
":",
"# this shouldn't happen because we should have checked before _get_default()",
"raise",
"RuntimeError",
"(",
"\"Bokeh internal error, does not ha... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BasicPropertyDescriptor._internal_set | Internal implementation to set property values, that is used
by __set__, set_from_json, etc.
Delegate to the |Property| instance to prepare the value appropriately,
then `set.
Args:
obj (HasProps)
The object the property is being set on.
old (ob... | bokeh/core/property/descriptors.py | def _internal_set(self, obj, value, hint=None, setter=None):
''' Internal implementation to set property values, that is used
by __set__, set_from_json, etc.
Delegate to the |Property| instance to prepare the value appropriately,
then `set.
Args:
obj (HasProps)
... | def _internal_set(self, obj, value, hint=None, setter=None):
''' Internal implementation to set property values, that is used
by __set__, set_from_json, etc.
Delegate to the |Property| instance to prepare the value appropriately,
then `set.
Args:
obj (HasProps)
... | [
"Internal",
"implementation",
"to",
"set",
"property",
"values",
"that",
"is",
"used",
"by",
"__set__",
"set_from_json",
"etc",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/descriptors.py#L729-L769 | [
"def",
"_internal_set",
"(",
"self",
",",
"obj",
",",
"value",
",",
"hint",
"=",
"None",
",",
"setter",
"=",
"None",
")",
":",
"value",
"=",
"self",
".",
"property",
".",
"prepare_value",
"(",
"obj",
",",
"self",
".",
"name",
",",
"value",
")",
"ol... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BasicPropertyDescriptor._real_set | Internal implementation helper to set property values.
This function handles bookkeeping around noting whether values have
been explicitly set, etc.
Args:
obj (HasProps)
The object the property is being set on.
old (obj) :
The previous v... | bokeh/core/property/descriptors.py | def _real_set(self, obj, old, value, hint=None, setter=None):
''' Internal implementation helper to set property values.
This function handles bookkeeping around noting whether values have
been explicitly set, etc.
Args:
obj (HasProps)
The object the propert... | def _real_set(self, obj, old, value, hint=None, setter=None):
''' Internal implementation helper to set property values.
This function handles bookkeeping around noting whether values have
been explicitly set, etc.
Args:
obj (HasProps)
The object the propert... | [
"Internal",
"implementation",
"helper",
"to",
"set",
"property",
"values",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/descriptors.py#L771-L838 | [
"def",
"_real_set",
"(",
"self",
",",
"obj",
",",
"old",
",",
"value",
",",
"hint",
"=",
"None",
",",
"setter",
"=",
"None",
")",
":",
"# Normally we want a \"no-op\" if the new value and old value are identical",
"# but some hinted events are in-place. This check will allo... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BasicPropertyDescriptor._notify_mutated | A method to call when a container is mutated "behind our back"
and we detect it with our |PropertyContainer| wrappers.
Args:
obj (HasProps) :
The object who's container value was mutated
old (object) :
The "old" value of the container
... | bokeh/core/property/descriptors.py | def _notify_mutated(self, obj, old, hint=None):
''' A method to call when a container is mutated "behind our back"
and we detect it with our |PropertyContainer| wrappers.
Args:
obj (HasProps) :
The object who's container value was mutated
old (object) :
... | def _notify_mutated(self, obj, old, hint=None):
''' A method to call when a container is mutated "behind our back"
and we detect it with our |PropertyContainer| wrappers.
Args:
obj (HasProps) :
The object who's container value was mutated
old (object) :
... | [
"A",
"method",
"to",
"call",
"when",
"a",
"container",
"is",
"mutated",
"behind",
"our",
"back",
"and",
"we",
"detect",
"it",
"with",
"our",
"|PropertyContainer|",
"wrappers",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/descriptors.py#L842-L875 | [
"def",
"_notify_mutated",
"(",
"self",
",",
"obj",
",",
"old",
",",
"hint",
"=",
"None",
")",
":",
"value",
"=",
"self",
".",
"__get__",
"(",
"obj",
",",
"obj",
".",
"__class__",
")",
"# re-validate because the contents of 'old' have changed,",
"# in some cases ... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BasicPropertyDescriptor._trigger | Unconditionally send a change event notification for the property.
Args:
obj (HasProps)
The object the property is being set on.
old (obj) :
The previous value of the property
new (obj) :
The new value of the property
... | bokeh/core/property/descriptors.py | def _trigger(self, obj, old, value, hint=None, setter=None):
''' Unconditionally send a change event notification for the property.
Args:
obj (HasProps)
The object the property is being set on.
old (obj) :
The previous value of the property
... | def _trigger(self, obj, old, value, hint=None, setter=None):
''' Unconditionally send a change event notification for the property.
Args:
obj (HasProps)
The object the property is being set on.
old (obj) :
The previous value of the property
... | [
"Unconditionally",
"send",
"a",
"change",
"event",
"notification",
"for",
"the",
"property",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/descriptors.py#L877-L915 | [
"def",
"_trigger",
"(",
"self",
",",
"obj",
",",
"old",
",",
"value",
",",
"hint",
"=",
"None",
",",
"setter",
"=",
"None",
")",
":",
"if",
"hasattr",
"(",
"obj",
",",
"'trigger'",
")",
":",
"obj",
".",
"trigger",
"(",
"self",
".",
"name",
",",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | DataSpecPropertyDescriptor.set_from_json | Sets the value of this property from a JSON value.
This method first
Args:
obj (HasProps) :
json (JSON-dict) :
models(seq[Model], optional) :
setter (ClientSession or ServerSession or None, optional) :
This is used to prevent "boomeran... | bokeh/core/property/descriptors.py | def set_from_json(self, obj, json, models=None, setter=None):
''' Sets the value of this property from a JSON value.
This method first
Args:
obj (HasProps) :
json (JSON-dict) :
models(seq[Model], optional) :
setter (ClientSession or ServerSess... | def set_from_json(self, obj, json, models=None, setter=None):
''' Sets the value of this property from a JSON value.
This method first
Args:
obj (HasProps) :
json (JSON-dict) :
models(seq[Model], optional) :
setter (ClientSession or ServerSess... | [
"Sets",
"the",
"value",
"of",
"this",
"property",
"from",
"a",
"JSON",
"value",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/descriptors.py#L987-L1028 | [
"def",
"set_from_json",
"(",
"self",
",",
"obj",
",",
"json",
",",
"models",
"=",
"None",
",",
"setter",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"json",
",",
"dict",
")",
":",
"# we want to try to keep the \"format\" of the data spec as string, dict, or nu... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | UnitsSpecPropertyDescriptor.set_from_json | Sets the value of this property from a JSON value.
This method first separately extracts and removes any ``units`` field
in the JSON, and sets the associated units property directly. The
remaining JSON is then passed to the superclass ``set_from_json`` to
be handled.
Args:
... | bokeh/core/property/descriptors.py | def set_from_json(self, obj, json, models=None, setter=None):
''' Sets the value of this property from a JSON value.
This method first separately extracts and removes any ``units`` field
in the JSON, and sets the associated units property directly. The
remaining JSON is then passed to t... | def set_from_json(self, obj, json, models=None, setter=None):
''' Sets the value of this property from a JSON value.
This method first separately extracts and removes any ``units`` field
in the JSON, and sets the associated units property directly. The
remaining JSON is then passed to t... | [
"Sets",
"the",
"value",
"of",
"this",
"property",
"from",
"a",
"JSON",
"value",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/descriptors.py#L1091-L1126 | [
"def",
"set_from_json",
"(",
"self",
",",
"obj",
",",
"json",
",",
"models",
"=",
"None",
",",
"setter",
"=",
"None",
")",
":",
"json",
"=",
"self",
".",
"_extract_units",
"(",
"obj",
",",
"json",
")",
"super",
"(",
"UnitsSpecPropertyDescriptor",
",",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | UnitsSpecPropertyDescriptor._extract_units | Internal helper for dealing with units associated units properties
when setting values on |UnitsSpec| properties.
When ``value`` is a dict, this function may mutate the value of the
associated units property.
Args:
obj (HasProps) : instance to update units spec property val... | bokeh/core/property/descriptors.py | def _extract_units(self, obj, value):
''' Internal helper for dealing with units associated units properties
when setting values on |UnitsSpec| properties.
When ``value`` is a dict, this function may mutate the value of the
associated units property.
Args:
obj (HasP... | def _extract_units(self, obj, value):
''' Internal helper for dealing with units associated units properties
when setting values on |UnitsSpec| properties.
When ``value`` is a dict, this function may mutate the value of the
associated units property.
Args:
obj (HasP... | [
"Internal",
"helper",
"for",
"dealing",
"with",
"units",
"associated",
"units",
"properties",
"when",
"setting",
"values",
"on",
"|UnitsSpec|",
"properties",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/descriptors.py#L1128-L1150 | [
"def",
"_extract_units",
"(",
"self",
",",
"obj",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"if",
"'units'",
"in",
"value",
":",
"value",
"=",
"copy",
"(",
"value",
")",
"# so we can modify it",
"units",
"=",
"val... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | install_notebook_hook | Install a new notebook display hook.
Bokeh comes with support for Jupyter notebooks built-in. However, there are
other kinds of notebooks in use by different communities. This function
provides a mechanism for other projects to instruct Bokeh how to display
content in other notebooks.
This functio... | bokeh/io/notebook.py | def install_notebook_hook(notebook_type, load, show_doc, show_app, overwrite=False):
''' Install a new notebook display hook.
Bokeh comes with support for Jupyter notebooks built-in. However, there are
other kinds of notebooks in use by different communities. This function
provides a mechanism for othe... | def install_notebook_hook(notebook_type, load, show_doc, show_app, overwrite=False):
''' Install a new notebook display hook.
Bokeh comes with support for Jupyter notebooks built-in. However, there are
other kinds of notebooks in use by different communities. This function
provides a mechanism for othe... | [
"Install",
"a",
"new",
"notebook",
"display",
"hook",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/notebook.py#L112-L189 | [
"def",
"install_notebook_hook",
"(",
"notebook_type",
",",
"load",
",",
"show_doc",
",",
"show_app",
",",
"overwrite",
"=",
"False",
")",
":",
"if",
"notebook_type",
"in",
"_HOOKS",
"and",
"not",
"overwrite",
":",
"raise",
"RuntimeError",
"(",
"\"hook for notebo... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | push_notebook | Update Bokeh plots in a Jupyter notebook output cells with new data
or property values.
When working the the notebook, the ``show`` function can be passed the
argument ``notebook_handle=True``, which will cause it to return a
handle object that can be used to update the Bokeh output later. When
``p... | bokeh/io/notebook.py | def push_notebook(document=None, state=None, handle=None):
''' Update Bokeh plots in a Jupyter notebook output cells with new data
or property values.
When working the the notebook, the ``show`` function can be passed the
argument ``notebook_handle=True``, which will cause it to return a
handle obj... | def push_notebook(document=None, state=None, handle=None):
''' Update Bokeh plots in a Jupyter notebook output cells with new data
or property values.
When working the the notebook, the ``show`` function can be passed the
argument ``notebook_handle=True``, which will cause it to return a
handle obj... | [
"Update",
"Bokeh",
"plots",
"in",
"a",
"Jupyter",
"notebook",
"output",
"cells",
"with",
"new",
"data",
"or",
"property",
"values",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/notebook.py#L191-L275 | [
"def",
"push_notebook",
"(",
"document",
"=",
"None",
",",
"state",
"=",
"None",
",",
"handle",
"=",
"None",
")",
":",
"from",
".",
".",
"protocol",
"import",
"Protocol",
"if",
"state",
"is",
"None",
":",
"state",
"=",
"curstate",
"(",
")",
"if",
"no... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | run_notebook_hook | Run an installed notebook hook with supplied arguments.
Args:
noteboook_type (str) :
Name of an existing installed notebook hook
actions (str) :
Name of the hook action to execute, ``'doc'`` or ``'app'``
All other arguments and keyword arguments are passed to the hook ... | bokeh/io/notebook.py | def run_notebook_hook(notebook_type, action, *args, **kw):
''' Run an installed notebook hook with supplied arguments.
Args:
noteboook_type (str) :
Name of an existing installed notebook hook
actions (str) :
Name of the hook action to execute, ``'doc'`` or ``'app'``
... | def run_notebook_hook(notebook_type, action, *args, **kw):
''' Run an installed notebook hook with supplied arguments.
Args:
noteboook_type (str) :
Name of an existing installed notebook hook
actions (str) :
Name of the hook action to execute, ``'doc'`` or ``'app'``
... | [
"Run",
"an",
"installed",
"notebook",
"hook",
"with",
"supplied",
"arguments",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/notebook.py#L277-L302 | [
"def",
"run_notebook_hook",
"(",
"notebook_type",
",",
"action",
",",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"if",
"notebook_type",
"not",
"in",
"_HOOKS",
":",
"raise",
"RuntimeError",
"(",
"\"no display hook installed for notebook type %r\"",
"%",
"notebook_... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | destroy_server | Given a UUID id of a div removed or replaced in the Jupyter
notebook, destroy the corresponding server sessions and stop it. | bokeh/io/notebook.py | def destroy_server(server_id):
''' Given a UUID id of a div removed or replaced in the Jupyter
notebook, destroy the corresponding server sessions and stop it.
'''
server = curstate().uuid_to_server.get(server_id, None)
if server is None:
log.debug("No server instance found for uuid: %r" % ... | def destroy_server(server_id):
''' Given a UUID id of a div removed or replaced in the Jupyter
notebook, destroy the corresponding server sessions and stop it.
'''
server = curstate().uuid_to_server.get(server_id, None)
if server is None:
log.debug("No server instance found for uuid: %r" % ... | [
"Given",
"a",
"UUID",
"id",
"of",
"a",
"div",
"removed",
"or",
"replaced",
"in",
"the",
"Jupyter",
"notebook",
"destroy",
"the",
"corresponding",
"server",
"sessions",
"and",
"stop",
"it",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/notebook.py#L308-L325 | [
"def",
"destroy_server",
"(",
"server_id",
")",
":",
"server",
"=",
"curstate",
"(",
")",
".",
"uuid_to_server",
".",
"get",
"(",
"server_id",
",",
"None",
")",
"if",
"server",
"is",
"None",
":",
"log",
".",
"debug",
"(",
"\"No server instance found for uuid... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | load_notebook | Prepare the IPython notebook for displaying Bokeh plots.
Args:
resources (Resource, optional) :
how and where to load BokehJS from (default: CDN)
verbose (bool, optional) :
whether to report detailed settings (default: False)
hide_banner (bool, optional):
... | bokeh/io/notebook.py | def load_notebook(resources=None, verbose=False, hide_banner=False, load_timeout=5000):
''' Prepare the IPython notebook for displaying Bokeh plots.
Args:
resources (Resource, optional) :
how and where to load BokehJS from (default: CDN)
verbose (bool, optional) :
wheth... | def load_notebook(resources=None, verbose=False, hide_banner=False, load_timeout=5000):
''' Prepare the IPython notebook for displaying Bokeh plots.
Args:
resources (Resource, optional) :
how and where to load BokehJS from (default: CDN)
verbose (bool, optional) :
wheth... | [
"Prepare",
"the",
"IPython",
"notebook",
"for",
"displaying",
"Bokeh",
"plots",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/notebook.py#L348-L423 | [
"def",
"load_notebook",
"(",
"resources",
"=",
"None",
",",
"verbose",
"=",
"False",
",",
"hide_banner",
"=",
"False",
",",
"load_timeout",
"=",
"5000",
")",
":",
"global",
"_NOTEBOOK_LOADED",
"from",
".",
".",
"import",
"__version__",
"from",
".",
".",
"c... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | show_app | Embed a Bokeh server application in a Jupyter Notebook output cell.
Args:
app (Application or callable) :
A Bokeh Application to embed inline in a Jupyter notebook.
state (State) :
** Unused **
notebook_url (str or callable) :
The URL of the notebook se... | bokeh/io/notebook.py | def show_app(app, state, notebook_url, port=0, **kw):
''' Embed a Bokeh server application in a Jupyter Notebook output cell.
Args:
app (Application or callable) :
A Bokeh Application to embed inline in a Jupyter notebook.
state (State) :
** Unused **
notebook_... | def show_app(app, state, notebook_url, port=0, **kw):
''' Embed a Bokeh server application in a Jupyter Notebook output cell.
Args:
app (Application or callable) :
A Bokeh Application to embed inline in a Jupyter notebook.
state (State) :
** Unused **
notebook_... | [
"Embed",
"a",
"Bokeh",
"server",
"application",
"in",
"a",
"Jupyter",
"Notebook",
"output",
"cell",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/notebook.py#L433-L501 | [
"def",
"show_app",
"(",
"app",
",",
"state",
",",
"notebook_url",
",",
"port",
"=",
"0",
",",
"*",
"*",
"kw",
")",
":",
"logging",
".",
"basicConfig",
"(",
")",
"from",
"tornado",
".",
"ioloop",
"import",
"IOLoop",
"from",
".",
".",
"server",
".",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Color.clamp | Clamp numeric values to be non-negative, an optionally, less than a
given maximum.
Args:
value (float) :
A number to clamp.
maximum (float, optional) :
A max bound to to clamp to. If None, there is no upper bound,
and values are o... | bokeh/colors/color.py | def clamp(value, maximum=None):
''' Clamp numeric values to be non-negative, an optionally, less than a
given maximum.
Args:
value (float) :
A number to clamp.
maximum (float, optional) :
A max bound to to clamp to. If None, there is no u... | def clamp(value, maximum=None):
''' Clamp numeric values to be non-negative, an optionally, less than a
given maximum.
Args:
value (float) :
A number to clamp.
maximum (float, optional) :
A max bound to to clamp to. If None, there is no u... | [
"Clamp",
"numeric",
"values",
"to",
"be",
"non",
"-",
"negative",
"an",
"optionally",
"less",
"than",
"a",
"given",
"maximum",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/colors/color.py#L50-L71 | [
"def",
"clamp",
"(",
"value",
",",
"maximum",
"=",
"None",
")",
":",
"value",
"=",
"max",
"(",
"value",
",",
"0",
")",
"if",
"maximum",
"is",
"not",
"None",
":",
"return",
"min",
"(",
"value",
",",
"maximum",
")",
"else",
":",
"return",
"value"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Color.darken | Darken (reduce the luminance) of this color.
Args:
amount (float) :
Amount to reduce the luminance by (clamped above zero)
Returns:
Color | bokeh/colors/color.py | def darken(self, amount):
''' Darken (reduce the luminance) of this color.
Args:
amount (float) :
Amount to reduce the luminance by (clamped above zero)
Returns:
Color
'''
hsl = self.to_hsl()
hsl.l = self.clamp(hsl.l - amount)
... | def darken(self, amount):
''' Darken (reduce the luminance) of this color.
Args:
amount (float) :
Amount to reduce the luminance by (clamped above zero)
Returns:
Color
'''
hsl = self.to_hsl()
hsl.l = self.clamp(hsl.l - amount)
... | [
"Darken",
"(",
"reduce",
"the",
"luminance",
")",
"of",
"this",
"color",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/colors/color.py#L81-L94 | [
"def",
"darken",
"(",
"self",
",",
"amount",
")",
":",
"hsl",
"=",
"self",
".",
"to_hsl",
"(",
")",
"hsl",
".",
"l",
"=",
"self",
".",
"clamp",
"(",
"hsl",
".",
"l",
"-",
"amount",
")",
"return",
"self",
".",
"from_hsl",
"(",
"hsl",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Color.lighten | Lighten (increase the luminance) of this color.
Args:
amount (float) :
Amount to increase the luminance by (clamped above zero)
Returns:
Color | bokeh/colors/color.py | def lighten(self, amount):
''' Lighten (increase the luminance) of this color.
Args:
amount (float) :
Amount to increase the luminance by (clamped above zero)
Returns:
Color
'''
hsl = self.to_hsl()
hsl.l = self.clamp(hsl.l + amou... | def lighten(self, amount):
''' Lighten (increase the luminance) of this color.
Args:
amount (float) :
Amount to increase the luminance by (clamped above zero)
Returns:
Color
'''
hsl = self.to_hsl()
hsl.l = self.clamp(hsl.l + amou... | [
"Lighten",
"(",
"increase",
"the",
"luminance",
")",
"of",
"this",
"color",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/colors/color.py#L129-L142 | [
"def",
"lighten",
"(",
"self",
",",
"amount",
")",
":",
"hsl",
"=",
"self",
".",
"to_hsl",
"(",
")",
"hsl",
".",
"l",
"=",
"self",
".",
"clamp",
"(",
"hsl",
".",
"l",
"+",
"amount",
",",
"1",
")",
"return",
"self",
".",
"from_hsl",
"(",
"hsl",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Toggle.on_click | Set up a handler for button state changes (clicks).
Args:
handler (func) : handler function to call when button is toggled.
Returns:
None | bokeh/models/widgets/buttons.py | def on_click(self, handler):
""" Set up a handler for button state changes (clicks).
Args:
handler (func) : handler function to call when button is toggled.
Returns:
None
"""
self.on_change('active', lambda attr, old, new: handler(new)) | def on_click(self, handler):
""" Set up a handler for button state changes (clicks).
Args:
handler (func) : handler function to call when button is toggled.
Returns:
None
"""
self.on_change('active', lambda attr, old, new: handler(new)) | [
"Set",
"up",
"a",
"handler",
"for",
"button",
"state",
"changes",
"(",
"clicks",
")",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/widgets/buttons.py#L129-L139 | [
"def",
"on_click",
"(",
"self",
",",
"handler",
")",
":",
"self",
".",
"on_change",
"(",
"'active'",
",",
"lambda",
"attr",
",",
"old",
",",
"new",
":",
"handler",
"(",
"new",
")",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Dropdown.on_click | Set up a handler for button or menu item clicks.
Args:
handler (func) : handler function to call when button is activated.
Returns:
None | bokeh/models/widgets/buttons.py | def on_click(self, handler):
''' Set up a handler for button or menu item clicks.
Args:
handler (func) : handler function to call when button is activated.
Returns:
None
'''
self.on_event(ButtonClick, handler)
self.on_event(MenuItemClick, handle... | def on_click(self, handler):
''' Set up a handler for button or menu item clicks.
Args:
handler (func) : handler function to call when button is activated.
Returns:
None
'''
self.on_event(ButtonClick, handler)
self.on_event(MenuItemClick, handle... | [
"Set",
"up",
"a",
"handler",
"for",
"button",
"or",
"menu",
"item",
"clicks",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/widgets/buttons.py#L160-L171 | [
"def",
"on_click",
"(",
"self",
",",
"handler",
")",
":",
"self",
".",
"on_event",
"(",
"ButtonClick",
",",
"handler",
")",
"self",
".",
"on_event",
"(",
"MenuItemClick",
",",
"handler",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Dropdown.js_on_click | Set up a JavaScript handler for button or menu item clicks. | bokeh/models/widgets/buttons.py | def js_on_click(self, handler):
''' Set up a JavaScript handler for button or menu item clicks. '''
self.js_on_event(ButtonClick, handler)
self.js_on_event(MenuItemClick, handler) | def js_on_click(self, handler):
''' Set up a JavaScript handler for button or menu item clicks. '''
self.js_on_event(ButtonClick, handler)
self.js_on_event(MenuItemClick, handler) | [
"Set",
"up",
"a",
"JavaScript",
"handler",
"for",
"button",
"or",
"menu",
"item",
"clicks",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/widgets/buttons.py#L173-L176 | [
"def",
"js_on_click",
"(",
"self",
",",
"handler",
")",
":",
"self",
".",
"js_on_event",
"(",
"ButtonClick",
",",
"handler",
")",
"self",
".",
"js_on_event",
"(",
"MenuItemClick",
",",
"handler",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | import_optional | Attempt to import an optional dependency.
Silently returns None if the requested module is not available.
Args:
mod_name (str) : name of the optional module to try to import
Returns:
imported module or None, if import fails | bokeh/util/dependencies.py | def import_optional(mod_name):
''' Attempt to import an optional dependency.
Silently returns None if the requested module is not available.
Args:
mod_name (str) : name of the optional module to try to import
Returns:
imported module or None, if import fails
'''
try:
... | def import_optional(mod_name):
''' Attempt to import an optional dependency.
Silently returns None if the requested module is not available.
Args:
mod_name (str) : name of the optional module to try to import
Returns:
imported module or None, if import fails
'''
try:
... | [
"Attempt",
"to",
"import",
"an",
"optional",
"dependency",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/dependencies.py#L50-L68 | [
"def",
"import_optional",
"(",
"mod_name",
")",
":",
"try",
":",
"return",
"import_module",
"(",
"mod_name",
")",
"except",
"ImportError",
":",
"pass",
"except",
"Exception",
":",
"msg",
"=",
"\"Failed to import optional module `{}`\"",
".",
"format",
"(",
"mod_na... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | detect_phantomjs | Detect if PhantomJS is avaiable in PATH, at a minimum version.
Args:
version (str, optional) :
Required minimum version for PhantomJS (mostly for testing)
Returns:
str, path to PhantomJS | bokeh/util/dependencies.py | def detect_phantomjs(version='2.1'):
''' Detect if PhantomJS is avaiable in PATH, at a minimum version.
Args:
version (str, optional) :
Required minimum version for PhantomJS (mostly for testing)
Returns:
str, path to PhantomJS
'''
if settings.phantomjs_path() is not N... | def detect_phantomjs(version='2.1'):
''' Detect if PhantomJS is avaiable in PATH, at a minimum version.
Args:
version (str, optional) :
Required minimum version for PhantomJS (mostly for testing)
Returns:
str, path to PhantomJS
'''
if settings.phantomjs_path() is not N... | [
"Detect",
"if",
"PhantomJS",
"is",
"avaiable",
"in",
"PATH",
"at",
"a",
"minimum",
"version",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/dependencies.py#L91-L128 | [
"def",
"detect_phantomjs",
"(",
"version",
"=",
"'2.1'",
")",
":",
"if",
"settings",
".",
"phantomjs_path",
"(",
")",
"is",
"not",
"None",
":",
"phantomjs_path",
"=",
"settings",
".",
"phantomjs_path",
"(",
")",
"else",
":",
"if",
"hasattr",
"(",
"shutil",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Receiver.consume | Consume individual protocol message fragments.
Args:
fragment (``JSON``) :
A message fragment to assemble. When a complete message is
assembled, the receiver state will reset to begin consuming a
new message. | bokeh/protocol/receiver.py | def consume(self, fragment):
''' Consume individual protocol message fragments.
Args:
fragment (``JSON``) :
A message fragment to assemble. When a complete message is
assembled, the receiver state will reset to begin consuming a
new message.
... | def consume(self, fragment):
''' Consume individual protocol message fragments.
Args:
fragment (``JSON``) :
A message fragment to assemble. When a complete message is
assembled, the receiver state will reset to begin consuming a
new message.
... | [
"Consume",
"individual",
"protocol",
"message",
"fragments",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/protocol/receiver.py#L108-L119 | [
"def",
"consume",
"(",
"self",
",",
"fragment",
")",
":",
"self",
".",
"_current_consumer",
"(",
"fragment",
")",
"raise",
"gen",
".",
"Return",
"(",
"self",
".",
"_message",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | setup | Required Sphinx extension setup function. | bokeh/sphinxext/bokeh_autodoc.py | def setup(app):
''' Required Sphinx extension setup function. '''
app.add_autodocumenter(ColorDocumenter)
app.add_autodocumenter(EnumDocumenter)
app.add_autodocumenter(PropDocumenter)
app.add_autodocumenter(ModelDocumenter) | def setup(app):
''' Required Sphinx extension setup function. '''
app.add_autodocumenter(ColorDocumenter)
app.add_autodocumenter(EnumDocumenter)
app.add_autodocumenter(PropDocumenter)
app.add_autodocumenter(ModelDocumenter) | [
"Required",
"Sphinx",
"extension",
"setup",
"function",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_autodoc.py#L107-L112 | [
"def",
"setup",
"(",
"app",
")",
":",
"app",
".",
"add_autodocumenter",
"(",
"ColorDocumenter",
")",
"app",
".",
"add_autodocumenter",
"(",
"EnumDocumenter",
")",
"app",
".",
"add_autodocumenter",
"(",
"PropDocumenter",
")",
"app",
".",
"add_autodocumenter",
"("... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | bounce | Return a driver function that can advance a "bounced" sequence
of values.
.. code-block:: none
seq = [0, 1, 2, 3]
# bounce(seq) => [0, 1, 2, 3, 3, 2, 1, 0, 0, 1, 2, ...]
Args:
sequence (seq) : a sequence of values for the driver to bounce | bokeh/driving.py | def bounce(sequence):
''' Return a driver function that can advance a "bounced" sequence
of values.
.. code-block:: none
seq = [0, 1, 2, 3]
# bounce(seq) => [0, 1, 2, 3, 3, 2, 1, 0, 0, 1, 2, ...]
Args:
sequence (seq) : a sequence of values for the driver to bounce
'''
... | def bounce(sequence):
''' Return a driver function that can advance a "bounced" sequence
of values.
.. code-block:: none
seq = [0, 1, 2, 3]
# bounce(seq) => [0, 1, 2, 3, 3, 2, 1, 0, 0, 1, 2, ...]
Args:
sequence (seq) : a sequence of values for the driver to bounce
'''
... | [
"Return",
"a",
"driver",
"function",
"that",
"can",
"advance",
"a",
"bounced",
"sequence",
"of",
"values",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/driving.py#L73-L94 | [
"def",
"bounce",
"(",
"sequence",
")",
":",
"N",
"=",
"len",
"(",
"sequence",
")",
"def",
"f",
"(",
"i",
")",
":",
"div",
",",
"mod",
"=",
"divmod",
"(",
"i",
",",
"N",
")",
"if",
"div",
"%",
"2",
"==",
"0",
":",
"return",
"sequence",
"[",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | cosine | Return a driver function that can advance a sequence of cosine values.
.. code-block:: none
value = A * cos(w*i + phi) + offset
Args:
w (float) : a frequency for the cosine driver
A (float) : an amplitude for the cosine driver
phi (float) : a phase offset to start the cosine d... | bokeh/driving.py | def cosine(w, A=1, phi=0, offset=0):
''' Return a driver function that can advance a sequence of cosine values.
.. code-block:: none
value = A * cos(w*i + phi) + offset
Args:
w (float) : a frequency for the cosine driver
A (float) : an amplitude for the cosine driver
phi (... | def cosine(w, A=1, phi=0, offset=0):
''' Return a driver function that can advance a sequence of cosine values.
.. code-block:: none
value = A * cos(w*i + phi) + offset
Args:
w (float) : a frequency for the cosine driver
A (float) : an amplitude for the cosine driver
phi (... | [
"Return",
"a",
"driver",
"function",
"that",
"can",
"advance",
"a",
"sequence",
"of",
"cosine",
"values",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/driving.py#L96-L113 | [
"def",
"cosine",
"(",
"w",
",",
"A",
"=",
"1",
",",
"phi",
"=",
"0",
",",
"offset",
"=",
"0",
")",
":",
"from",
"math",
"import",
"cos",
"def",
"f",
"(",
"i",
")",
":",
"return",
"A",
"*",
"cos",
"(",
"w",
"*",
"i",
"+",
"phi",
")",
"+",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | linear | Return a driver function that can advance a sequence of linear values.
.. code-block:: none
value = m * i + b
Args:
m (float) : a slope for the linear driver
x (float) : an offset for the linear driver | bokeh/driving.py | def linear(m=1, b=0):
''' Return a driver function that can advance a sequence of linear values.
.. code-block:: none
value = m * i + b
Args:
m (float) : a slope for the linear driver
x (float) : an offset for the linear driver
'''
def f(i):
return m * i + b
r... | def linear(m=1, b=0):
''' Return a driver function that can advance a sequence of linear values.
.. code-block:: none
value = m * i + b
Args:
m (float) : a slope for the linear driver
x (float) : an offset for the linear driver
'''
def f(i):
return m * i + b
r... | [
"Return",
"a",
"driver",
"function",
"that",
"can",
"advance",
"a",
"sequence",
"of",
"linear",
"values",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/driving.py#L137-L151 | [
"def",
"linear",
"(",
"m",
"=",
"1",
",",
"b",
"=",
"0",
")",
":",
"def",
"f",
"(",
"i",
")",
":",
"return",
"m",
"*",
"i",
"+",
"b",
"return",
"partial",
"(",
"force",
",",
"sequence",
"=",
"_advance",
"(",
"f",
")",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | repeat | Return a driver function that can advance a repeated of values.
.. code-block:: none
seq = [0, 1, 2, 3]
# repeat(seq) => [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, ...]
Args:
sequence (seq) : a sequence of values for the driver to bounce | bokeh/driving.py | def repeat(sequence):
''' Return a driver function that can advance a repeated of values.
.. code-block:: none
seq = [0, 1, 2, 3]
# repeat(seq) => [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, ...]
Args:
sequence (seq) : a sequence of values for the driver to bounce
'''
N = len(sequenc... | def repeat(sequence):
''' Return a driver function that can advance a repeated of values.
.. code-block:: none
seq = [0, 1, 2, 3]
# repeat(seq) => [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, ...]
Args:
sequence (seq) : a sequence of values for the driver to bounce
'''
N = len(sequenc... | [
"Return",
"a",
"driver",
"function",
"that",
"can",
"advance",
"a",
"repeated",
"of",
"values",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/driving.py#L153-L169 | [
"def",
"repeat",
"(",
"sequence",
")",
":",
"N",
"=",
"len",
"(",
"sequence",
")",
"def",
"f",
"(",
"i",
")",
":",
"return",
"sequence",
"[",
"i",
"%",
"N",
"]",
"return",
"partial",
"(",
"force",
",",
"sequence",
"=",
"_advance",
"(",
"f",
")",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | sine | Return a driver function that can advance a sequence of sine values.
.. code-block:: none
value = A * sin(w*i + phi) + offset
Args:
w (float) : a frequency for the sine driver
A (float) : an amplitude for the sine driver
phi (float) : a phase offset to start the sine driver wi... | bokeh/driving.py | def sine(w, A=1, phi=0, offset=0):
''' Return a driver function that can advance a sequence of sine values.
.. code-block:: none
value = A * sin(w*i + phi) + offset
Args:
w (float) : a frequency for the sine driver
A (float) : an amplitude for the sine driver
phi (float) :... | def sine(w, A=1, phi=0, offset=0):
''' Return a driver function that can advance a sequence of sine values.
.. code-block:: none
value = A * sin(w*i + phi) + offset
Args:
w (float) : a frequency for the sine driver
A (float) : an amplitude for the sine driver
phi (float) :... | [
"Return",
"a",
"driver",
"function",
"that",
"can",
"advance",
"a",
"sequence",
"of",
"sine",
"values",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/driving.py#L171-L188 | [
"def",
"sine",
"(",
"w",
",",
"A",
"=",
"1",
",",
"phi",
"=",
"0",
",",
"offset",
"=",
"0",
")",
":",
"from",
"math",
"import",
"sin",
"def",
"f",
"(",
"i",
")",
":",
"return",
"A",
"*",
"sin",
"(",
"w",
"*",
"i",
"+",
"phi",
")",
"+",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | setup | Required Sphinx extension setup function. | bokeh/sphinxext/collapsible_code_block.py | def setup(app):
''' Required Sphinx extension setup function. '''
app.add_node(
collapsible_code_block,
html=(
html_visit_collapsible_code_block,
html_depart_collapsible_code_block
)
)
app.add_directive('collapsible-code-block', CollapsibleCodeBlock) | def setup(app):
''' Required Sphinx extension setup function. '''
app.add_node(
collapsible_code_block,
html=(
html_visit_collapsible_code_block,
html_depart_collapsible_code_block
)
)
app.add_directive('collapsible-code-block', CollapsibleCodeBlock) | [
"Required",
"Sphinx",
"extension",
"setup",
"function",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/collapsible_code_block.py#L125-L134 | [
"def",
"setup",
"(",
"app",
")",
":",
"app",
".",
"add_node",
"(",
"collapsible_code_block",
",",
"html",
"=",
"(",
"html_visit_collapsible_code_block",
",",
"html_depart_collapsible_code_block",
")",
")",
"app",
".",
"add_directive",
"(",
"'collapsible-code-block'",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | collect_filtered_models | Collect a duplicate-free list of all other Bokeh models referred to by
this model, or by any of its references, etc, unless filtered-out by the
provided callable.
Iterate over ``input_values`` and descend through their structure
collecting all nested ``Models`` on the go.
Args:
*discard (C... | bokeh/model.py | def collect_filtered_models(discard, *input_values):
''' Collect a duplicate-free list of all other Bokeh models referred to by
this model, or by any of its references, etc, unless filtered-out by the
provided callable.
Iterate over ``input_values`` and descend through their structure
collecting al... | def collect_filtered_models(discard, *input_values):
''' Collect a duplicate-free list of all other Bokeh models referred to by
this model, or by any of its references, etc, unless filtered-out by the
provided callable.
Iterate over ``input_values`` and descend through their structure
collecting al... | [
"Collect",
"a",
"duplicate",
"-",
"free",
"list",
"of",
"all",
"other",
"Bokeh",
"models",
"referred",
"to",
"by",
"this",
"model",
"or",
"by",
"any",
"of",
"its",
"references",
"etc",
"unless",
"filtered",
"-",
"out",
"by",
"the",
"provided",
"callable",
... | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/model.py#L62-L103 | [
"def",
"collect_filtered_models",
"(",
"discard",
",",
"*",
"input_values",
")",
":",
"ids",
"=",
"set",
"(",
"[",
"]",
")",
"collected",
"=",
"[",
"]",
"queued",
"=",
"[",
"]",
"def",
"queue_one",
"(",
"obj",
")",
":",
"if",
"obj",
".",
"id",
"not... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | get_class | Look up a Bokeh model class, given its view model name.
Args:
view_model_name (str) :
A view model name for a Bokeh model to look up
Returns:
Model: the model class corresponding to ``view_model_name``
Raises:
KeyError, if the model cannot be found
Example:
... | bokeh/model.py | def get_class(view_model_name):
''' Look up a Bokeh model class, given its view model name.
Args:
view_model_name (str) :
A view model name for a Bokeh model to look up
Returns:
Model: the model class corresponding to ``view_model_name``
Raises:
KeyError, if the mo... | def get_class(view_model_name):
''' Look up a Bokeh model class, given its view model name.
Args:
view_model_name (str) :
A view model name for a Bokeh model to look up
Returns:
Model: the model class corresponding to ``view_model_name``
Raises:
KeyError, if the mo... | [
"Look",
"up",
"a",
"Bokeh",
"model",
"class",
"given",
"its",
"view",
"model",
"name",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/model.py#L123-L156 | [
"def",
"get_class",
"(",
"view_model_name",
")",
":",
"# in order to look up from the model catalog that MetaModel maintains, it",
"# has to be creates first. These imports ensure that all built-in Bokeh",
"# models are represented in the catalog.",
"from",
".",
"import",
"models",
"models... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _visit_immediate_value_references | Visit all references to another Model without recursing into any
of the child Model; may visit the same Model more than once if
it's referenced more than once. Does not visit the passed-in value. | bokeh/model.py | def _visit_immediate_value_references(value, visitor):
''' Visit all references to another Model without recursing into any
of the child Model; may visit the same Model more than once if
it's referenced more than once. Does not visit the passed-in value.
'''
if isinstance(value, HasProps):
... | def _visit_immediate_value_references(value, visitor):
''' Visit all references to another Model without recursing into any
of the child Model; may visit the same Model more than once if
it's referenced more than once. Does not visit the passed-in value.
'''
if isinstance(value, HasProps):
... | [
"Visit",
"all",
"references",
"to",
"another",
"Model",
"without",
"recursing",
"into",
"any",
"of",
"the",
"child",
"Model",
";",
"may",
"visit",
"the",
"same",
"Model",
"more",
"than",
"once",
"if",
"it",
"s",
"referenced",
"more",
"than",
"once",
".",
... | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/model.py#L822-L833 | [
"def",
"_visit_immediate_value_references",
"(",
"value",
",",
"visitor",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"HasProps",
")",
":",
"for",
"attr",
"in",
"value",
".",
"properties_with_refs",
"(",
")",
":",
"child",
"=",
"getattr",
"(",
"value",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _visit_value_and_its_immediate_references | Recurse down Models, HasProps, and Python containers
The ordering in this function is to optimize performance. We check the
most comomn types (int, float, str) first so that we can quickly return in
the common case. We avoid isinstance and issubclass checks in a couple
places with `type` checks becau... | bokeh/model.py | def _visit_value_and_its_immediate_references(obj, visitor):
''' Recurse down Models, HasProps, and Python containers
The ordering in this function is to optimize performance. We check the
most comomn types (int, float, str) first so that we can quickly return in
the common case. We avoid isinstance ... | def _visit_value_and_its_immediate_references(obj, visitor):
''' Recurse down Models, HasProps, and Python containers
The ordering in this function is to optimize performance. We check the
most comomn types (int, float, str) first so that we can quickly return in
the common case. We avoid isinstance ... | [
"Recurse",
"down",
"Models",
"HasProps",
"and",
"Python",
"containers"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/model.py#L838-L861 | [
"def",
"_visit_value_and_its_immediate_references",
"(",
"obj",
",",
"visitor",
")",
":",
"typ",
"=",
"type",
"(",
"obj",
")",
"if",
"typ",
"in",
"_common_types",
":",
"# short circuit on common base types",
"return",
"if",
"typ",
"is",
"list",
"or",
"issubclass",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Model.ref | A Bokeh protocol "reference" to this model, i.e. a dict of the
form:
.. code-block:: python
{
'type' : << view model name >>
'id' : << unique model id >>
}
Additionally there may be a `subtype` field if this model is a subtype. | bokeh/model.py | def ref(self):
''' A Bokeh protocol "reference" to this model, i.e. a dict of the
form:
.. code-block:: python
{
'type' : << view model name >>
'id' : << unique model id >>
}
Additionally there may be a `subtype` field if this ... | def ref(self):
''' A Bokeh protocol "reference" to this model, i.e. a dict of the
form:
.. code-block:: python
{
'type' : << view model name >>
'id' : << unique model id >>
}
Additionally there may be a `subtype` field if this ... | [
"A",
"Bokeh",
"protocol",
"reference",
"to",
"this",
"model",
"i",
".",
"e",
".",
"a",
"dict",
"of",
"the",
"form",
":"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/model.py#L407-L431 | [
"def",
"ref",
"(",
"self",
")",
":",
"if",
"\"__subtype__\"",
"in",
"self",
".",
"__class__",
".",
"__dict__",
":",
"return",
"{",
"'type'",
":",
"self",
".",
"__view_model__",
",",
"'subtype'",
":",
"self",
".",
"__subtype__",
",",
"'id'",
":",
"self",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Model.js_link | Link two Bokeh model properties using JavaScript.
This is a convenience method that simplifies adding a CustomJS callback
to update one Bokeh model property whenever another changes value.
Args:
attr (str) :
The name of a Bokeh property on this model
o... | bokeh/model.py | def js_link(self, attr, other, other_attr):
''' Link two Bokeh model properties using JavaScript.
This is a convenience method that simplifies adding a CustomJS callback
to update one Bokeh model property whenever another changes value.
Args:
attr (str) :
T... | def js_link(self, attr, other, other_attr):
''' Link two Bokeh model properties using JavaScript.
This is a convenience method that simplifies adding a CustomJS callback
to update one Bokeh model property whenever another changes value.
Args:
attr (str) :
T... | [
"Link",
"two",
"Bokeh",
"model",
"properties",
"using",
"JavaScript",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/model.py#L449-L504 | [
"def",
"js_link",
"(",
"self",
",",
"attr",
",",
"other",
",",
"other_attr",
")",
":",
"if",
"attr",
"not",
"in",
"self",
".",
"properties",
"(",
")",
":",
"raise",
"ValueError",
"(",
"\"%r is not a property of self (%r)\"",
"%",
"(",
"attr",
",",
"self",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Model.js_on_change | Attach a ``CustomJS`` callback to an arbitrary BokehJS model event.
On the BokehJS side, change events for model properties have the
form ``"change:property_name"``. As a convenience, if the event name
passed to this method is also the name of a property on the model,
then it will be pr... | bokeh/model.py | def js_on_change(self, event, *callbacks):
''' Attach a ``CustomJS`` callback to an arbitrary BokehJS model event.
On the BokehJS side, change events for model properties have the
form ``"change:property_name"``. As a convenience, if the event name
passed to this method is also the name... | def js_on_change(self, event, *callbacks):
''' Attach a ``CustomJS`` callback to an arbitrary BokehJS model event.
On the BokehJS side, change events for model properties have the
form ``"change:property_name"``. As a convenience, if the event name
passed to this method is also the name... | [
"Attach",
"a",
"CustomJS",
"callback",
"to",
"an",
"arbitrary",
"BokehJS",
"model",
"event",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/model.py#L506-L546 | [
"def",
"js_on_change",
"(",
"self",
",",
"event",
",",
"*",
"callbacks",
")",
":",
"if",
"len",
"(",
"callbacks",
")",
"==",
"0",
":",
"raise",
"ValueError",
"(",
"\"js_on_change takes an event name and one or more callbacks, got only one parameter\"",
")",
"# handle ... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Model.on_change | Add a callback on this object to trigger when ``attr`` changes.
Args:
attr (str) : an attribute name on this object
*callbacks (callable) : callback functions to register
Returns:
None
Example:
.. code-block:: python
widget.on_change('... | bokeh/model.py | def on_change(self, attr, *callbacks):
''' Add a callback on this object to trigger when ``attr`` changes.
Args:
attr (str) : an attribute name on this object
*callbacks (callable) : callback functions to register
Returns:
None
Example:
.. ... | def on_change(self, attr, *callbacks):
''' Add a callback on this object to trigger when ``attr`` changes.
Args:
attr (str) : an attribute name on this object
*callbacks (callable) : callback functions to register
Returns:
None
Example:
.. ... | [
"Add",
"a",
"callback",
"on",
"this",
"object",
"to",
"trigger",
"when",
"attr",
"changes",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/model.py#L557-L576 | [
"def",
"on_change",
"(",
"self",
",",
"attr",
",",
"*",
"callbacks",
")",
":",
"if",
"attr",
"not",
"in",
"self",
".",
"properties",
"(",
")",
":",
"raise",
"ValueError",
"(",
"\"attempted to add a callback on nonexistent %s.%s property\"",
"%",
"(",
"self",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Model.set_select | Update objects that match a given selector with the specified
attribute/value updates.
Args:
selector (JSON-like) :
updates (dict) :
Returns:
None | bokeh/model.py | def set_select(self, selector, updates):
''' Update objects that match a given selector with the specified
attribute/value updates.
Args:
selector (JSON-like) :
updates (dict) :
Returns:
None
'''
for obj in self.select(selector):
... | def set_select(self, selector, updates):
''' Update objects that match a given selector with the specified
attribute/value updates.
Args:
selector (JSON-like) :
updates (dict) :
Returns:
None
'''
for obj in self.select(selector):
... | [
"Update",
"objects",
"that",
"match",
"a",
"given",
"selector",
"with",
"the",
"specified",
"attribute",
"/",
"value",
"updates",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/model.py#L614-L628 | [
"def",
"set_select",
"(",
"self",
",",
"selector",
",",
"updates",
")",
":",
"for",
"obj",
"in",
"self",
".",
"select",
"(",
"selector",
")",
":",
"for",
"key",
",",
"val",
"in",
"updates",
".",
"items",
"(",
")",
":",
"setattr",
"(",
"obj",
",",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Model.to_json_string | Returns a JSON string encoding the attributes of this object.
References to other objects are serialized as references
(just the object ID and type info), so the deserializer
will need to separately have the full attributes of those
other objects.
There's no corresponding ``fro... | bokeh/model.py | def to_json_string(self, include_defaults):
''' Returns a JSON string encoding the attributes of this object.
References to other objects are serialized as references
(just the object ID and type info), so the deserializer
will need to separately have the full attributes of those
... | def to_json_string(self, include_defaults):
''' Returns a JSON string encoding the attributes of this object.
References to other objects are serialized as references
(just the object ID and type info), so the deserializer
will need to separately have the full attributes of those
... | [
"Returns",
"a",
"JSON",
"string",
"encoding",
"the",
"attributes",
"of",
"this",
"object",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/model.py#L654-L679 | [
"def",
"to_json_string",
"(",
"self",
",",
"include_defaults",
")",
":",
"json_like",
"=",
"self",
".",
"_to_json_like",
"(",
"include_defaults",
"=",
"include_defaults",
")",
"json_like",
"[",
"'id'",
"]",
"=",
"self",
".",
"id",
"# serialize_json \"fixes\" the J... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Model._attach_document | Attach a model to a Bokeh |Document|.
This private interface should only ever called by the Document
implementation to set the private ._document field properly | bokeh/model.py | def _attach_document(self, doc):
''' Attach a model to a Bokeh |Document|.
This private interface should only ever called by the Document
implementation to set the private ._document field properly
'''
if self._document is not None and self._document is not doc:
rai... | def _attach_document(self, doc):
''' Attach a model to a Bokeh |Document|.
This private interface should only ever called by the Document
implementation to set the private ._document field properly
'''
if self._document is not None and self._document is not doc:
rai... | [
"Attach",
"a",
"model",
"to",
"a",
"Bokeh",
"|Document|",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/model.py#L704-L715 | [
"def",
"_attach_document",
"(",
"self",
",",
"doc",
")",
":",
"if",
"self",
".",
"_document",
"is",
"not",
"None",
"and",
"self",
".",
"_document",
"is",
"not",
"doc",
":",
"raise",
"RuntimeError",
"(",
"\"Models must be owned by only a single document, %r is alre... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Model._to_json_like | Returns a dictionary of the attributes of this object, in
a layout corresponding to what BokehJS expects at unmarshalling time.
This method does not convert "Bokeh types" into "plain JSON types,"
for example each child Model will still be a Model, rather
than turning into a reference, n... | bokeh/model.py | def _to_json_like(self, include_defaults):
''' Returns a dictionary of the attributes of this object, in
a layout corresponding to what BokehJS expects at unmarshalling time.
This method does not convert "Bokeh types" into "plain JSON types,"
for example each child Model will still be a... | def _to_json_like(self, include_defaults):
''' Returns a dictionary of the attributes of this object, in
a layout corresponding to what BokehJS expects at unmarshalling time.
This method does not convert "Bokeh types" into "plain JSON types,"
for example each child Model will still be a... | [
"Returns",
"a",
"dictionary",
"of",
"the",
"attributes",
"of",
"this",
"object",
"in",
"a",
"layout",
"corresponding",
"to",
"what",
"BokehJS",
"expects",
"at",
"unmarshalling",
"time",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/model.py#L734-L777 | [
"def",
"_to_json_like",
"(",
"self",
",",
"include_defaults",
")",
":",
"all_attrs",
"=",
"self",
".",
"properties_with_values",
"(",
"include_defaults",
"=",
"include_defaults",
")",
"# If __subtype__ is defined, then this model may introduce properties",
"# that don't exist o... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | gmap | Create a new :class:`~bokeh.plotting.gmap.GMap` for plotting.
Args:
google_api_key (str):
Google requires an API key be supplied for maps to function. See:
https://developers.google.com/maps/documentation/javascript/get-api-key
map_options: (GMapOptions)
Config... | bokeh/plotting/gmap.py | def gmap(google_api_key, map_options, **kwargs):
''' Create a new :class:`~bokeh.plotting.gmap.GMap` for plotting.
Args:
google_api_key (str):
Google requires an API key be supplied for maps to function. See:
https://developers.google.com/maps/documentation/javascript/get-api-k... | def gmap(google_api_key, map_options, **kwargs):
''' Create a new :class:`~bokeh.plotting.gmap.GMap` for plotting.
Args:
google_api_key (str):
Google requires an API key be supplied for maps to function. See:
https://developers.google.com/maps/documentation/javascript/get-api-k... | [
"Create",
"a",
"new",
":",
"class",
":",
"~bokeh",
".",
"plotting",
".",
"gmap",
".",
"GMap",
"for",
"plotting",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/plotting/gmap.py#L180-L204 | [
"def",
"gmap",
"(",
"google_api_key",
",",
"map_options",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"GMap",
"(",
"api_key",
"=",
"google_api_key",
",",
"map_options",
"=",
"map_options",
",",
"*",
"*",
"kwargs",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | HSL.copy | Return a copy of this color value.
Returns:
HSL | bokeh/colors/hsl.py | def copy(self):
''' Return a copy of this color value.
Returns:
HSL
'''
return HSL(self.h, self.s, self.l, self.a) | def copy(self):
''' Return a copy of this color value.
Returns:
HSL
'''
return HSL(self.h, self.s, self.l, self.a) | [
"Return",
"a",
"copy",
"of",
"this",
"color",
"value",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/colors/hsl.py#L73-L80 | [
"def",
"copy",
"(",
"self",
")",
":",
"return",
"HSL",
"(",
"self",
".",
"h",
",",
"self",
".",
"s",
",",
"self",
".",
"l",
",",
"self",
".",
"a",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | HSL.to_css | Generate the CSS representation of this HSL color.
Returns:
str, ``"hsl(...)"`` or ``"hsla(...)"`` | bokeh/colors/hsl.py | def to_css(self):
''' Generate the CSS representation of this HSL color.
Returns:
str, ``"hsl(...)"`` or ``"hsla(...)"``
'''
if self.a == 1.0:
return "hsl(%d, %s%%, %s%%)" % (self.h, self.s*100, self.l*100)
else:
return "hsla(%d, %s%%, %s%%, ... | def to_css(self):
''' Generate the CSS representation of this HSL color.
Returns:
str, ``"hsl(...)"`` or ``"hsla(...)"``
'''
if self.a == 1.0:
return "hsl(%d, %s%%, %s%%)" % (self.h, self.s*100, self.l*100)
else:
return "hsla(%d, %s%%, %s%%, ... | [
"Generate",
"the",
"CSS",
"representation",
"of",
"this",
"HSL",
"color",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/colors/hsl.py#L110-L120 | [
"def",
"to_css",
"(",
"self",
")",
":",
"if",
"self",
".",
"a",
"==",
"1.0",
":",
"return",
"\"hsl(%d, %s%%, %s%%)\"",
"%",
"(",
"self",
".",
"h",
",",
"self",
".",
"s",
"*",
"100",
",",
"self",
".",
"l",
"*",
"100",
")",
"else",
":",
"return",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | HSL.to_rgb | Return a corresponding :class:`~bokeh.colors.rgb.RGB` color for
this HSL color.
Returns:
HSL | bokeh/colors/hsl.py | def to_rgb(self):
''' Return a corresponding :class:`~bokeh.colors.rgb.RGB` color for
this HSL color.
Returns:
HSL
'''
from .rgb import RGB # prevent circular import
r, g, b = colorsys.hls_to_rgb(float(self.h)/360, self.l, self.s)
return RGB(round(r*... | def to_rgb(self):
''' Return a corresponding :class:`~bokeh.colors.rgb.RGB` color for
this HSL color.
Returns:
HSL
'''
from .rgb import RGB # prevent circular import
r, g, b = colorsys.hls_to_rgb(float(self.h)/360, self.l, self.s)
return RGB(round(r*... | [
"Return",
"a",
"corresponding",
":",
"class",
":",
"~bokeh",
".",
"colors",
".",
"rgb",
".",
"RGB",
"color",
"for",
"this",
"HSL",
"color",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/colors/hsl.py#L131-L141 | [
"def",
"to_rgb",
"(",
"self",
")",
":",
"from",
".",
"rgb",
"import",
"RGB",
"# prevent circular import",
"r",
",",
"g",
",",
"b",
"=",
"colorsys",
".",
"hls_to_rgb",
"(",
"float",
"(",
"self",
".",
"h",
")",
"/",
"360",
",",
"self",
".",
"l",
",",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | serverdir | Get the location of the server subpackage | bokeh/util/paths.py | def serverdir():
""" Get the location of the server subpackage
"""
path = join(ROOT_DIR, 'server')
path = normpath(path)
if sys.platform == 'cygwin': path = realpath(path)
return path | def serverdir():
""" Get the location of the server subpackage
"""
path = join(ROOT_DIR, 'server')
path = normpath(path)
if sys.platform == 'cygwin': path = realpath(path)
return path | [
"Get",
"the",
"location",
"of",
"the",
"server",
"subpackage"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/paths.py#L44-L50 | [
"def",
"serverdir",
"(",
")",
":",
"path",
"=",
"join",
"(",
"ROOT_DIR",
",",
"'server'",
")",
"path",
"=",
"normpath",
"(",
"path",
")",
"if",
"sys",
".",
"platform",
"==",
"'cygwin'",
":",
"path",
"=",
"realpath",
"(",
"path",
")",
"return",
"path"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | bokehjsdir | Get the location of the bokehjs source files. If dev is True,
the files in bokehjs/build are preferred. Otherwise uses the files
in bokeh/server/static. | bokeh/util/paths.py | def bokehjsdir(dev=False):
""" Get the location of the bokehjs source files. If dev is True,
the files in bokehjs/build are preferred. Otherwise uses the files
in bokeh/server/static.
"""
dir1 = join(ROOT_DIR, '..', 'bokehjs', 'build')
dir2 = join(serverdir(), 'static')
if dev and isdir(dir1... | def bokehjsdir(dev=False):
""" Get the location of the bokehjs source files. If dev is True,
the files in bokehjs/build are preferred. Otherwise uses the files
in bokeh/server/static.
"""
dir1 = join(ROOT_DIR, '..', 'bokehjs', 'build')
dir2 = join(serverdir(), 'static')
if dev and isdir(dir1... | [
"Get",
"the",
"location",
"of",
"the",
"bokehjs",
"source",
"files",
".",
"If",
"dev",
"is",
"True",
"the",
"files",
"in",
"bokehjs",
"/",
"build",
"are",
"preferred",
".",
"Otherwise",
"uses",
"the",
"files",
"in",
"bokeh",
"/",
"server",
"/",
"static",... | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/paths.py#L53-L63 | [
"def",
"bokehjsdir",
"(",
"dev",
"=",
"False",
")",
":",
"dir1",
"=",
"join",
"(",
"ROOT_DIR",
",",
"'..'",
",",
"'bokehjs'",
",",
"'build'",
")",
"dir2",
"=",
"join",
"(",
"serverdir",
"(",
")",
",",
"'static'",
")",
"if",
"dev",
"and",
"isdir",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BaseServer.start | Install the Bokeh Server and its background tasks on a Tornado
``IOLoop``.
This method does *not* block and does *not* affect the state of the
Tornado ``IOLoop`` You must start and stop the loop yourself, i.e.
this method is typically useful when you are already explicitly
mana... | bokeh/server/server.py | def start(self):
''' Install the Bokeh Server and its background tasks on a Tornado
``IOLoop``.
This method does *not* block and does *not* affect the state of the
Tornado ``IOLoop`` You must start and stop the loop yourself, i.e.
this method is typically useful when you are al... | def start(self):
''' Install the Bokeh Server and its background tasks on a Tornado
``IOLoop``.
This method does *not* block and does *not* affect the state of the
Tornado ``IOLoop`` You must start and stop the loop yourself, i.e.
this method is typically useful when you are al... | [
"Install",
"the",
"Bokeh",
"Server",
"and",
"its",
"background",
"tasks",
"on",
"a",
"Tornado",
"IOLoop",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/server.py#L120-L135 | [
"def",
"start",
"(",
"self",
")",
":",
"assert",
"not",
"self",
".",
"_started",
",",
"\"Already started\"",
"self",
".",
"_started",
"=",
"True",
"self",
".",
"_tornado",
".",
"start",
"(",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BaseServer.stop | Stop the Bokeh Server.
This stops and removes all Bokeh Server ``IOLoop`` callbacks, as well
as stops the ``HTTPServer`` that this instance was configured with.
Args:
fast (bool):
Whether to wait for orderly cleanup (default: True)
Returns:
None | bokeh/server/server.py | def stop(self, wait=True):
''' Stop the Bokeh Server.
This stops and removes all Bokeh Server ``IOLoop`` callbacks, as well
as stops the ``HTTPServer`` that this instance was configured with.
Args:
fast (bool):
Whether to wait for orderly cleanup (default: T... | def stop(self, wait=True):
''' Stop the Bokeh Server.
This stops and removes all Bokeh Server ``IOLoop`` callbacks, as well
as stops the ``HTTPServer`` that this instance was configured with.
Args:
fast (bool):
Whether to wait for orderly cleanup (default: T... | [
"Stop",
"the",
"Bokeh",
"Server",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/server.py#L137-L154 | [
"def",
"stop",
"(",
"self",
",",
"wait",
"=",
"True",
")",
":",
"assert",
"not",
"self",
".",
"_stopped",
",",
"\"Already stopped\"",
"self",
".",
"_stopped",
"=",
"True",
"self",
".",
"_tornado",
".",
"stop",
"(",
"wait",
")",
"self",
".",
"_http",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BaseServer.run_until_shutdown | Run the Bokeh Server until shutdown is requested by the user,
either via a Keyboard interrupt (Ctrl-C) or SIGTERM.
Calling this method will start the Tornado ``IOLoop`` and block
all execution in the calling process.
Returns:
None | bokeh/server/server.py | def run_until_shutdown(self):
''' Run the Bokeh Server until shutdown is requested by the user,
either via a Keyboard interrupt (Ctrl-C) or SIGTERM.
Calling this method will start the Tornado ``IOLoop`` and block
all execution in the calling process.
Returns:
None
... | def run_until_shutdown(self):
''' Run the Bokeh Server until shutdown is requested by the user,
either via a Keyboard interrupt (Ctrl-C) or SIGTERM.
Calling this method will start the Tornado ``IOLoop`` and block
all execution in the calling process.
Returns:
None
... | [
"Run",
"the",
"Bokeh",
"Server",
"until",
"shutdown",
"is",
"requested",
"by",
"the",
"user",
"either",
"via",
"a",
"Keyboard",
"interrupt",
"(",
"Ctrl",
"-",
"C",
")",
"or",
"SIGTERM",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/server.py#L167-L187 | [
"def",
"run_until_shutdown",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_started",
":",
"self",
".",
"start",
"(",
")",
"# Install shutdown hooks",
"atexit",
".",
"register",
"(",
"self",
".",
"_atexit",
")",
"signal",
".",
"signal",
"(",
"signal",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BaseServer.get_sessions | Gets all currently active sessions for applications.
Args:
app_path (str, optional) :
The configured application path for the application to return
sessions for. If None, return active sessions for all
applications. (default: None)
Returns:
... | bokeh/server/server.py | def get_sessions(self, app_path=None):
''' Gets all currently active sessions for applications.
Args:
app_path (str, optional) :
The configured application path for the application to return
sessions for. If None, return active sessions for all
... | def get_sessions(self, app_path=None):
''' Gets all currently active sessions for applications.
Args:
app_path (str, optional) :
The configured application path for the application to return
sessions for. If None, return active sessions for all
... | [
"Gets",
"all",
"currently",
"active",
"sessions",
"for",
"applications",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/server.py#L206-L224 | [
"def",
"get_sessions",
"(",
"self",
",",
"app_path",
"=",
"None",
")",
":",
"if",
"app_path",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_tornado",
".",
"get_sessions",
"(",
"app_path",
")",
"all_sessions",
"=",
"[",
"]",
"for",
"path",
"in",
"s... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.