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 | DocumentPatchedEvent.dispatch | Dispatch handling of this event to a receiver.
This method will invoke ``receiver._document_patched`` if it exists. | bokeh/document/events.py | def dispatch(self, receiver):
''' Dispatch handling of this event to a receiver.
This method will invoke ``receiver._document_patched`` if it exists.
'''
super(DocumentPatchedEvent, self).dispatch(receiver)
if hasattr(receiver, '_document_patched'):
receiver._docume... | def dispatch(self, receiver):
''' Dispatch handling of this event to a receiver.
This method will invoke ``receiver._document_patched`` if it exists.
'''
super(DocumentPatchedEvent, self).dispatch(receiver)
if hasattr(receiver, '_document_patched'):
receiver._docume... | [
"Dispatch",
"handling",
"of",
"this",
"event",
"to",
"a",
"receiver",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L118-L126 | [
"def",
"dispatch",
"(",
"self",
",",
"receiver",
")",
":",
"super",
"(",
"DocumentPatchedEvent",
",",
"self",
")",
".",
"dispatch",
"(",
"receiver",
")",
"if",
"hasattr",
"(",
"receiver",
",",
"'_document_patched'",
")",
":",
"receiver",
".",
"_document_patc... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ModelChangedEvent.dispatch | Dispatch handling of this event to a receiver.
This method will invoke ``receiver._document_model_dhanged`` if it
exists. | bokeh/document/events.py | def dispatch(self, receiver):
''' Dispatch handling of this event to a receiver.
This method will invoke ``receiver._document_model_dhanged`` if it
exists.
'''
super(ModelChangedEvent, self).dispatch(receiver)
if hasattr(receiver, '_document_model_changed'):
... | def dispatch(self, receiver):
''' Dispatch handling of this event to a receiver.
This method will invoke ``receiver._document_model_dhanged`` if it
exists.
'''
super(ModelChangedEvent, self).dispatch(receiver)
if hasattr(receiver, '_document_model_changed'):
... | [
"Dispatch",
"handling",
"of",
"this",
"event",
"to",
"a",
"receiver",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L237-L246 | [
"def",
"dispatch",
"(",
"self",
",",
"receiver",
")",
":",
"super",
"(",
"ModelChangedEvent",
",",
"self",
")",
".",
"dispatch",
"(",
"receiver",
")",
"if",
"hasattr",
"(",
"receiver",
",",
"'_document_model_changed'",
")",
":",
"receiver",
".",
"_document_m... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ModelChangedEvent.generate | Create a JSON representation of this event suitable for sending
to clients.
Args:
references (dict[str, Model]) :
If the event requires references to certain models in order to
function, they may be collected here.
**This is an "out" paramete... | bokeh/document/events.py | def generate(self, references, buffers):
''' Create a JSON representation of this event suitable for sending
to clients.
Args:
references (dict[str, Model]) :
If the event requires references to certain models in order to
function, they may be collect... | def generate(self, references, buffers):
''' Create a JSON representation of this event suitable for sending
to clients.
Args:
references (dict[str, Model]) :
If the event requires references to certain models in order to
function, they may be collect... | [
"Create",
"a",
"JSON",
"representation",
"of",
"this",
"event",
"suitable",
"for",
"sending",
"to",
"clients",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L248-L298 | [
"def",
"generate",
"(",
"self",
",",
"references",
",",
"buffers",
")",
":",
"from",
".",
".",
"model",
"import",
"collect_models",
"if",
"self",
".",
"hint",
"is",
"not",
"None",
":",
"return",
"self",
".",
"hint",
".",
"generate",
"(",
"references",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ColumnDataChangedEvent.dispatch | Dispatch handling of this event to a receiver.
This method will invoke ``receiver._column_data_changed`` if it exists. | bokeh/document/events.py | def dispatch(self, receiver):
''' Dispatch handling of this event to a receiver.
This method will invoke ``receiver._column_data_changed`` if it exists.
'''
super(ColumnDataChangedEvent, self).dispatch(receiver)
if hasattr(receiver, '_column_data_changed'):
receiver... | def dispatch(self, receiver):
''' Dispatch handling of this event to a receiver.
This method will invoke ``receiver._column_data_changed`` if it exists.
'''
super(ColumnDataChangedEvent, self).dispatch(receiver)
if hasattr(receiver, '_column_data_changed'):
receiver... | [
"Dispatch",
"handling",
"of",
"this",
"event",
"to",
"a",
"receiver",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L337-L345 | [
"def",
"dispatch",
"(",
"self",
",",
"receiver",
")",
":",
"super",
"(",
"ColumnDataChangedEvent",
",",
"self",
")",
".",
"dispatch",
"(",
"receiver",
")",
"if",
"hasattr",
"(",
"receiver",
",",
"'_column_data_changed'",
")",
":",
"receiver",
".",
"_column_d... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ColumnDataChangedEvent.generate | Create a JSON representation of this event suitable for sending
to clients.
.. code-block:: python
{
'kind' : 'ColumnDataChanged'
'column_source' : <reference to a CDS>
'new' : <new data to steam to column_source>
... | bokeh/document/events.py | def generate(self, references, buffers):
''' Create a JSON representation of this event suitable for sending
to clients.
.. code-block:: python
{
'kind' : 'ColumnDataChanged'
'column_source' : <reference to a CDS>
'new' ... | def generate(self, references, buffers):
''' Create a JSON representation of this event suitable for sending
to clients.
.. code-block:: python
{
'kind' : 'ColumnDataChanged'
'column_source' : <reference to a CDS>
'new' ... | [
"Create",
"a",
"JSON",
"representation",
"of",
"this",
"event",
"suitable",
"for",
"sending",
"to",
"clients",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L347-L384 | [
"def",
"generate",
"(",
"self",
",",
"references",
",",
"buffers",
")",
":",
"from",
".",
".",
"util",
".",
"serialization",
"import",
"transform_column_source_data",
"data_dict",
"=",
"transform_column_source_data",
"(",
"self",
".",
"column_source",
".",
"data",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ColumnsStreamedEvent.dispatch | Dispatch handling of this event to a receiver.
This method will invoke ``receiver._columns_streamed`` if it exists. | bokeh/document/events.py | def dispatch(self, receiver):
''' Dispatch handling of this event to a receiver.
This method will invoke ``receiver._columns_streamed`` if it exists.
'''
super(ColumnsStreamedEvent, self).dispatch(receiver)
if hasattr(receiver, '_columns_streamed'):
receiver._column... | def dispatch(self, receiver):
''' Dispatch handling of this event to a receiver.
This method will invoke ``receiver._columns_streamed`` if it exists.
'''
super(ColumnsStreamedEvent, self).dispatch(receiver)
if hasattr(receiver, '_columns_streamed'):
receiver._column... | [
"Dispatch",
"handling",
"of",
"this",
"event",
"to",
"a",
"receiver",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L434-L442 | [
"def",
"dispatch",
"(",
"self",
",",
"receiver",
")",
":",
"super",
"(",
"ColumnsStreamedEvent",
",",
"self",
")",
".",
"dispatch",
"(",
"receiver",
")",
"if",
"hasattr",
"(",
"receiver",
",",
"'_columns_streamed'",
")",
":",
"receiver",
".",
"_columns_strea... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ColumnsStreamedEvent.generate | Create a JSON representation of this event suitable for sending
to clients.
.. code-block:: python
{
'kind' : 'ColumnsStreamed'
'column_source' : <reference to a CDS>
'data' : <new data to steam to column_source>
... | bokeh/document/events.py | def generate(self, references, buffers):
''' Create a JSON representation of this event suitable for sending
to clients.
.. code-block:: python
{
'kind' : 'ColumnsStreamed'
'column_source' : <reference to a CDS>
'data' ... | def generate(self, references, buffers):
''' Create a JSON representation of this event suitable for sending
to clients.
.. code-block:: python
{
'kind' : 'ColumnsStreamed'
'column_source' : <reference to a CDS>
'data' ... | [
"Create",
"a",
"JSON",
"representation",
"of",
"this",
"event",
"suitable",
"for",
"sending",
"to",
"clients",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L444-L476 | [
"def",
"generate",
"(",
"self",
",",
"references",
",",
"buffers",
")",
":",
"return",
"{",
"'kind'",
":",
"'ColumnsStreamed'",
",",
"'column_source'",
":",
"self",
".",
"column_source",
".",
"ref",
",",
"'data'",
":",
"self",
".",
"data",
",",
"'rollover'... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ColumnsPatchedEvent.dispatch | Dispatch handling of this event to a receiver.
This method will invoke ``receiver._columns_patched`` if it exists. | bokeh/document/events.py | def dispatch(self, receiver):
''' Dispatch handling of this event to a receiver.
This method will invoke ``receiver._columns_patched`` if it exists.
'''
super(ColumnsPatchedEvent, self).dispatch(receiver)
if hasattr(receiver, '_columns_patched'):
receiver._columns_p... | def dispatch(self, receiver):
''' Dispatch handling of this event to a receiver.
This method will invoke ``receiver._columns_patched`` if it exists.
'''
super(ColumnsPatchedEvent, self).dispatch(receiver)
if hasattr(receiver, '_columns_patched'):
receiver._columns_p... | [
"Dispatch",
"handling",
"of",
"this",
"event",
"to",
"a",
"receiver",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L513-L521 | [
"def",
"dispatch",
"(",
"self",
",",
"receiver",
")",
":",
"super",
"(",
"ColumnsPatchedEvent",
",",
"self",
")",
".",
"dispatch",
"(",
"receiver",
")",
"if",
"hasattr",
"(",
"receiver",
",",
"'_columns_patched'",
")",
":",
"receiver",
".",
"_columns_patched... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | RootAddedEvent.generate | Create a JSON representation of this event suitable for sending
to clients.
.. code-block:: python
{
'kind' : 'RootAdded'
'title' : <reference to a Model>
}
Args:
references (dict[str, Model]) :
If the event ... | bokeh/document/events.py | def generate(self, references, buffers):
''' Create a JSON representation of this event suitable for sending
to clients.
.. code-block:: python
{
'kind' : 'RootAdded'
'title' : <reference to a Model>
}
Args:
referenc... | def generate(self, references, buffers):
''' Create a JSON representation of this event suitable for sending
to clients.
.. code-block:: python
{
'kind' : 'RootAdded'
'title' : <reference to a Model>
}
Args:
referenc... | [
"Create",
"a",
"JSON",
"representation",
"of",
"this",
"event",
"suitable",
"for",
"sending",
"to",
"clients",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L665-L694 | [
"def",
"generate",
"(",
"self",
",",
"references",
",",
"buffers",
")",
":",
"references",
".",
"update",
"(",
"self",
".",
"model",
".",
"references",
"(",
")",
")",
"return",
"{",
"'kind'",
":",
"'RootAdded'",
",",
"'model'",
":",
"self",
".",
"model... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | SessionCallbackAdded.dispatch | Dispatch handling of this event to a receiver.
This method will invoke ``receiver._session_callback_added`` if
it exists. | bokeh/document/events.py | def dispatch(self, receiver):
''' Dispatch handling of this event to a receiver.
This method will invoke ``receiver._session_callback_added`` if
it exists.
'''
super(SessionCallbackAdded, self).dispatch(receiver)
if hasattr(receiver, '_session_callback_added'):
... | def dispatch(self, receiver):
''' Dispatch handling of this event to a receiver.
This method will invoke ``receiver._session_callback_added`` if
it exists.
'''
super(SessionCallbackAdded, self).dispatch(receiver)
if hasattr(receiver, '_session_callback_added'):
... | [
"Dispatch",
"handling",
"of",
"this",
"event",
"to",
"a",
"receiver",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L779-L788 | [
"def",
"dispatch",
"(",
"self",
",",
"receiver",
")",
":",
"super",
"(",
"SessionCallbackAdded",
",",
"self",
")",
".",
"dispatch",
"(",
"receiver",
")",
"if",
"hasattr",
"(",
"receiver",
",",
"'_session_callback_added'",
")",
":",
"receiver",
".",
"_session... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | SessionCallbackRemoved.dispatch | Dispatch handling of this event to a receiver.
This method will invoke ``receiver._session_callback_removed`` if
it exists. | bokeh/document/events.py | def dispatch(self, receiver):
''' Dispatch handling of this event to a receiver.
This method will invoke ``receiver._session_callback_removed`` if
it exists.
'''
super(SessionCallbackRemoved, self).dispatch(receiver)
if hasattr(receiver, '_session_callback_removed'):
... | def dispatch(self, receiver):
''' Dispatch handling of this event to a receiver.
This method will invoke ``receiver._session_callback_removed`` if
it exists.
'''
super(SessionCallbackRemoved, self).dispatch(receiver)
if hasattr(receiver, '_session_callback_removed'):
... | [
"Dispatch",
"handling",
"of",
"this",
"event",
"to",
"a",
"receiver",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L811-L820 | [
"def",
"dispatch",
"(",
"self",
",",
"receiver",
")",
":",
"super",
"(",
"SessionCallbackRemoved",
",",
"self",
")",
".",
"dispatch",
"(",
"receiver",
")",
"if",
"hasattr",
"(",
"receiver",
",",
"'_session_callback_removed'",
")",
":",
"receiver",
".",
"_ses... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | show_bokehjs | Print a useful report after setuptools output describing where and how
BokehJS is installed.
Args:
bokehjs_action (str) : one of 'built', 'installed', or 'packaged'
how (or if) BokehJS was installed into the python source tree
develop (bool, optional) :
whether the comm... | _setup_support.py | def show_bokehjs(bokehjs_action, develop=False):
''' Print a useful report after setuptools output describing where and how
BokehJS is installed.
Args:
bokehjs_action (str) : one of 'built', 'installed', or 'packaged'
how (or if) BokehJS was installed into the python source tree
... | def show_bokehjs(bokehjs_action, develop=False):
''' Print a useful report after setuptools output describing where and how
BokehJS is installed.
Args:
bokehjs_action (str) : one of 'built', 'installed', or 'packaged'
how (or if) BokehJS was installed into the python source tree
... | [
"Print",
"a",
"useful",
"report",
"after",
"setuptools",
"output",
"describing",
"where",
"and",
"how",
"BokehJS",
"is",
"installed",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L50-L74 | [
"def",
"show_bokehjs",
"(",
"bokehjs_action",
",",
"develop",
"=",
"False",
")",
":",
"print",
"(",
")",
"if",
"develop",
":",
"print",
"(",
"\"Installed Bokeh for DEVELOPMENT:\"",
")",
"else",
":",
"print",
"(",
"\"Installed Bokeh:\"",
")",
"if",
"bokehjs_actio... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | show_help | Print information about extra Bokeh-specific command line options.
Args:
bokehjs_action (str) : one of 'built', 'installed', or 'packaged'
how (or if) BokehJS was installed into the python source tree
Returns:
None | _setup_support.py | def show_help(bokehjs_action):
''' Print information about extra Bokeh-specific command line options.
Args:
bokehjs_action (str) : one of 'built', 'installed', or 'packaged'
how (or if) BokehJS was installed into the python source tree
Returns:
None
'''
print()
if ... | def show_help(bokehjs_action):
''' Print information about extra Bokeh-specific command line options.
Args:
bokehjs_action (str) : one of 'built', 'installed', or 'packaged'
how (or if) BokehJS was installed into the python source tree
Returns:
None
'''
print()
if ... | [
"Print",
"information",
"about",
"extra",
"Bokeh",
"-",
"specific",
"command",
"line",
"options",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L76-L97 | [
"def",
"show_help",
"(",
"bokehjs_action",
")",
":",
"print",
"(",
")",
"if",
"bokehjs_action",
"in",
"[",
"'built'",
",",
"'installed'",
"]",
":",
"print",
"(",
"\"Bokeh-specific options available with 'install' or 'develop':\"",
")",
"print",
"(",
")",
"print",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | build_or_install_bokehjs | Build a new BokehJS (and install it) or install a previously build
BokehJS.
If no options ``--build-js`` or ``--install-js`` are detected, the
user is prompted for what to do.
If ``--existing-js`` is detected, then this setup.py is being run from a
packaged sdist, no action is taken.
Note tha... | _setup_support.py | def build_or_install_bokehjs():
''' Build a new BokehJS (and install it) or install a previously build
BokehJS.
If no options ``--build-js`` or ``--install-js`` are detected, the
user is prompted for what to do.
If ``--existing-js`` is detected, then this setup.py is being run from a
packaged ... | def build_or_install_bokehjs():
''' Build a new BokehJS (and install it) or install a previously build
BokehJS.
If no options ``--build-js`` or ``--install-js`` are detected, the
user is prompted for what to do.
If ``--existing-js`` is detected, then this setup.py is being run from a
packaged ... | [
"Build",
"a",
"new",
"BokehJS",
"(",
"and",
"install",
"it",
")",
"or",
"install",
"a",
"previously",
"build",
"BokehJS",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L103-L151 | [
"def",
"build_or_install_bokehjs",
"(",
")",
":",
"# This happens when building from inside a published, pre-packaged sdist",
"# The --existing-js option is not otherwise documented",
"if",
"'--existing-js'",
"in",
"sys",
".",
"argv",
":",
"sys",
".",
"argv",
".",
"remove",
"("... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | fixup_building_sdist | Check for 'sdist' and ensure we always build BokehJS when packaging
Source distributions do not ship with BokehJS source code, but must ship
with a pre-built BokehJS library. This function modifies ``sys.argv`` as
necessary so that ``--build-js`` IS present, and ``--install-js` is NOT.
Returns:
... | _setup_support.py | def fixup_building_sdist():
''' Check for 'sdist' and ensure we always build BokehJS when packaging
Source distributions do not ship with BokehJS source code, but must ship
with a pre-built BokehJS library. This function modifies ``sys.argv`` as
necessary so that ``--build-js`` IS present, and ``--inst... | def fixup_building_sdist():
''' Check for 'sdist' and ensure we always build BokehJS when packaging
Source distributions do not ship with BokehJS source code, but must ship
with a pre-built BokehJS library. This function modifies ``sys.argv`` as
necessary so that ``--build-js`` IS present, and ``--inst... | [
"Check",
"for",
"sdist",
"and",
"ensure",
"we",
"always",
"build",
"BokehJS",
"when",
"packaging"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L157-L174 | [
"def",
"fixup_building_sdist",
"(",
")",
":",
"if",
"\"sdist\"",
"in",
"sys",
".",
"argv",
":",
"if",
"\"--install-js\"",
"in",
"sys",
".",
"argv",
":",
"print",
"(",
"\"Removing '--install-js' incompatible with 'sdist'\"",
")",
"sys",
".",
"argv",
".",
"remove"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | fixup_for_packaged | If we are installing FROM an sdist, then a pre-built BokehJS is
already installed in the python source tree.
The command line options ``--build-js`` or ``--install-js`` are
removed from ``sys.argv``, with a warning.
Also adds ``--existing-js`` to ``sys.argv`` to signal that BokehJS is
already pack... | _setup_support.py | def fixup_for_packaged():
''' If we are installing FROM an sdist, then a pre-built BokehJS is
already installed in the python source tree.
The command line options ``--build-js`` or ``--install-js`` are
removed from ``sys.argv``, with a warning.
Also adds ``--existing-js`` to ``sys.argv`` to signa... | def fixup_for_packaged():
''' If we are installing FROM an sdist, then a pre-built BokehJS is
already installed in the python source tree.
The command line options ``--build-js`` or ``--install-js`` are
removed from ``sys.argv``, with a warning.
Also adds ``--existing-js`` to ``sys.argv`` to signa... | [
"If",
"we",
"are",
"installing",
"FROM",
"an",
"sdist",
"then",
"a",
"pre",
"-",
"built",
"BokehJS",
"is",
"already",
"installed",
"in",
"the",
"python",
"source",
"tree",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L176-L198 | [
"def",
"fixup_for_packaged",
"(",
")",
":",
"if",
"exists",
"(",
"join",
"(",
"ROOT",
",",
"'PKG-INFO'",
")",
")",
":",
"if",
"\"--build-js\"",
"in",
"sys",
".",
"argv",
"or",
"\"--install-js\"",
"in",
"sys",
".",
"argv",
":",
"print",
"(",
"SDIST_BUILD_... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | get_cmdclass | A ``cmdclass`` that works around a setuptools deficiency.
There is no need to build wheels when installing a package, however some
versions of setuptools seem to mandate this. This is a hacky workaround
that modifies the ``cmdclass`` returned by versioneer so that not having
wheel installed is not a fa... | _setup_support.py | def get_cmdclass():
''' A ``cmdclass`` that works around a setuptools deficiency.
There is no need to build wheels when installing a package, however some
versions of setuptools seem to mandate this. This is a hacky workaround
that modifies the ``cmdclass`` returned by versioneer so that not having
... | def get_cmdclass():
''' A ``cmdclass`` that works around a setuptools deficiency.
There is no need to build wheels when installing a package, however some
versions of setuptools seem to mandate this. This is a hacky workaround
that modifies the ``cmdclass`` returned by versioneer so that not having
... | [
"A",
"cmdclass",
"that",
"works",
"around",
"a",
"setuptools",
"deficiency",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L203-L223 | [
"def",
"get_cmdclass",
"(",
")",
":",
"cmdclass",
"=",
"versioneer",
".",
"get_cmdclass",
"(",
")",
"try",
":",
"from",
"wheel",
".",
"bdist_wheel",
"import",
"bdist_wheel",
"except",
"ImportError",
":",
"# pip is not claiming for bdist_wheel when wheel is not installed... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | jsbuild_prompt | Prompt users whether to build a new BokehJS or install an existing one.
Returns:
bool : True, if a new build is requested, False otherwise | _setup_support.py | def jsbuild_prompt():
''' Prompt users whether to build a new BokehJS or install an existing one.
Returns:
bool : True, if a new build is requested, False otherwise
'''
print(BOKEHJS_BUILD_PROMPT)
mapping = {"1": True, "2": False}
value = input("Choice? ")
while value not in mappin... | def jsbuild_prompt():
''' Prompt users whether to build a new BokehJS or install an existing one.
Returns:
bool : True, if a new build is requested, False otherwise
'''
print(BOKEHJS_BUILD_PROMPT)
mapping = {"1": True, "2": False}
value = input("Choice? ")
while value not in mappin... | [
"Prompt",
"users",
"whether",
"to",
"build",
"a",
"new",
"BokehJS",
"or",
"install",
"an",
"existing",
"one",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L245-L258 | [
"def",
"jsbuild_prompt",
"(",
")",
":",
"print",
"(",
"BOKEHJS_BUILD_PROMPT",
")",
"mapping",
"=",
"{",
"\"1\"",
":",
"True",
",",
"\"2\"",
":",
"False",
"}",
"value",
"=",
"input",
"(",
"\"Choice? \"",
")",
"while",
"value",
"not",
"in",
"mapping",
":",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | build_js | Build BokehJS files (CSS, JS, etc) under the ``bokehjs`` source
subdirectory.
Also prints a table of statistics about the generated assets (file sizes,
etc.) or any error messages if the build fails.
Note this function only builds BokehJS assets, it does not install them
into the python source tre... | _setup_support.py | def build_js():
''' Build BokehJS files (CSS, JS, etc) under the ``bokehjs`` source
subdirectory.
Also prints a table of statistics about the generated assets (file sizes,
etc.) or any error messages if the build fails.
Note this function only builds BokehJS assets, it does not install them
in... | def build_js():
''' Build BokehJS files (CSS, JS, etc) under the ``bokehjs`` source
subdirectory.
Also prints a table of statistics about the generated assets (file sizes,
etc.) or any error messages if the build fails.
Note this function only builds BokehJS assets, it does not install them
in... | [
"Build",
"BokehJS",
"files",
"(",
"CSS",
"JS",
"etc",
")",
"under",
"the",
"bokehjs",
"source",
"subdirectory",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L264-L338 | [
"def",
"build_js",
"(",
")",
":",
"print",
"(",
"\"Building BokehJS... \"",
",",
"end",
"=",
"\"\"",
")",
"sys",
".",
"stdout",
".",
"flush",
"(",
")",
"os",
".",
"chdir",
"(",
"'bokehjs'",
")",
"cmd",
"=",
"[",
"\"node\"",
",",
"\"make\"",
",",
"'bu... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | install_js | Copy built BokehJS files into the Python source tree.
Returns:
None | _setup_support.py | def install_js():
''' Copy built BokehJS files into the Python source tree.
Returns:
None
'''
target_jsdir = join(SERVER, 'static', 'js')
target_cssdir = join(SERVER, 'static', 'css')
target_tslibdir = join(SERVER, 'static', 'lib')
STATIC_ASSETS = [
join(JS, 'bokeh.js'),
... | def install_js():
''' Copy built BokehJS files into the Python source tree.
Returns:
None
'''
target_jsdir = join(SERVER, 'static', 'js')
target_cssdir = join(SERVER, 'static', 'css')
target_tslibdir = join(SERVER, 'static', 'lib')
STATIC_ASSETS = [
join(JS, 'bokeh.js'),
... | [
"Copy",
"built",
"BokehJS",
"files",
"into",
"the",
"Python",
"source",
"tree",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L340-L381 | [
"def",
"install_js",
"(",
")",
":",
"target_jsdir",
"=",
"join",
"(",
"SERVER",
",",
"'static'",
",",
"'js'",
")",
"target_cssdir",
"=",
"join",
"(",
"SERVER",
",",
"'static'",
",",
"'css'",
")",
"target_tslibdir",
"=",
"join",
"(",
"SERVER",
",",
"'stat... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | axial_to_cartesian | Map axial *(q,r)* coordinates to cartesian *(x,y)* coordinates of
tiles centers.
This function can be useful for positioning other Bokeh glyphs with
cartesian coordinates in relation to a hex tiling.
This function was adapted from:
https://www.redblobgames.com/grids/hexagons/#hex-to-pixel
... | bokeh/util/hex.py | def axial_to_cartesian(q, r, size, orientation, aspect_scale=1):
''' Map axial *(q,r)* coordinates to cartesian *(x,y)* coordinates of
tiles centers.
This function can be useful for positioning other Bokeh glyphs with
cartesian coordinates in relation to a hex tiling.
This function was adapted fro... | def axial_to_cartesian(q, r, size, orientation, aspect_scale=1):
''' Map axial *(q,r)* coordinates to cartesian *(x,y)* coordinates of
tiles centers.
This function can be useful for positioning other Bokeh glyphs with
cartesian coordinates in relation to a hex tiling.
This function was adapted fro... | [
"Map",
"axial",
"*",
"(",
"q",
"r",
")",
"*",
"coordinates",
"to",
"cartesian",
"*",
"(",
"x",
"y",
")",
"*",
"coordinates",
"of",
"tiles",
"centers",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/hex.py#L49-L98 | [
"def",
"axial_to_cartesian",
"(",
"q",
",",
"r",
",",
"size",
",",
"orientation",
",",
"aspect_scale",
"=",
"1",
")",
":",
"if",
"orientation",
"==",
"\"pointytop\"",
":",
"x",
"=",
"size",
"*",
"np",
".",
"sqrt",
"(",
"3",
")",
"*",
"(",
"q",
"+",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | cartesian_to_axial | Map Cartesion *(x,y)* points to axial *(q,r)* coordinates of enclosing
tiles.
This function was adapted from:
https://www.redblobgames.com/grids/hexagons/#pixel-to-hex
Args:
x (array[float]) :
A NumPy array of x-coordinates to convert
y (array[float]) :
A ... | bokeh/util/hex.py | def cartesian_to_axial(x, y, size, orientation, aspect_scale=1):
''' Map Cartesion *(x,y)* points to axial *(q,r)* coordinates of enclosing
tiles.
This function was adapted from:
https://www.redblobgames.com/grids/hexagons/#pixel-to-hex
Args:
x (array[float]) :
A NumPy arr... | def cartesian_to_axial(x, y, size, orientation, aspect_scale=1):
''' Map Cartesion *(x,y)* points to axial *(q,r)* coordinates of enclosing
tiles.
This function was adapted from:
https://www.redblobgames.com/grids/hexagons/#pixel-to-hex
Args:
x (array[float]) :
A NumPy arr... | [
"Map",
"Cartesion",
"*",
"(",
"x",
"y",
")",
"*",
"points",
"to",
"axial",
"*",
"(",
"q",
"r",
")",
"*",
"coordinates",
"of",
"enclosing",
"tiles",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/hex.py#L100-L150 | [
"def",
"cartesian_to_axial",
"(",
"x",
",",
"y",
",",
"size",
",",
"orientation",
",",
"aspect_scale",
"=",
"1",
")",
":",
"HEX_FLAT",
"=",
"[",
"2.0",
"/",
"3.0",
",",
"0.0",
",",
"-",
"1.0",
"/",
"3.0",
",",
"np",
".",
"sqrt",
"(",
"3.0",
")",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | hexbin | Perform an equal-weight binning of data points into hexagonal tiles.
For more sophisticated use cases, e.g. weighted binning or scaling
individual tiles proportional to some other quantity, consider using
HoloViews.
Args:
x (array[float]) :
A NumPy array of x-coordinates for binnin... | bokeh/util/hex.py | def hexbin(x, y, size, orientation="pointytop", aspect_scale=1):
''' Perform an equal-weight binning of data points into hexagonal tiles.
For more sophisticated use cases, e.g. weighted binning or scaling
individual tiles proportional to some other quantity, consider using
HoloViews.
Args:
... | def hexbin(x, y, size, orientation="pointytop", aspect_scale=1):
''' Perform an equal-weight binning of data points into hexagonal tiles.
For more sophisticated use cases, e.g. weighted binning or scaling
individual tiles proportional to some other quantity, consider using
HoloViews.
Args:
... | [
"Perform",
"an",
"equal",
"-",
"weight",
"binning",
"of",
"data",
"points",
"into",
"hexagonal",
"tiles",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/hex.py#L152-L204 | [
"def",
"hexbin",
"(",
"x",
",",
"y",
",",
"size",
",",
"orientation",
"=",
"\"pointytop\"",
",",
"aspect_scale",
"=",
"1",
")",
":",
"pd",
"=",
"import_required",
"(",
"'pandas'",
",",
"'hexbin requires pandas to be installed'",
")",
"q",
",",
"r",
"=",
"c... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _round_hex | Round floating point axial hex coordinates to integer *(q,r)*
coordinates.
This code was adapted from:
https://www.redblobgames.com/grids/hexagons/#rounding
Args:
q (array[float]) :
NumPy array of Floating point axial *q* coordinates to round
r (array[float]) :
... | bokeh/util/hex.py | def _round_hex(q, r):
''' Round floating point axial hex coordinates to integer *(q,r)*
coordinates.
This code was adapted from:
https://www.redblobgames.com/grids/hexagons/#rounding
Args:
q (array[float]) :
NumPy array of Floating point axial *q* coordinates to round
... | def _round_hex(q, r):
''' Round floating point axial hex coordinates to integer *(q,r)*
coordinates.
This code was adapted from:
https://www.redblobgames.com/grids/hexagons/#rounding
Args:
q (array[float]) :
NumPy array of Floating point axial *q* coordinates to round
... | [
"Round",
"floating",
"point",
"axial",
"hex",
"coordinates",
"to",
"integer",
"*",
"(",
"q",
"r",
")",
"*",
"coordinates",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/hex.py#L214-L249 | [
"def",
"_round_hex",
"(",
"q",
",",
"r",
")",
":",
"x",
"=",
"q",
"z",
"=",
"r",
"y",
"=",
"-",
"x",
"-",
"z",
"rx",
"=",
"np",
".",
"round",
"(",
"x",
")",
"ry",
"=",
"np",
".",
"round",
"(",
"y",
")",
"rz",
"=",
"np",
".",
"round",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | versions_from_parentdir | Try to determine the version from the parent directory name.
Source tarballs conventionally unpack into a directory that includes both
the project name and a version string. We will also support searching up
two directory levels for an appropriately named parent directory | versioneer.py | def versions_from_parentdir(parentdir_prefix, root, verbose):
"""Try to determine the version from the parent directory name.
Source tarballs conventionally unpack into a directory that includes both
the project name and a version string. We will also support searching up
two directory levels for an ap... | def versions_from_parentdir(parentdir_prefix, root, verbose):
"""Try to determine the version from the parent directory name.
Source tarballs conventionally unpack into a directory that includes both
the project name and a version string. We will also support searching up
two directory levels for an ap... | [
"Try",
"to",
"determine",
"the",
"version",
"from",
"the",
"parent",
"directory",
"name",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/versioneer.py#L1166-L1188 | [
"def",
"versions_from_parentdir",
"(",
"parentdir_prefix",
",",
"root",
",",
"verbose",
")",
":",
"rootdirs",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"3",
")",
":",
"dirname",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"root",
")",
"if",
"d... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | render_pep440_pre | TAG[.post.devDISTANCE] -- No -dirty.
Exceptions:
1: no tags. 0.post.devDISTANCE | versioneer.py | def render_pep440_pre(pieces):
"""TAG[.post.devDISTANCE] -- No -dirty.
Exceptions:
1: no tags. 0.post.devDISTANCE
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"]:
rendered += ".post.dev%d" % pieces["distance"]
else:
# exce... | def render_pep440_pre(pieces):
"""TAG[.post.devDISTANCE] -- No -dirty.
Exceptions:
1: no tags. 0.post.devDISTANCE
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"]:
rendered += ".post.dev%d" % pieces["distance"]
else:
# exce... | [
"TAG",
"[",
".",
"post",
".",
"devDISTANCE",
"]",
"--",
"No",
"-",
"dirty",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/versioneer.py#L1268-L1281 | [
"def",
"render_pep440_pre",
"(",
"pieces",
")",
":",
"if",
"pieces",
"[",
"\"closest-tag\"",
"]",
":",
"rendered",
"=",
"pieces",
"[",
"\"closest-tag\"",
"]",
"if",
"pieces",
"[",
"\"distance\"",
"]",
":",
"rendered",
"+=",
"\".post.dev%d\"",
"%",
"pieces",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | List.wrap | Some property types need to wrap their values in special containers, etc. | bokeh/core/property/container.py | def wrap(cls, value):
''' Some property types need to wrap their values in special containers, etc.
'''
if isinstance(value, list):
if isinstance(value, PropertyValueList):
return value
else:
return PropertyValueList(value)
else:
... | def wrap(cls, value):
''' Some property types need to wrap their values in special containers, etc.
'''
if isinstance(value, list):
if isinstance(value, PropertyValueList):
return value
else:
return PropertyValueList(value)
else:
... | [
"Some",
"property",
"types",
"need",
"to",
"wrap",
"their",
"values",
"in",
"special",
"containers",
"etc",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/container.py#L124-L134 | [
"def",
"wrap",
"(",
"cls",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"list",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"PropertyValueList",
")",
":",
"return",
"value",
"else",
":",
"return",
"PropertyValueList",
"(",
"value",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | Dict.wrap | Some property types need to wrap their values in special containers, etc. | bokeh/core/property/container.py | def wrap(cls, value):
''' Some property types need to wrap their values in special containers, etc.
'''
if isinstance(value, dict):
if isinstance(value, PropertyValueDict):
return value
else:
return PropertyValueDict(value)
else:
... | def wrap(cls, value):
''' Some property types need to wrap their values in special containers, etc.
'''
if isinstance(value, dict):
if isinstance(value, PropertyValueDict):
return value
else:
return PropertyValueDict(value)
else:
... | [
"Some",
"property",
"types",
"need",
"to",
"wrap",
"their",
"values",
"in",
"special",
"containers",
"etc",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/container.py#L193-L203 | [
"def",
"wrap",
"(",
"cls",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"PropertyValueDict",
")",
":",
"return",
"value",
"else",
":",
"return",
"PropertyValueDict",
"(",
"value",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ColumnData.from_json | Decodes column source data encoded as lists or base64 strings. | bokeh/core/property/container.py | def from_json(self, json, models=None):
''' Decodes column source data encoded as lists or base64 strings.
'''
if json is None:
return None
elif not isinstance(json, dict):
raise DeserializationError("%s expected a dict or None, got %s" % (self, json))
new... | def from_json(self, json, models=None):
''' Decodes column source data encoded as lists or base64 strings.
'''
if json is None:
return None
elif not isinstance(json, dict):
raise DeserializationError("%s expected a dict or None, got %s" % (self, json))
new... | [
"Decodes",
"column",
"source",
"data",
"encoded",
"as",
"lists",
"or",
"base64",
"strings",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/container.py#L234-L257 | [
"def",
"from_json",
"(",
"self",
",",
"json",
",",
"models",
"=",
"None",
")",
":",
"if",
"json",
"is",
"None",
":",
"return",
"None",
"elif",
"not",
"isinstance",
"(",
"json",
",",
"dict",
")",
":",
"raise",
"DeserializationError",
"(",
"\"%s expected a... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | ColumnData.wrap | Some property types need to wrap their values in special containers, etc. | bokeh/core/property/container.py | def wrap(cls, value):
''' Some property types need to wrap their values in special containers, etc.
'''
if isinstance(value, dict):
if isinstance(value, PropertyValueColumnData):
return value
else:
return PropertyValueColumnData(value)
... | def wrap(cls, value):
''' Some property types need to wrap their values in special containers, etc.
'''
if isinstance(value, dict):
if isinstance(value, PropertyValueColumnData):
return value
else:
return PropertyValueColumnData(value)
... | [
"Some",
"property",
"types",
"need",
"to",
"wrap",
"their",
"values",
"in",
"special",
"containers",
"etc",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/container.py#L263-L273 | [
"def",
"wrap",
"(",
"cls",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"PropertyValueColumnData",
")",
":",
"return",
"value",
"else",
":",
"return",
"PropertyValueColumnData",
"("... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | convert_timedelta_type | Convert any recognized timedelta value to floating point absolute
milliseconds.
Arg:
obj (object) : the object to convert
Returns:
float : milliseconds | bokeh/util/serialization.py | def convert_timedelta_type(obj):
''' Convert any recognized timedelta value to floating point absolute
milliseconds.
Arg:
obj (object) : the object to convert
Returns:
float : milliseconds
'''
if isinstance(obj, dt.timedelta):
return obj.total_seconds() * 1000.
eli... | def convert_timedelta_type(obj):
''' Convert any recognized timedelta value to floating point absolute
milliseconds.
Arg:
obj (object) : the object to convert
Returns:
float : milliseconds
'''
if isinstance(obj, dt.timedelta):
return obj.total_seconds() * 1000.
eli... | [
"Convert",
"any",
"recognized",
"timedelta",
"value",
"to",
"floating",
"point",
"absolute",
"milliseconds",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L136-L150 | [
"def",
"convert_timedelta_type",
"(",
"obj",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"dt",
".",
"timedelta",
")",
":",
"return",
"obj",
".",
"total_seconds",
"(",
")",
"*",
"1000.",
"elif",
"isinstance",
"(",
"obj",
",",
"np",
".",
"timedelta64",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | convert_datetime_type | Convert any recognized date, time, or datetime value to floating point
milliseconds since epoch.
Arg:
obj (object) : the object to convert
Returns:
float : milliseconds | bokeh/util/serialization.py | def convert_datetime_type(obj):
''' Convert any recognized date, time, or datetime value to floating point
milliseconds since epoch.
Arg:
obj (object) : the object to convert
Returns:
float : milliseconds
'''
# Pandas NaT
if pd and obj is pd.NaT:
return np.nan
... | def convert_datetime_type(obj):
''' Convert any recognized date, time, or datetime value to floating point
milliseconds since epoch.
Arg:
obj (object) : the object to convert
Returns:
float : milliseconds
'''
# Pandas NaT
if pd and obj is pd.NaT:
return np.nan
... | [
"Convert",
"any",
"recognized",
"date",
"time",
"or",
"datetime",
"value",
"to",
"floating",
"point",
"milliseconds",
"since",
"epoch",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L152-L193 | [
"def",
"convert_datetime_type",
"(",
"obj",
")",
":",
"# Pandas NaT",
"if",
"pd",
"and",
"obj",
"is",
"pd",
".",
"NaT",
":",
"return",
"np",
".",
"nan",
"# Pandas Period",
"if",
"pd",
"and",
"isinstance",
"(",
"obj",
",",
"pd",
".",
"Period",
")",
":",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | convert_datetime_array | Convert NumPy datetime arrays to arrays to milliseconds since epoch.
Args:
array : (obj)
A NumPy array of datetime to convert
If the value passed in is not a NumPy array, it will be returned as-is.
Returns:
array | bokeh/util/serialization.py | def convert_datetime_array(array):
''' Convert NumPy datetime arrays to arrays to milliseconds since epoch.
Args:
array : (obj)
A NumPy array of datetime to convert
If the value passed in is not a NumPy array, it will be returned as-is.
Returns:
array
'''
... | def convert_datetime_array(array):
''' Convert NumPy datetime arrays to arrays to milliseconds since epoch.
Args:
array : (obj)
A NumPy array of datetime to convert
If the value passed in is not a NumPy array, it will be returned as-is.
Returns:
array
'''
... | [
"Convert",
"NumPy",
"datetime",
"arrays",
"to",
"arrays",
"to",
"milliseconds",
"since",
"epoch",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L195-L238 | [
"def",
"convert_datetime_array",
"(",
"array",
")",
":",
"if",
"not",
"isinstance",
"(",
"array",
",",
"np",
".",
"ndarray",
")",
":",
"return",
"array",
"try",
":",
"dt2001",
"=",
"np",
".",
"datetime64",
"(",
"'2001'",
")",
"legacy_datetime64",
"=",
"(... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | make_id | Return a new unique ID for a Bokeh object.
Normally this function will return simple monotonically increasing integer
IDs (as strings) for identifying Bokeh objects within a Document. However,
if it is desirable to have globally unique for every object, this behavior
can be overridden by setting the en... | bokeh/util/serialization.py | def make_id():
''' Return a new unique ID for a Bokeh object.
Normally this function will return simple monotonically increasing integer
IDs (as strings) for identifying Bokeh objects within a Document. However,
if it is desirable to have globally unique for every object, this behavior
can be overr... | def make_id():
''' Return a new unique ID for a Bokeh object.
Normally this function will return simple monotonically increasing integer
IDs (as strings) for identifying Bokeh objects within a Document. However,
if it is desirable to have globally unique for every object, this behavior
can be overr... | [
"Return",
"a",
"new",
"unique",
"ID",
"for",
"a",
"Bokeh",
"object",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L240-L259 | [
"def",
"make_id",
"(",
")",
":",
"global",
"_simple_id",
"if",
"settings",
".",
"simple_ids",
"(",
"True",
")",
":",
"with",
"_simple_id_lock",
":",
"_simple_id",
"+=",
"1",
"return",
"str",
"(",
"_simple_id",
")",
"else",
":",
"return",
"make_globally_uniqu... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | transform_array | Transform a NumPy arrays into serialized format
Converts un-serializable dtypes and returns JSON serializable
format
Args:
array (np.ndarray) : a NumPy array to be transformed
force_list (bool, optional) : whether to only output to standard lists
This function can encode some d... | bokeh/util/serialization.py | def transform_array(array, force_list=False, buffers=None):
''' Transform a NumPy arrays into serialized format
Converts un-serializable dtypes and returns JSON serializable
format
Args:
array (np.ndarray) : a NumPy array to be transformed
force_list (bool, optional) : whether to only ... | def transform_array(array, force_list=False, buffers=None):
''' Transform a NumPy arrays into serialized format
Converts un-serializable dtypes and returns JSON serializable
format
Args:
array (np.ndarray) : a NumPy array to be transformed
force_list (bool, optional) : whether to only ... | [
"Transform",
"a",
"NumPy",
"arrays",
"into",
"serialized",
"format"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L295-L328 | [
"def",
"transform_array",
"(",
"array",
",",
"force_list",
"=",
"False",
",",
"buffers",
"=",
"None",
")",
":",
"array",
"=",
"convert_datetime_array",
"(",
"array",
")",
"return",
"serialize_array",
"(",
"array",
",",
"force_list",
"=",
"force_list",
",",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | transform_array_to_list | Transforms a NumPy array into a list of values
Args:
array (np.nadarray) : the NumPy array series to transform
Returns:
list or dict | bokeh/util/serialization.py | def transform_array_to_list(array):
''' Transforms a NumPy array into a list of values
Args:
array (np.nadarray) : the NumPy array series to transform
Returns:
list or dict
'''
if (array.dtype.kind in ('u', 'i', 'f') and (~np.isfinite(array)).any()):
transformed = array.as... | def transform_array_to_list(array):
''' Transforms a NumPy array into a list of values
Args:
array (np.nadarray) : the NumPy array series to transform
Returns:
list or dict
'''
if (array.dtype.kind in ('u', 'i', 'f') and (~np.isfinite(array)).any()):
transformed = array.as... | [
"Transforms",
"a",
"NumPy",
"array",
"into",
"a",
"list",
"of",
"values"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L330-L350 | [
"def",
"transform_array_to_list",
"(",
"array",
")",
":",
"if",
"(",
"array",
".",
"dtype",
".",
"kind",
"in",
"(",
"'u'",
",",
"'i'",
",",
"'f'",
")",
"and",
"(",
"~",
"np",
".",
"isfinite",
"(",
"array",
")",
")",
".",
"any",
"(",
")",
")",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | transform_series | Transforms a Pandas series into serialized form
Args:
series (pd.Series) : the Pandas series to transform
force_list (bool, optional) : whether to only output to standard lists
This function can encode some dtypes using a binary encoding, but
setting this argument to True wi... | bokeh/util/serialization.py | def transform_series(series, force_list=False, buffers=None):
''' Transforms a Pandas series into serialized form
Args:
series (pd.Series) : the Pandas series to transform
force_list (bool, optional) : whether to only output to standard lists
This function can encode some dtypes usi... | def transform_series(series, force_list=False, buffers=None):
''' Transforms a Pandas series into serialized form
Args:
series (pd.Series) : the Pandas series to transform
force_list (bool, optional) : whether to only output to standard lists
This function can encode some dtypes usi... | [
"Transforms",
"a",
"Pandas",
"series",
"into",
"serialized",
"form"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L352-L384 | [
"def",
"transform_series",
"(",
"series",
",",
"force_list",
"=",
"False",
",",
"buffers",
"=",
"None",
")",
":",
"# not checking for pd here, this function should only be called if it",
"# is already known that series is a Pandas Series type",
"if",
"isinstance",
"(",
"series"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | serialize_array | Transforms a NumPy array into serialized form.
Args:
array (np.ndarray) : the NumPy array to transform
force_list (bool, optional) : whether to only output to standard lists
This function can encode some dtypes using a binary encoding, but
setting this argument to True will ... | bokeh/util/serialization.py | def serialize_array(array, force_list=False, buffers=None):
''' Transforms a NumPy array into serialized form.
Args:
array (np.ndarray) : the NumPy array to transform
force_list (bool, optional) : whether to only output to standard lists
This function can encode some dtypes using a ... | def serialize_array(array, force_list=False, buffers=None):
''' Transforms a NumPy array into serialized form.
Args:
array (np.ndarray) : the NumPy array to transform
force_list (bool, optional) : whether to only output to standard lists
This function can encode some dtypes using a ... | [
"Transforms",
"a",
"NumPy",
"array",
"into",
"serialized",
"form",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L386-L421 | [
"def",
"serialize_array",
"(",
"array",
",",
"force_list",
"=",
"False",
",",
"buffers",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"array",
",",
"np",
".",
"ma",
".",
"MaskedArray",
")",
":",
"array",
"=",
"array",
".",
"filled",
"(",
"np",
"."... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | traverse_data | Recursively traverse an object until a flat list is found.
If NumPy is available, the flat list is converted to a numpy array
and passed to transform_array() to handle ``nan``, ``inf``, and
``-inf``.
Otherwise, iterate through all items, converting non-JSON items
Args:
obj (list) : a list... | bokeh/util/serialization.py | def traverse_data(obj, use_numpy=True, buffers=None):
''' Recursively traverse an object until a flat list is found.
If NumPy is available, the flat list is converted to a numpy array
and passed to transform_array() to handle ``nan``, ``inf``, and
``-inf``.
Otherwise, iterate through all items, co... | def traverse_data(obj, use_numpy=True, buffers=None):
''' Recursively traverse an object until a flat list is found.
If NumPy is available, the flat list is converted to a numpy array
and passed to transform_array() to handle ``nan``, ``inf``, and
``-inf``.
Otherwise, iterate through all items, co... | [
"Recursively",
"traverse",
"an",
"object",
"until",
"a",
"flat",
"list",
"is",
"found",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L423-L456 | [
"def",
"traverse_data",
"(",
"obj",
",",
"use_numpy",
"=",
"True",
",",
"buffers",
"=",
"None",
")",
":",
"if",
"use_numpy",
"and",
"all",
"(",
"isinstance",
"(",
"el",
",",
"np",
".",
"ndarray",
")",
"for",
"el",
"in",
"obj",
")",
":",
"return",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | transform_column_source_data | Transform ``ColumnSourceData`` data to a serialized format
Args:
data (dict) : the mapping of names to data columns to transform
buffers (set, optional) :
If binary buffers are desired, the buffers parameter may be
provided, and any columns that may be sent as binary buffer... | bokeh/util/serialization.py | def transform_column_source_data(data, buffers=None, cols=None):
''' Transform ``ColumnSourceData`` data to a serialized format
Args:
data (dict) : the mapping of names to data columns to transform
buffers (set, optional) :
If binary buffers are desired, the buffers parameter may b... | def transform_column_source_data(data, buffers=None, cols=None):
''' Transform ``ColumnSourceData`` data to a serialized format
Args:
data (dict) : the mapping of names to data columns to transform
buffers (set, optional) :
If binary buffers are desired, the buffers parameter may b... | [
"Transform",
"ColumnSourceData",
"data",
"to",
"a",
"serialized",
"format"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L458-L492 | [
"def",
"transform_column_source_data",
"(",
"data",
",",
"buffers",
"=",
"None",
",",
"cols",
"=",
"None",
")",
":",
"to_transform",
"=",
"set",
"(",
"data",
")",
"if",
"cols",
"is",
"None",
"else",
"set",
"(",
"cols",
")",
"data_copy",
"=",
"{",
"}",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | encode_binary_dict | Send a numpy array as an unencoded binary buffer
The encoded format is a dict with the following structure:
.. code:: python
{
'__buffer__' : << an ID to locate the buffer >>,
'shape' : << array shape >>,
'dtype' : << dtype name >>,
'order' ... | bokeh/util/serialization.py | def encode_binary_dict(array, buffers):
''' Send a numpy array as an unencoded binary buffer
The encoded format is a dict with the following structure:
.. code:: python
{
'__buffer__' : << an ID to locate the buffer >>,
'shape' : << array shape >>,
'dtype... | def encode_binary_dict(array, buffers):
''' Send a numpy array as an unencoded binary buffer
The encoded format is a dict with the following structure:
.. code:: python
{
'__buffer__' : << an ID to locate the buffer >>,
'shape' : << array shape >>,
'dtype... | [
"Send",
"a",
"numpy",
"array",
"as",
"an",
"unencoded",
"binary",
"buffer"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L494-L530 | [
"def",
"encode_binary_dict",
"(",
"array",
",",
"buffers",
")",
":",
"buffer_id",
"=",
"make_id",
"(",
")",
"buf",
"=",
"(",
"dict",
"(",
"id",
"=",
"buffer_id",
")",
",",
"array",
".",
"tobytes",
"(",
")",
")",
"buffers",
".",
"append",
"(",
"buf",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | decode_base64_dict | Decode a base64 encoded array into a NumPy array.
Args:
data (dict) : encoded array data to decode
Data should have the format encoded by :func:`encode_base64_dict`.
Returns:
np.ndarray | bokeh/util/serialization.py | def decode_base64_dict(data):
''' Decode a base64 encoded array into a NumPy array.
Args:
data (dict) : encoded array data to decode
Data should have the format encoded by :func:`encode_base64_dict`.
Returns:
np.ndarray
'''
b64 = base64.b64decode(data['__ndarray__'])
arra... | def decode_base64_dict(data):
''' Decode a base64 encoded array into a NumPy array.
Args:
data (dict) : encoded array data to decode
Data should have the format encoded by :func:`encode_base64_dict`.
Returns:
np.ndarray
'''
b64 = base64.b64decode(data['__ndarray__'])
arra... | [
"Decode",
"a",
"base64",
"encoded",
"array",
"into",
"a",
"NumPy",
"array",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L559-L575 | [
"def",
"decode_base64_dict",
"(",
"data",
")",
":",
"b64",
"=",
"base64",
".",
"b64decode",
"(",
"data",
"[",
"'__ndarray__'",
"]",
")",
"array",
"=",
"np",
".",
"copy",
"(",
"np",
".",
"frombuffer",
"(",
"b64",
",",
"dtype",
"=",
"data",
"[",
"'dtyp... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | CustomJSHover.from_py_func | Create a ``CustomJSHover`` instance from a Python functions. The
function is translated to JavaScript using PScript.
The python functions must have no positional arguments. It is
possible to pass Bokeh models (e.g. a ``ColumnDataSource``) as keyword
arguments to the functions.
... | bokeh/models/tools.py | def from_py_func(cls, code):
''' Create a ``CustomJSHover`` instance from a Python functions. The
function is translated to JavaScript using PScript.
The python functions must have no positional arguments. It is
possible to pass Bokeh models (e.g. a ``ColumnDataSource``) as keyword
... | def from_py_func(cls, code):
''' Create a ``CustomJSHover`` instance from a Python functions. The
function is translated to JavaScript using PScript.
The python functions must have no positional arguments. It is
possible to pass Bokeh models (e.g. a ``ColumnDataSource``) as keyword
... | [
"Create",
"a",
"CustomJSHover",
"instance",
"from",
"a",
"Python",
"functions",
".",
"The",
"function",
"is",
"translated",
"to",
"JavaScript",
"using",
"PScript",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/tools.py#L882-L932 | [
"def",
"from_py_func",
"(",
"cls",
",",
"code",
")",
":",
"from",
"bokeh",
".",
"util",
".",
"deprecation",
"import",
"deprecated",
"deprecated",
"(",
"\"'from_py_func' is deprecated and will be removed in an eventual 2.0 release. \"",
"\"Use CustomJSHover directly instead.\"",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | CustomJSHover.from_coffeescript | Create a CustomJSHover instance from a CoffeeScript snippet. The
function bodies are translated to JavaScript functions using node and
therefore require return statements.
The ``code`` snippet namespace will contain the variable ``value`` (the
untransformed value) at render time as well... | bokeh/models/tools.py | def from_coffeescript(cls, code, args={}):
''' Create a CustomJSHover instance from a CoffeeScript snippet. The
function bodies are translated to JavaScript functions using node and
therefore require return statements.
The ``code`` snippet namespace will contain the variable ``value`` (... | def from_coffeescript(cls, code, args={}):
''' Create a CustomJSHover instance from a CoffeeScript snippet. The
function bodies are translated to JavaScript functions using node and
therefore require return statements.
The ``code`` snippet namespace will contain the variable ``value`` (... | [
"Create",
"a",
"CustomJSHover",
"instance",
"from",
"a",
"CoffeeScript",
"snippet",
".",
"The",
"function",
"bodies",
"are",
"translated",
"to",
"JavaScript",
"functions",
"using",
"node",
"and",
"therefore",
"require",
"return",
"statements",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/tools.py#L935-L962 | [
"def",
"from_coffeescript",
"(",
"cls",
",",
"code",
",",
"args",
"=",
"{",
"}",
")",
":",
"compiled",
"=",
"nodejs_compile",
"(",
"code",
",",
"lang",
"=",
"\"coffeescript\"",
",",
"file",
"=",
"\"???\"",
")",
"if",
"\"error\"",
"in",
"compiled",
":",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | setup | Required Sphinx extension setup function. | bokeh/sphinxext/bokehjs_content.py | def setup(app):
''' Required Sphinx extension setup function. '''
app.add_node(
bokehjs_content,
html=(
html_visit_bokehjs_content,
html_depart_bokehjs_content
)
)
app.add_directive('bokehjs-content', BokehJSContent) | def setup(app):
''' Required Sphinx extension setup function. '''
app.add_node(
bokehjs_content,
html=(
html_visit_bokehjs_content,
html_depart_bokehjs_content
)
)
app.add_directive('bokehjs-content', BokehJSContent) | [
"Required",
"Sphinx",
"extension",
"setup",
"function",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokehjs_content.py#L268-L277 | [
"def",
"setup",
"(",
"app",
")",
":",
"app",
".",
"add_node",
"(",
"bokehjs_content",
",",
"html",
"=",
"(",
"html_visit_bokehjs_content",
",",
"html_depart_bokehjs_content",
")",
")",
"app",
".",
"add_directive",
"(",
"'bokehjs-content'",
",",
"BokehJSContent",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BokehJSContent.get_codeblock_node | this is copied from sphinx.directives.code.CodeBlock.run
it has been changed to accept code and language as an arguments instead
of reading from self | bokeh/sphinxext/bokehjs_content.py | def get_codeblock_node(self, code, language):
"""this is copied from sphinx.directives.code.CodeBlock.run
it has been changed to accept code and language as an arguments instead
of reading from self
"""
# type: () -> List[nodes.Node]
document = self.state.document
... | def get_codeblock_node(self, code, language):
"""this is copied from sphinx.directives.code.CodeBlock.run
it has been changed to accept code and language as an arguments instead
of reading from self
"""
# type: () -> List[nodes.Node]
document = self.state.document
... | [
"this",
"is",
"copied",
"from",
"sphinx",
".",
"directives",
".",
"code",
".",
"CodeBlock",
".",
"run"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokehjs_content.py#L117-L174 | [
"def",
"get_codeblock_node",
"(",
"self",
",",
"code",
",",
"language",
")",
":",
"# type: () -> List[nodes.Node]",
"document",
"=",
"self",
".",
"state",
".",
"document",
"location",
"=",
"self",
".",
"state_machine",
".",
"get_source_and_line",
"(",
"self",
".... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BokehJSContent.get_code_language | This is largely copied from bokeh.sphinxext.bokeh_plot.run | bokeh/sphinxext/bokehjs_content.py | def get_code_language(self):
"""
This is largely copied from bokeh.sphinxext.bokeh_plot.run
"""
js_source = self.get_js_source()
if self.options.get("include_html", False):
resources = get_sphinx_resources(include_bokehjs_api=True)
html_source = BJS_HTML.r... | def get_code_language(self):
"""
This is largely copied from bokeh.sphinxext.bokeh_plot.run
"""
js_source = self.get_js_source()
if self.options.get("include_html", False):
resources = get_sphinx_resources(include_bokehjs_api=True)
html_source = BJS_HTML.r... | [
"This",
"is",
"largely",
"copied",
"from",
"bokeh",
".",
"sphinxext",
".",
"bokeh_plot",
".",
"run"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokehjs_content.py#L196-L209 | [
"def",
"get_code_language",
"(",
"self",
")",
":",
"js_source",
"=",
"self",
".",
"get_js_source",
"(",
")",
"if",
"self",
".",
"options",
".",
"get",
"(",
"\"include_html\"",
",",
"False",
")",
":",
"resources",
"=",
"get_sphinx_resources",
"(",
"include_bo... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | autoload_static | Return JavaScript code and a script tag that can be used to embed
Bokeh Plots.
The data for the plot is stored directly in the returned JavaScript code.
Args:
model (Model or Document) :
resources (Resources) :
script_path (str) :
Returns:
(js, tag) :
Jav... | bokeh/embed/standalone.py | def autoload_static(model, resources, script_path):
''' Return JavaScript code and a script tag that can be used to embed
Bokeh Plots.
The data for the plot is stored directly in the returned JavaScript code.
Args:
model (Model or Document) :
resources (Resources) :
script_pa... | def autoload_static(model, resources, script_path):
''' Return JavaScript code and a script tag that can be used to embed
Bokeh Plots.
The data for the plot is stored directly in the returned JavaScript code.
Args:
model (Model or Document) :
resources (Resources) :
script_pa... | [
"Return",
"JavaScript",
"code",
"and",
"a",
"script",
"tag",
"that",
"can",
"be",
"used",
"to",
"embed",
"Bokeh",
"Plots",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/standalone.py#L55-L109 | [
"def",
"autoload_static",
"(",
"model",
",",
"resources",
",",
"script_path",
")",
":",
"# TODO: maybe warn that it's not exactly useful, but technically possible",
"# if resources.mode == 'inline':",
"# raise ValueError(\"autoload_static() requires non-inline resources\")",
"if",
"i... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | components | Return HTML components to embed a Bokeh plot. The data for the plot is
stored directly in the returned HTML.
An example can be found in examples/embed/embed_multiple.py
The returned components assume that BokehJS resources are **already loaded**.
The html template in which they will be embedded needs ... | bokeh/embed/standalone.py | def components(models, wrap_script=True, wrap_plot_info=True, theme=FromCurdoc):
''' Return HTML components to embed a Bokeh plot. The data for the plot is
stored directly in the returned HTML.
An example can be found in examples/embed/embed_multiple.py
The returned components assume that BokehJS reso... | def components(models, wrap_script=True, wrap_plot_info=True, theme=FromCurdoc):
''' Return HTML components to embed a Bokeh plot. The data for the plot is
stored directly in the returned HTML.
An example can be found in examples/embed/embed_multiple.py
The returned components assume that BokehJS reso... | [
"Return",
"HTML",
"components",
"to",
"embed",
"a",
"Bokeh",
"plot",
".",
"The",
"data",
"for",
"the",
"plot",
"is",
"stored",
"directly",
"in",
"the",
"returned",
"HTML",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/standalone.py#L111-L248 | [
"def",
"components",
"(",
"models",
",",
"wrap_script",
"=",
"True",
",",
"wrap_plot_info",
"=",
"True",
",",
"theme",
"=",
"FromCurdoc",
")",
":",
"# 1) Convert single items and dicts into list",
"was_single_object",
"=",
"isinstance",
"(",
"models",
",",
"Model",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | file_html | Return an HTML document that embeds Bokeh Model or Document objects.
The data for the plot is stored directly in the returned HTML, with
support for customizing the JS/CSS resources independently and
customizing the jinja2 template.
Args:
models (Model or Document or seq[Model]) : Bokeh object... | bokeh/embed/standalone.py | def file_html(models,
resources,
title=None,
template=FILE,
template_variables={},
theme=FromCurdoc,
suppress_callback_warning=False,
_always_new=False):
''' Return an HTML document that embeds Bokeh Model or Document ... | def file_html(models,
resources,
title=None,
template=FILE,
template_variables={},
theme=FromCurdoc,
suppress_callback_warning=False,
_always_new=False):
''' Return an HTML document that embeds Bokeh Model or Document ... | [
"Return",
"an",
"HTML",
"document",
"that",
"embeds",
"Bokeh",
"Model",
"or",
"Document",
"objects",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/standalone.py#L250-L312 | [
"def",
"file_html",
"(",
"models",
",",
"resources",
",",
"title",
"=",
"None",
",",
"template",
"=",
"FILE",
",",
"template_variables",
"=",
"{",
"}",
",",
"theme",
"=",
"FromCurdoc",
",",
"suppress_callback_warning",
"=",
"False",
",",
"_always_new",
"=",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | json_item | Return a JSON block that can be used to embed standalone Bokeh content.
Args:
model (Model) :
The Bokeh object to embed
target (string, optional)
A div id to embed the model into. If None, the target id must
be supplied in the JavaScript call.
theme (Th... | bokeh/embed/standalone.py | def json_item(model, target=None, theme=FromCurdoc):
''' Return a JSON block that can be used to embed standalone Bokeh content.
Args:
model (Model) :
The Bokeh object to embed
target (string, optional)
A div id to embed the model into. If None, the target id must
... | def json_item(model, target=None, theme=FromCurdoc):
''' Return a JSON block that can be used to embed standalone Bokeh content.
Args:
model (Model) :
The Bokeh object to embed
target (string, optional)
A div id to embed the model into. If None, the target id must
... | [
"Return",
"a",
"JSON",
"block",
"that",
"can",
"be",
"used",
"to",
"embed",
"standalone",
"Bokeh",
"content",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/standalone.py#L314-L383 | [
"def",
"json_item",
"(",
"model",
",",
"target",
"=",
"None",
",",
"theme",
"=",
"FromCurdoc",
")",
":",
"with",
"OutputDocumentFor",
"(",
"[",
"model",
"]",
",",
"apply_theme",
"=",
"theme",
")",
"as",
"doc",
":",
"doc",
".",
"title",
"=",
"\"\"",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | process_document_events | Create a JSON string describing a patch to be applied as well as
any optional buffers.
Args:
events : list of events to be translated into patches
Returns:
str, list :
JSON string which can be applied to make the given updates to obj
as well as any optional buffers | bokeh/protocol/messages/patch_doc.py | def process_document_events(events, use_buffers=True):
''' Create a JSON string describing a patch to be applied as well as
any optional buffers.
Args:
events : list of events to be translated into patches
Returns:
str, list :
JSON string which can be applied to make the given upda... | def process_document_events(events, use_buffers=True):
''' Create a JSON string describing a patch to be applied as well as
any optional buffers.
Args:
events : list of events to be translated into patches
Returns:
str, list :
JSON string which can be applied to make the given upda... | [
"Create",
"a",
"JSON",
"string",
"describing",
"a",
"patch",
"to",
"be",
"applied",
"as",
"well",
"as",
"any",
"optional",
"buffers",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/protocol/messages/patch_doc.py#L109-L136 | [
"def",
"process_document_events",
"(",
"events",
",",
"use_buffers",
"=",
"True",
")",
":",
"json_events",
"=",
"[",
"]",
"references",
"=",
"set",
"(",
")",
"buffers",
"=",
"[",
"]",
"if",
"use_buffers",
"else",
"None",
"for",
"event",
"in",
"events",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | PeriodicCallback._copy_with_changed_callback | Dev API used to wrap the callback with decorators. | bokeh/server/callbacks.py | def _copy_with_changed_callback(self, new_callback):
''' Dev API used to wrap the callback with decorators. '''
return PeriodicCallback(self._document, new_callback, self._period, self._id) | def _copy_with_changed_callback(self, new_callback):
''' Dev API used to wrap the callback with decorators. '''
return PeriodicCallback(self._document, new_callback, self._period, self._id) | [
"Dev",
"API",
"used",
"to",
"wrap",
"the",
"callback",
"with",
"decorators",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/callbacks.py#L139-L141 | [
"def",
"_copy_with_changed_callback",
"(",
"self",
",",
"new_callback",
")",
":",
"return",
"PeriodicCallback",
"(",
"self",
".",
"_document",
",",
"new_callback",
",",
"self",
".",
"_period",
",",
"self",
".",
"_id",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | TimeoutCallback._copy_with_changed_callback | Dev API used to wrap the callback with decorators. | bokeh/server/callbacks.py | def _copy_with_changed_callback(self, new_callback):
''' Dev API used to wrap the callback with decorators. '''
return TimeoutCallback(self._document, new_callback, self._timeout, self._id) | def _copy_with_changed_callback(self, new_callback):
''' Dev API used to wrap the callback with decorators. '''
return TimeoutCallback(self._document, new_callback, self._timeout, self._id) | [
"Dev",
"API",
"used",
"to",
"wrap",
"the",
"callback",
"with",
"decorators",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/callbacks.py#L171-L173 | [
"def",
"_copy_with_changed_callback",
"(",
"self",
",",
"new_callback",
")",
":",
"return",
"TimeoutCallback",
"(",
"self",
".",
"_document",
",",
"new_callback",
",",
"self",
".",
"_timeout",
",",
"self",
".",
"_id",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | calc_cache_key | Generate a key to cache a custom extension implementation with.
There is no metadata other than the Model classes, so this is the only
base to generate a cache key.
We build the model keys from the list of ``model.full_name``. This is
not ideal but possibly a better solution can be found found later. | bokeh/util/compiler.py | def calc_cache_key(custom_models):
''' Generate a key to cache a custom extension implementation with.
There is no metadata other than the Model classes, so this is the only
base to generate a cache key.
We build the model keys from the list of ``model.full_name``. This is
not ideal but possibly a... | def calc_cache_key(custom_models):
''' Generate a key to cache a custom extension implementation with.
There is no metadata other than the Model classes, so this is the only
base to generate a cache key.
We build the model keys from the list of ``model.full_name``. This is
not ideal but possibly a... | [
"Generate",
"a",
"key",
"to",
"cache",
"a",
"custom",
"extension",
"implementation",
"with",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/compiler.py#L312-L324 | [
"def",
"calc_cache_key",
"(",
"custom_models",
")",
":",
"model_names",
"=",
"{",
"model",
".",
"full_name",
"for",
"model",
"in",
"custom_models",
".",
"values",
"(",
")",
"}",
"encoded_names",
"=",
"\",\"",
".",
"join",
"(",
"sorted",
"(",
"model_names",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | bundle_models | Create a bundle of selected `models`. | bokeh/util/compiler.py | def bundle_models(models):
"""Create a bundle of selected `models`. """
custom_models = _get_custom_models(models)
if custom_models is None:
return None
key = calc_cache_key(custom_models)
bundle = _bundle_cache.get(key, None)
if bundle is None:
try:
_bundle_cache[ke... | def bundle_models(models):
"""Create a bundle of selected `models`. """
custom_models = _get_custom_models(models)
if custom_models is None:
return None
key = calc_cache_key(custom_models)
bundle = _bundle_cache.get(key, None)
if bundle is None:
try:
_bundle_cache[ke... | [
"Create",
"a",
"bundle",
"of",
"selected",
"models",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/compiler.py#L328-L343 | [
"def",
"bundle_models",
"(",
"models",
")",
":",
"custom_models",
"=",
"_get_custom_models",
"(",
"models",
")",
"if",
"custom_models",
"is",
"None",
":",
"return",
"None",
"key",
"=",
"calc_cache_key",
"(",
"custom_models",
")",
"bundle",
"=",
"_bundle_cache",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _get_custom_models | Returns CustomModels for models with a custom `__implementation__` | bokeh/util/compiler.py | def _get_custom_models(models):
"""Returns CustomModels for models with a custom `__implementation__`"""
if models is None:
models = Model.model_class_reverse_map.values()
custom_models = OrderedDict()
for cls in models:
impl = getattr(cls, "__implementation__", None)
if impl i... | def _get_custom_models(models):
"""Returns CustomModels for models with a custom `__implementation__`"""
if models is None:
models = Model.model_class_reverse_map.values()
custom_models = OrderedDict()
for cls in models:
impl = getattr(cls, "__implementation__", None)
if impl i... | [
"Returns",
"CustomModels",
"for",
"models",
"with",
"a",
"custom",
"__implementation__"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/compiler.py#L501-L516 | [
"def",
"_get_custom_models",
"(",
"models",
")",
":",
"if",
"models",
"is",
"None",
":",
"models",
"=",
"Model",
".",
"model_class_reverse_map",
".",
"values",
"(",
")",
"custom_models",
"=",
"OrderedDict",
"(",
")",
"for",
"cls",
"in",
"models",
":",
"imp... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _compile_models | Returns the compiled implementation of supplied `models`. | bokeh/util/compiler.py | def _compile_models(custom_models):
"""Returns the compiled implementation of supplied `models`. """
ordered_models = sorted(custom_models.values(), key=lambda model: model.full_name)
custom_impls = {}
dependencies = []
for model in ordered_models:
dependencies.extend(list(model.dependencie... | def _compile_models(custom_models):
"""Returns the compiled implementation of supplied `models`. """
ordered_models = sorted(custom_models.values(), key=lambda model: model.full_name)
custom_impls = {}
dependencies = []
for model in ordered_models:
dependencies.extend(list(model.dependencie... | [
"Returns",
"the",
"compiled",
"implementation",
"of",
"supplied",
"models",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/compiler.py#L518-L542 | [
"def",
"_compile_models",
"(",
"custom_models",
")",
":",
"ordered_models",
"=",
"sorted",
"(",
"custom_models",
".",
"values",
"(",
")",
",",
"key",
"=",
"lambda",
"model",
":",
"model",
".",
"full_name",
")",
"custom_impls",
"=",
"{",
"}",
"dependencies",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _bundle_models | Create a JavaScript bundle with selected `models`. | bokeh/util/compiler.py | def _bundle_models(custom_models):
""" Create a JavaScript bundle with selected `models`. """
exports = []
modules = []
def read_json(name):
with io.open(join(bokehjs_dir, "js", name + ".json"), encoding="utf-8") as f:
return json.loads(f.read())
bundles = ["bokeh", "bokeh-api"... | def _bundle_models(custom_models):
""" Create a JavaScript bundle with selected `models`. """
exports = []
modules = []
def read_json(name):
with io.open(join(bokehjs_dir, "js", name + ".json"), encoding="utf-8") as f:
return json.loads(f.read())
bundles = ["bokeh", "bokeh-api"... | [
"Create",
"a",
"JavaScript",
"bundle",
"with",
"selected",
"models",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/compiler.py#L544-L634 | [
"def",
"_bundle_models",
"(",
"custom_models",
")",
":",
"exports",
"=",
"[",
"]",
"modules",
"=",
"[",
"]",
"def",
"read_json",
"(",
"name",
")",
":",
"with",
"io",
".",
"open",
"(",
"join",
"(",
"bokehjs_dir",
",",
"\"js\"",
",",
"name",
"+",
"\".j... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | die | Print an error message and exit.
This function will call ``sys.exit`` with the given ``status`` and the
process will terminate.
Args:
message (str) : error message to print
status (int) : the exit status to pass to ``sys.exit`` | bokeh/command/util.py | def die(message, status=1):
''' Print an error message and exit.
This function will call ``sys.exit`` with the given ``status`` and the
process will terminate.
Args:
message (str) : error message to print
status (int) : the exit status to pass to ``sys.exit``
'''
print(messag... | def die(message, status=1):
''' Print an error message and exit.
This function will call ``sys.exit`` with the given ``status`` and the
process will terminate.
Args:
message (str) : error message to print
status (int) : the exit status to pass to ``sys.exit``
'''
print(messag... | [
"Print",
"an",
"error",
"message",
"and",
"exit",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/command/util.py#L52-L65 | [
"def",
"die",
"(",
"message",
",",
"status",
"=",
"1",
")",
":",
"print",
"(",
"message",
",",
"file",
"=",
"sys",
".",
"stderr",
")",
"sys",
".",
"exit",
"(",
"status",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | build_single_handler_application | Return a Bokeh application built using a single handler for a script,
notebook, or directory.
In general a Bokeh :class:`~bokeh.application.application.Application` may
have any number of handlers to initialize :class:`~bokeh.document.Document`
objects for new client sessions. However, in many cases on... | bokeh/command/util.py | def build_single_handler_application(path, argv=None):
''' Return a Bokeh application built using a single handler for a script,
notebook, or directory.
In general a Bokeh :class:`~bokeh.application.application.Application` may
have any number of handlers to initialize :class:`~bokeh.document.Document`... | def build_single_handler_application(path, argv=None):
''' Return a Bokeh application built using a single handler for a script,
notebook, or directory.
In general a Bokeh :class:`~bokeh.application.application.Application` may
have any number of handlers to initialize :class:`~bokeh.document.Document`... | [
"Return",
"a",
"Bokeh",
"application",
"built",
"using",
"a",
"single",
"handler",
"for",
"a",
"script",
"notebook",
"or",
"directory",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/command/util.py#L77-L139 | [
"def",
"build_single_handler_application",
"(",
"path",
",",
"argv",
"=",
"None",
")",
":",
"argv",
"=",
"argv",
"or",
"[",
"]",
"path",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"path",
")",
"# There are certainly race conditions here if the file/directory is ... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | build_single_handler_applications | Return a dictionary mapping routes to Bokeh applications built using
single handlers, for specified files or directories.
This function iterates over ``paths`` and ``argvs`` and calls
:func:`~bokeh.command.util.build_single_handler_application` on each
to generate the mapping.
Args:
path (... | bokeh/command/util.py | def build_single_handler_applications(paths, argvs=None):
''' Return a dictionary mapping routes to Bokeh applications built using
single handlers, for specified files or directories.
This function iterates over ``paths`` and ``argvs`` and calls
:func:`~bokeh.command.util.build_single_handler_applicati... | def build_single_handler_applications(paths, argvs=None):
''' Return a dictionary mapping routes to Bokeh applications built using
single handlers, for specified files or directories.
This function iterates over ``paths`` and ``argvs`` and calls
:func:`~bokeh.command.util.build_single_handler_applicati... | [
"Return",
"a",
"dictionary",
"mapping",
"routes",
"to",
"Bokeh",
"applications",
"built",
"using",
"single",
"handlers",
"for",
"specified",
"files",
"or",
"directories",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/command/util.py#L141-L177 | [
"def",
"build_single_handler_applications",
"(",
"paths",
",",
"argvs",
"=",
"None",
")",
":",
"applications",
"=",
"{",
"}",
"argvs",
"=",
"{",
"}",
"or",
"argvs",
"for",
"path",
"in",
"paths",
":",
"application",
"=",
"build_single_handler_application",
"(",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | report_server_init_errors | A context manager to help print more informative error messages when a
``Server`` cannot be started due to a network problem.
Args:
address (str) : network address that the server will be listening on
port (int) : network address that the server will be listening on
Example:
.. c... | bokeh/command/util.py | def report_server_init_errors(address=None, port=None, **kwargs):
''' A context manager to help print more informative error messages when a
``Server`` cannot be started due to a network problem.
Args:
address (str) : network address that the server will be listening on
port (int) : networ... | def report_server_init_errors(address=None, port=None, **kwargs):
''' A context manager to help print more informative error messages when a
``Server`` cannot be started due to a network problem.
Args:
address (str) : network address that the server will be listening on
port (int) : networ... | [
"A",
"context",
"manager",
"to",
"help",
"print",
"more",
"informative",
"error",
"messages",
"when",
"a",
"Server",
"cannot",
"be",
"started",
"due",
"to",
"a",
"network",
"problem",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/command/util.py#L181-L212 | [
"def",
"report_server_init_errors",
"(",
"address",
"=",
"None",
",",
"port",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"yield",
"except",
"EnvironmentError",
"as",
"e",
":",
"if",
"e",
".",
"errno",
"==",
"errno",
".",
"EADDRINUSE",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | distance | Distance between (lat1, lon1) and (lat2, lon2). | examples/models/file/trail.py | def distance(p1, p2):
"""Distance between (lat1, lon1) and (lat2, lon2). """
R = 6371
lat1, lon1 = p1
lat2, lon2 = p2
phi1 = radians(lat1)
phi2 = radians(lat2)
delta_lat = radians(lat2 - lat1)
delta_lon = radians(lon2 - lon1)
a = haversin(delta_lat) + cos(phi1) * cos(phi2) * haver... | def distance(p1, p2):
"""Distance between (lat1, lon1) and (lat2, lon2). """
R = 6371
lat1, lon1 = p1
lat2, lon2 = p2
phi1 = radians(lat1)
phi2 = radians(lat2)
delta_lat = radians(lat2 - lat1)
delta_lon = radians(lon2 - lon1)
a = haversin(delta_lat) + cos(phi1) * cos(phi2) * haver... | [
"Distance",
"between",
"(",
"lat1",
"lon1",
")",
"and",
"(",
"lat2",
"lon2",
")",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/examples/models/file/trail.py#L29-L42 | [
"def",
"distance",
"(",
"p1",
",",
"p2",
")",
":",
"R",
"=",
"6371",
"lat1",
",",
"lon1",
"=",
"p1",
"lat2",
",",
"lon2",
"=",
"p2",
"phi1",
"=",
"radians",
"(",
"lat1",
")",
"phi2",
"=",
"radians",
"(",
"lat2",
")",
"delta_lat",
"=",
"radians",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | setup | Required Sphinx extension setup function. | bokeh/sphinxext/bokeh_plot.py | def setup(app):
''' Required Sphinx extension setup function. '''
# These two are deprecated and no longer have any effect, to be removed 2.0
app.add_config_value('bokeh_plot_pyfile_include_dirs', [], 'html')
app.add_config_value('bokeh_plot_use_relative_paths', False, 'html')
app.add_directive('b... | def setup(app):
''' Required Sphinx extension setup function. '''
# These two are deprecated and no longer have any effect, to be removed 2.0
app.add_config_value('bokeh_plot_pyfile_include_dirs', [], 'html')
app.add_config_value('bokeh_plot_use_relative_paths', False, 'html')
app.add_directive('b... | [
"Required",
"Sphinx",
"extension",
"setup",
"function",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_plot.py#L212-L222 | [
"def",
"setup",
"(",
"app",
")",
":",
"# These two are deprecated and no longer have any effect, to be removed 2.0",
"app",
".",
"add_config_value",
"(",
"'bokeh_plot_pyfile_include_dirs'",
",",
"[",
"]",
",",
"'html'",
")",
"app",
".",
"add_config_value",
"(",
"'bokeh_pl... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | bind_sockets | Bind a socket to a port on an address.
Args:
address (str) :
An address to bind a port on, e.g. ``"localhost"``
port (int) :
A port number to bind.
Pass 0 to have the OS automatically choose a free port.
This function returns a 2-tuple with the new socket ... | bokeh/server/util.py | def bind_sockets(address, port):
''' Bind a socket to a port on an address.
Args:
address (str) :
An address to bind a port on, e.g. ``"localhost"``
port (int) :
A port number to bind.
Pass 0 to have the OS automatically choose a free port.
This functi... | def bind_sockets(address, port):
''' Bind a socket to a port on an address.
Args:
address (str) :
An address to bind a port on, e.g. ``"localhost"``
port (int) :
A port number to bind.
Pass 0 to have the OS automatically choose a free port.
This functi... | [
"Bind",
"a",
"socket",
"to",
"a",
"port",
"on",
"an",
"address",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/util.py#L46-L73 | [
"def",
"bind_sockets",
"(",
"address",
",",
"port",
")",
":",
"ss",
"=",
"netutil",
".",
"bind_sockets",
"(",
"port",
"=",
"port",
"or",
"0",
",",
"address",
"=",
"address",
")",
"assert",
"len",
"(",
"ss",
")",
"ports",
"=",
"{",
"s",
".",
"getsoc... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | check_whitelist | Check a given request host against a whitelist.
Args:
host (str) :
A host string to compare against a whitelist.
If the host does not specify a port, then ``":80"`` is implicitly
assumed.
whitelist (seq[str]) :
A list of host patterns to match again... | bokeh/server/util.py | def check_whitelist(host, whitelist):
''' Check a given request host against a whitelist.
Args:
host (str) :
A host string to compare against a whitelist.
If the host does not specify a port, then ``":80"`` is implicitly
assumed.
whitelist (seq[str]) :
... | def check_whitelist(host, whitelist):
''' Check a given request host against a whitelist.
Args:
host (str) :
A host string to compare against a whitelist.
If the host does not specify a port, then ``":80"`` is implicitly
assumed.
whitelist (seq[str]) :
... | [
"Check",
"a",
"given",
"request",
"host",
"against",
"a",
"whitelist",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/util.py#L75-L99 | [
"def",
"check_whitelist",
"(",
"host",
",",
"whitelist",
")",
":",
"if",
"':'",
"not",
"in",
"host",
":",
"host",
"=",
"host",
"+",
"':80'",
"if",
"host",
"in",
"whitelist",
":",
"return",
"True",
"return",
"any",
"(",
"match_host",
"(",
"host",
",",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | match_host | Match a host string against a pattern
Args:
host (str)
A hostname to compare to the given pattern
pattern (str)
A string representing a hostname pattern, possibly including
wildcards for ip address octets or ports.
This function will return ``True`` if the ... | bokeh/server/util.py | def match_host(host, pattern):
''' Match a host string against a pattern
Args:
host (str)
A hostname to compare to the given pattern
pattern (str)
A string representing a hostname pattern, possibly including
wildcards for ip address octets or ports.
Thi... | def match_host(host, pattern):
''' Match a host string against a pattern
Args:
host (str)
A hostname to compare to the given pattern
pattern (str)
A string representing a hostname pattern, possibly including
wildcards for ip address octets or ports.
Thi... | [
"Match",
"a",
"host",
"string",
"against",
"a",
"pattern"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/util.py#L164-L240 | [
"def",
"match_host",
"(",
"host",
",",
"pattern",
")",
":",
"if",
"':'",
"in",
"host",
":",
"host",
",",
"host_port",
"=",
"host",
".",
"rsplit",
"(",
"':'",
",",
"1",
")",
"else",
":",
"host_port",
"=",
"None",
"if",
"':'",
"in",
"pattern",
":",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | State.notebook_type | Notebook type, acceptable values are 'jupyter' as well as any names
defined by external notebook hooks that have been installed. | bokeh/io/state.py | def notebook_type(self, notebook_type):
''' Notebook type, acceptable values are 'jupyter' as well as any names
defined by external notebook hooks that have been installed.
'''
if notebook_type is None or not isinstance(notebook_type, string_types):
raise ValueError("Noteboo... | def notebook_type(self, notebook_type):
''' Notebook type, acceptable values are 'jupyter' as well as any names
defined by external notebook hooks that have been installed.
'''
if notebook_type is None or not isinstance(notebook_type, string_types):
raise ValueError("Noteboo... | [
"Notebook",
"type",
"acceptable",
"values",
"are",
"jupyter",
"as",
"well",
"as",
"any",
"names",
"defined",
"by",
"external",
"notebook",
"hooks",
"that",
"have",
"been",
"installed",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/state.py#L124-L131 | [
"def",
"notebook_type",
"(",
"self",
",",
"notebook_type",
")",
":",
"if",
"notebook_type",
"is",
"None",
"or",
"not",
"isinstance",
"(",
"notebook_type",
",",
"string_types",
")",
":",
"raise",
"ValueError",
"(",
"\"Notebook type must be a string\"",
")",
"self",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | State.output_file | Configure output to a standalone HTML file.
Calling ``output_file`` not clear the effects of any other calls to
``output_notebook``, etc. It adds an additional output destination
(publishing to HTML files). Any other active output modes continue
to be active.
Args:
... | bokeh/io/state.py | def output_file(self, filename, title="Bokeh Plot", mode="cdn", root_dir=None):
''' Configure output to a standalone HTML file.
Calling ``output_file`` not clear the effects of any other calls to
``output_notebook``, etc. It adds an additional output destination
(publishing to HTML file... | def output_file(self, filename, title="Bokeh Plot", mode="cdn", root_dir=None):
''' Configure output to a standalone HTML file.
Calling ``output_file`` not clear the effects of any other calls to
``output_notebook``, etc. It adds an additional output destination
(publishing to HTML file... | [
"Configure",
"output",
"to",
"a",
"standalone",
"HTML",
"file",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/state.py#L135-L171 | [
"def",
"output_file",
"(",
"self",
",",
"filename",
",",
"title",
"=",
"\"Bokeh Plot\"",
",",
"mode",
"=",
"\"cdn\"",
",",
"root_dir",
"=",
"None",
")",
":",
"self",
".",
"_file",
"=",
"{",
"'filename'",
":",
"filename",
",",
"'resources'",
":",
"Resourc... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | save | Save an HTML file with the data for the current document.
Will fall back to the default output state (or an explicitly provided
:class:`State` object) for ``filename``, ``resources``, or ``title`` if they
are not provided. If the filename is not given and not provided via output state,
it is derived fr... | bokeh/io/saving.py | def save(obj, filename=None, resources=None, title=None, template=None, state=None, **kwargs):
''' Save an HTML file with the data for the current document.
Will fall back to the default output state (or an explicitly provided
:class:`State` object) for ``filename``, ``resources``, or ``title`` if they
... | def save(obj, filename=None, resources=None, title=None, template=None, state=None, **kwargs):
''' Save an HTML file with the data for the current document.
Will fall back to the default output state (or an explicitly provided
:class:`State` object) for ``filename``, ``resources``, or ``title`` if they
... | [
"Save",
"an",
"HTML",
"file",
"with",
"the",
"data",
"for",
"the",
"current",
"document",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/saving.py#L50-L87 | [
"def",
"save",
"(",
"obj",
",",
"filename",
"=",
"None",
",",
"resources",
"=",
"None",
",",
"title",
"=",
"None",
",",
"template",
"=",
"None",
",",
"state",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"state",
"is",
"None",
":",
"stat... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | html_page_context | Collect page names for the sitemap as HTML pages are built. | bokeh/sphinxext/bokeh_sitemap.py | def html_page_context(app, pagename, templatename, context, doctree):
''' Collect page names for the sitemap as HTML pages are built.
'''
site = context['SITEMAP_BASE_URL']
version = context['version']
app.sitemap_links.add(site + version + '/' + pagename + ".html") | def html_page_context(app, pagename, templatename, context, doctree):
''' Collect page names for the sitemap as HTML pages are built.
'''
site = context['SITEMAP_BASE_URL']
version = context['version']
app.sitemap_links.add(site + version + '/' + pagename + ".html") | [
"Collect",
"page",
"names",
"for",
"the",
"sitemap",
"as",
"HTML",
"pages",
"are",
"built",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_sitemap.py#L58-L64 | [
"def",
"html_page_context",
"(",
"app",
",",
"pagename",
",",
"templatename",
",",
"context",
",",
"doctree",
")",
":",
"site",
"=",
"context",
"[",
"'SITEMAP_BASE_URL'",
"]",
"version",
"=",
"context",
"[",
"'version'",
"]",
"app",
".",
"sitemap_links",
"."... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | build_finished | Generate a ``sitemap.txt`` from the collected HTML page links. | bokeh/sphinxext/bokeh_sitemap.py | def build_finished(app, exception):
''' Generate a ``sitemap.txt`` from the collected HTML page links.
'''
filename = join(app.outdir, "sitemap.txt")
links_iter = status_iterator(sorted(app.sitemap_links),
'adding links to sitemap... ',
... | def build_finished(app, exception):
''' Generate a ``sitemap.txt`` from the collected HTML page links.
'''
filename = join(app.outdir, "sitemap.txt")
links_iter = status_iterator(sorted(app.sitemap_links),
'adding links to sitemap... ',
... | [
"Generate",
"a",
"sitemap",
".",
"txt",
"from",
"the",
"collected",
"HTML",
"page",
"links",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_sitemap.py#L66-L83 | [
"def",
"build_finished",
"(",
"app",
",",
"exception",
")",
":",
"filename",
"=",
"join",
"(",
"app",
".",
"outdir",
",",
"\"sitemap.txt\"",
")",
"links_iter",
"=",
"status_iterator",
"(",
"sorted",
"(",
"app",
".",
"sitemap_links",
")",
",",
"'adding links ... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | setup | Required Sphinx extension setup function. | bokeh/sphinxext/bokeh_sitemap.py | def setup(app):
''' Required Sphinx extension setup function. '''
app.connect('html-page-context', html_page_context)
app.connect('build-finished', build_finished)
app.sitemap_links = set() | def setup(app):
''' Required Sphinx extension setup function. '''
app.connect('html-page-context', html_page_context)
app.connect('build-finished', build_finished)
app.sitemap_links = set() | [
"Required",
"Sphinx",
"extension",
"setup",
"function",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_sitemap.py#L85-L89 | [
"def",
"setup",
"(",
"app",
")",
":",
"app",
".",
"connect",
"(",
"'html-page-context'",
",",
"html_page_context",
")",
"app",
".",
"connect",
"(",
"'build-finished'",
",",
"build_finished",
")",
"app",
".",
"sitemap_links",
"=",
"set",
"(",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BokehTornado.initialize | Start a Bokeh Server Tornado Application on a given Tornado IOLoop. | bokeh/server/tornado.py | def initialize(self, io_loop):
''' Start a Bokeh Server Tornado Application on a given Tornado IOLoop.
'''
self._loop = io_loop
for app_context in self._applications.values():
app_context._loop = self._loop
self._clients = set()
self._stats_job = PeriodicC... | def initialize(self, io_loop):
''' Start a Bokeh Server Tornado Application on a given Tornado IOLoop.
'''
self._loop = io_loop
for app_context in self._applications.values():
app_context._loop = self._loop
self._clients = set()
self._stats_job = PeriodicC... | [
"Start",
"a",
"Bokeh",
"Server",
"Tornado",
"Application",
"on",
"a",
"given",
"Tornado",
"IOLoop",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/tornado.py#L319-L346 | [
"def",
"initialize",
"(",
"self",
",",
"io_loop",
")",
":",
"self",
".",
"_loop",
"=",
"io_loop",
"for",
"app_context",
"in",
"self",
".",
"_applications",
".",
"values",
"(",
")",
":",
"app_context",
".",
"_loop",
"=",
"self",
".",
"_loop",
"self",
".... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BokehTornado.resources | Provide a :class:`~bokeh.resources.Resources` that specifies where
Bokeh application sessions should load BokehJS resources from.
Args:
absolute_url (bool):
An absolute URL prefix to use for locating resources. If None,
relative URLs are used (default: None) | bokeh/server/tornado.py | def resources(self, absolute_url=None):
''' Provide a :class:`~bokeh.resources.Resources` that specifies where
Bokeh application sessions should load BokehJS resources from.
Args:
absolute_url (bool):
An absolute URL prefix to use for locating resources. If None,
... | def resources(self, absolute_url=None):
''' Provide a :class:`~bokeh.resources.Resources` that specifies where
Bokeh application sessions should load BokehJS resources from.
Args:
absolute_url (bool):
An absolute URL prefix to use for locating resources. If None,
... | [
"Provide",
"a",
":",
"class",
":",
"~bokeh",
".",
"resources",
".",
"Resources",
"that",
"specifies",
"where",
"Bokeh",
"application",
"sessions",
"should",
"load",
"BokehJS",
"resources",
"from",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/tornado.py#L411-L423 | [
"def",
"resources",
"(",
"self",
",",
"absolute_url",
"=",
"None",
")",
":",
"if",
"absolute_url",
":",
"return",
"Resources",
"(",
"mode",
"=",
"\"server\"",
",",
"root_url",
"=",
"absolute_url",
"+",
"self",
".",
"_prefix",
",",
"path_versioner",
"=",
"S... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BokehTornado.start | Start the Bokeh Server application.
Starting the Bokeh Server Tornado application will run periodic
callbacks for stats logging, cleanup, pinging, etc. Additionally, any
startup hooks defined by the configured Bokeh applications will be run. | bokeh/server/tornado.py | def start(self):
''' Start the Bokeh Server application.
Starting the Bokeh Server Tornado application will run periodic
callbacks for stats logging, cleanup, pinging, etc. Additionally, any
startup hooks defined by the configured Bokeh applications will be run.
'''
sel... | def start(self):
''' Start the Bokeh Server application.
Starting the Bokeh Server Tornado application will run periodic
callbacks for stats logging, cleanup, pinging, etc. Additionally, any
startup hooks defined by the configured Bokeh applications will be run.
'''
sel... | [
"Start",
"the",
"Bokeh",
"Server",
"application",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/tornado.py#L425-L441 | [
"def",
"start",
"(",
"self",
")",
":",
"self",
".",
"_stats_job",
".",
"start",
"(",
")",
"if",
"self",
".",
"_mem_job",
"is",
"not",
"None",
":",
"self",
".",
"_mem_job",
".",
"start",
"(",
")",
"self",
".",
"_cleanup_job",
".",
"start",
"(",
")",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BokehTornado.stop | Stop the Bokeh Server application.
Args:
wait (bool): whether to wait for orderly cleanup (default: True)
Returns:
None | bokeh/server/tornado.py | def stop(self, wait=True):
''' Stop the Bokeh Server application.
Args:
wait (bool): whether to wait for orderly cleanup (default: True)
Returns:
None
'''
# TODO should probably close all connections and shut down all sessions here
for context ... | def stop(self, wait=True):
''' Stop the Bokeh Server application.
Args:
wait (bool): whether to wait for orderly cleanup (default: True)
Returns:
None
'''
# TODO should probably close all connections and shut down all sessions here
for context ... | [
"Stop",
"the",
"Bokeh",
"Server",
"application",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/tornado.py#L443-L465 | [
"def",
"stop",
"(",
"self",
",",
"wait",
"=",
"True",
")",
":",
"# TODO should probably close all connections and shut down all sessions here",
"for",
"context",
"in",
"self",
".",
"_applications",
".",
"values",
"(",
")",
":",
"context",
".",
"run_unload_hook",
"("... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BokehTornado.get_session | Get an active a session by name application path and session ID.
Args:
app_path (str) :
The configured application path for the application to return
a session for.
session_id (str) :
The session ID of the session to retrieve.
Re... | bokeh/server/tornado.py | def get_session(self, app_path, session_id):
''' Get an active a session by name application path and session ID.
Args:
app_path (str) :
The configured application path for the application to return
a session for.
session_id (str) :
... | def get_session(self, app_path, session_id):
''' Get an active a session by name application path and session ID.
Args:
app_path (str) :
The configured application path for the application to return
a session for.
session_id (str) :
... | [
"Get",
"an",
"active",
"a",
"session",
"by",
"name",
"application",
"path",
"and",
"session",
"ID",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/tornado.py#L476-L493 | [
"def",
"get_session",
"(",
"self",
",",
"app_path",
",",
"session_id",
")",
":",
"if",
"app_path",
"not",
"in",
"self",
".",
"_applications",
":",
"raise",
"ValueError",
"(",
"\"Application %s does not exist on this server\"",
"%",
"app_path",
")",
"return",
"self... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BokehTornado.get_sessions | Gets all currently active sessions for an application.
Args:
app_path (str) :
The configured application path for the application to return
sessions for.
Returns:
list[ServerSession] | bokeh/server/tornado.py | def get_sessions(self, app_path):
''' Gets all currently active sessions for an application.
Args:
app_path (str) :
The configured application path for the application to return
sessions for.
Returns:
list[ServerSession]
'''
... | def get_sessions(self, app_path):
''' Gets all currently active sessions for an application.
Args:
app_path (str) :
The configured application path for the application to return
sessions for.
Returns:
list[ServerSession]
'''
... | [
"Gets",
"all",
"currently",
"active",
"sessions",
"for",
"an",
"application",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/tornado.py#L495-L509 | [
"def",
"get_sessions",
"(",
"self",
",",
"app_path",
")",
":",
"if",
"app_path",
"not",
"in",
"self",
".",
"_applications",
":",
"raise",
"ValueError",
"(",
"\"Application %s does not exist on this server\"",
"%",
"app_path",
")",
"return",
"list",
"(",
"self",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _validator | Internal shared implementation to handle both error and warning
validation checks.
Args:
code code_or_name (int or str) : a defined error code or custom message
validator_type (str) : either "error" or "warning"
Returns:
validation decorator | bokeh/core/validation/decorators.py | def _validator(code_or_name, validator_type):
''' Internal shared implementation to handle both error and warning
validation checks.
Args:
code code_or_name (int or str) : a defined error code or custom message
validator_type (str) : either "error" or "warning"
Returns:
validat... | def _validator(code_or_name, validator_type):
''' Internal shared implementation to handle both error and warning
validation checks.
Args:
code code_or_name (int or str) : a defined error code or custom message
validator_type (str) : either "error" or "warning"
Returns:
validat... | [
"Internal",
"shared",
"implementation",
"to",
"handle",
"both",
"error",
"and",
"warning",
"validation",
"checks",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/validation/decorators.py#L44-L80 | [
"def",
"_validator",
"(",
"code_or_name",
",",
"validator_type",
")",
":",
"if",
"validator_type",
"==",
"\"error\"",
":",
"from",
".",
"errors",
"import",
"codes",
"from",
".",
"errors",
"import",
"EXT",
"elif",
"validator_type",
"==",
"\"warning\"",
":",
"fr... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | find | Query a collection of Bokeh models and yield any that match the
a selector.
Args:
obj (Model) : object to test
selector (JSON-like) : query selector
context (dict) : kwargs to supply callable query attributes
Yields:
Model : objects that match the query
Queries are spe... | bokeh/core/query.py | def find(objs, selector, context=None):
''' Query a collection of Bokeh models and yield any that match the
a selector.
Args:
obj (Model) : object to test
selector (JSON-like) : query selector
context (dict) : kwargs to supply callable query attributes
Yields:
Model : o... | def find(objs, selector, context=None):
''' Query a collection of Bokeh models and yield any that match the
a selector.
Args:
obj (Model) : object to test
selector (JSON-like) : query selector
context (dict) : kwargs to supply callable query attributes
Yields:
Model : o... | [
"Query",
"a",
"collection",
"of",
"Bokeh",
"models",
"and",
"yield",
"any",
"that",
"match",
"the",
"a",
"selector",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/query.py#L52-L87 | [
"def",
"find",
"(",
"objs",
",",
"selector",
",",
"context",
"=",
"None",
")",
":",
"return",
"(",
"obj",
"for",
"obj",
"in",
"objs",
"if",
"match",
"(",
"obj",
",",
"selector",
",",
"context",
")",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | match | Test whether a given Bokeh model matches a given selector.
Args:
obj (Model) : object to test
selector (JSON-like) : query selector
context (dict) : kwargs to supply callable query attributes
Returns:
bool : True if the object matches, False otherwise
In general, the selec... | bokeh/core/query.py | def match(obj, selector, context=None):
''' Test whether a given Bokeh model matches a given selector.
Args:
obj (Model) : object to test
selector (JSON-like) : query selector
context (dict) : kwargs to supply callable query attributes
Returns:
bool : True if the object mat... | def match(obj, selector, context=None):
''' Test whether a given Bokeh model matches a given selector.
Args:
obj (Model) : object to test
selector (JSON-like) : query selector
context (dict) : kwargs to supply callable query attributes
Returns:
bool : True if the object mat... | [
"Test",
"whether",
"a",
"given",
"Bokeh",
"model",
"matches",
"a",
"given",
"selector",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/query.py#L89-L211 | [
"def",
"match",
"(",
"obj",
",",
"selector",
",",
"context",
"=",
"None",
")",
":",
"context",
"=",
"context",
"or",
"{",
"}",
"for",
"key",
",",
"val",
"in",
"selector",
".",
"items",
"(",
")",
":",
"# test attributes",
"if",
"isinstance",
"(",
"key... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | setup | Required Sphinx extension setup function. | bokeh/sphinxext/bokeh_gallery.py | def setup(app):
''' Required Sphinx extension setup function. '''
app.add_config_value('bokeh_gallery_dir', join("docs", "gallery"), 'html')
app.connect('config-inited', config_inited_handler)
app.add_directive('bokeh-gallery', BokehGalleryDirective) | def setup(app):
''' Required Sphinx extension setup function. '''
app.add_config_value('bokeh_gallery_dir', join("docs", "gallery"), 'html')
app.connect('config-inited', config_inited_handler)
app.add_directive('bokeh-gallery', BokehGalleryDirective) | [
"Required",
"Sphinx",
"extension",
"setup",
"function",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_gallery.py#L124-L128 | [
"def",
"setup",
"(",
"app",
")",
":",
"app",
".",
"add_config_value",
"(",
"'bokeh_gallery_dir'",
",",
"join",
"(",
"\"docs\"",
",",
"\"gallery\"",
")",
",",
"'html'",
")",
"app",
".",
"connect",
"(",
"'config-inited'",
",",
"config_inited_handler",
")",
"ap... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | default_filename | Generate a default filename with a given extension, attempting to use
the filename of the currently running process, if possible.
If the filename of the current process is not available (or would not be
writable), then a temporary file with the given extension is returned.
Args:
ext (str) : th... | bokeh/io/util.py | def default_filename(ext):
''' Generate a default filename with a given extension, attempting to use
the filename of the currently running process, if possible.
If the filename of the current process is not available (or would not be
writable), then a temporary file with the given extension is returned... | def default_filename(ext):
''' Generate a default filename with a given extension, attempting to use
the filename of the currently running process, if possible.
If the filename of the current process is not available (or would not be
writable), then a temporary file with the given extension is returned... | [
"Generate",
"a",
"default",
"filename",
"with",
"a",
"given",
"extension",
"attempting",
"to",
"use",
"the",
"filename",
"of",
"the",
"currently",
"running",
"process",
"if",
"possible",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/util.py#L50-L82 | [
"def",
"default_filename",
"(",
"ext",
")",
":",
"if",
"ext",
"==",
"\"py\"",
":",
"raise",
"RuntimeError",
"(",
"\"asked for a default filename with 'py' extension\"",
")",
"filename",
"=",
"detect_current_filename",
"(",
")",
"if",
"filename",
"is",
"None",
":",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | detect_current_filename | Attempt to return the filename of the currently running Python process
Returns None if the filename cannot be detected. | bokeh/io/util.py | def detect_current_filename():
''' Attempt to return the filename of the currently running Python process
Returns None if the filename cannot be detected.
'''
import inspect
filename = None
frame = inspect.currentframe()
try:
while frame.f_back and frame.f_globals.get('name') != '_... | def detect_current_filename():
''' Attempt to return the filename of the currently running Python process
Returns None if the filename cannot be detected.
'''
import inspect
filename = None
frame = inspect.currentframe()
try:
while frame.f_back and frame.f_globals.get('name') != '_... | [
"Attempt",
"to",
"return",
"the",
"filename",
"of",
"the",
"currently",
"running",
"Python",
"process"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/util.py#L84-L101 | [
"def",
"detect_current_filename",
"(",
")",
":",
"import",
"inspect",
"filename",
"=",
"None",
"frame",
"=",
"inspect",
".",
"currentframe",
"(",
")",
"try",
":",
"while",
"frame",
".",
"f_back",
"and",
"frame",
".",
"f_globals",
".",
"get",
"(",
"'name'",... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _no_access | Return True if the given base dir is not accessible or writeable | bokeh/io/util.py | def _no_access(basedir):
''' Return True if the given base dir is not accessible or writeable
'''
import os
return not os.access(basedir, os.W_OK | os.X_OK) | def _no_access(basedir):
''' Return True if the given base dir is not accessible or writeable
'''
import os
return not os.access(basedir, os.W_OK | os.X_OK) | [
"Return",
"True",
"if",
"the",
"given",
"base",
"dir",
"is",
"not",
"accessible",
"or",
"writeable"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/util.py#L113-L118 | [
"def",
"_no_access",
"(",
"basedir",
")",
":",
"import",
"os",
"return",
"not",
"os",
".",
"access",
"(",
"basedir",
",",
"os",
".",
"W_OK",
"|",
"os",
".",
"X_OK",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _shares_exec_prefix | Whether a give base directory is on the system exex prefix | bokeh/io/util.py | def _shares_exec_prefix(basedir):
''' Whether a give base directory is on the system exex prefix
'''
import sys
prefix = sys.exec_prefix
return (prefix is not None and basedir.startswith(prefix)) | def _shares_exec_prefix(basedir):
''' Whether a give base directory is on the system exex prefix
'''
import sys
prefix = sys.exec_prefix
return (prefix is not None and basedir.startswith(prefix)) | [
"Whether",
"a",
"give",
"base",
"directory",
"is",
"on",
"the",
"system",
"exex",
"prefix"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/util.py#L120-L126 | [
"def",
"_shares_exec_prefix",
"(",
"basedir",
")",
":",
"import",
"sys",
"prefix",
"=",
"sys",
".",
"exec_prefix",
"return",
"(",
"prefix",
"is",
"not",
"None",
"and",
"basedir",
".",
"startswith",
"(",
"prefix",
")",
")"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | setup | Required Sphinx extension setup function. | bokeh/sphinxext/bokeh_palette_group.py | def setup(app):
''' Required Sphinx extension setup function. '''
app.add_node(bokeh_palette_group, html=(html_visit_bokeh_palette_group, None))
app.add_directive('bokeh-palette-group', BokehPaletteGroupDirective) | def setup(app):
''' Required Sphinx extension setup function. '''
app.add_node(bokeh_palette_group, html=(html_visit_bokeh_palette_group, None))
app.add_directive('bokeh-palette-group', BokehPaletteGroupDirective) | [
"Required",
"Sphinx",
"extension",
"setup",
"function",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_palette_group.py#L100-L103 | [
"def",
"setup",
"(",
"app",
")",
":",
"app",
".",
"add_node",
"(",
"bokeh_palette_group",
",",
"html",
"=",
"(",
"html_visit_bokeh_palette_group",
",",
"None",
")",
")",
"app",
".",
"add_directive",
"(",
"'bokeh-palette-group'",
",",
"BokehPaletteGroupDirective",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | FileOutputSubcommand.other_args | Return args for ``-o`` / ``--output`` to specify where output
should be written, and for a ``--args`` to pass on any additional
command line args to the subcommand.
Subclasses should append these to their class ``args``.
Example:
.. code-block:: python
cla... | bokeh/command/subcommands/file_output.py | def other_args(cls):
''' Return args for ``-o`` / ``--output`` to specify where output
should be written, and for a ``--args`` to pass on any additional
command line args to the subcommand.
Subclasses should append these to their class ``args``.
Example:
.. code-bl... | def other_args(cls):
''' Return args for ``-o`` / ``--output`` to specify where output
should be written, and for a ``--args`` to pass on any additional
command line args to the subcommand.
Subclasses should append these to their class ``args``.
Example:
.. code-bl... | [
"Return",
"args",
"for",
"-",
"o",
"/",
"--",
"output",
"to",
"specify",
"where",
"output",
"should",
"be",
"written",
"and",
"for",
"a",
"--",
"args",
"to",
"pass",
"on",
"any",
"additional",
"command",
"line",
"args",
"to",
"the",
"subcommand",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/command/subcommands/file_output.py#L89-L124 | [
"def",
"other_args",
"(",
"cls",
")",
":",
"return",
"(",
"(",
"(",
"'-o'",
",",
"'--output'",
")",
",",
"dict",
"(",
"metavar",
"=",
"'FILENAME'",
",",
"action",
"=",
"'append'",
",",
"type",
"=",
"str",
",",
"help",
"=",
"\"Name of the output file or -... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _pop_colors_and_alpha | Given a kwargs dict, a prefix, and a default value, looks for different
color and alpha fields of the given prefix, and fills in the default value
if it doesn't exist. | bokeh/plotting/helpers.py | def _pop_colors_and_alpha(glyphclass, kwargs, prefix="", default_alpha=1.0):
"""
Given a kwargs dict, a prefix, and a default value, looks for different
color and alpha fields of the given prefix, and fills in the default value
if it doesn't exist.
"""
result = dict()
# TODO: The need to do... | def _pop_colors_and_alpha(glyphclass, kwargs, prefix="", default_alpha=1.0):
"""
Given a kwargs dict, a prefix, and a default value, looks for different
color and alpha fields of the given prefix, and fills in the default value
if it doesn't exist.
"""
result = dict()
# TODO: The need to do... | [
"Given",
"a",
"kwargs",
"dict",
"a",
"prefix",
"and",
"a",
"default",
"value",
"looks",
"for",
"different",
"color",
"and",
"alpha",
"fields",
"of",
"the",
"given",
"prefix",
"and",
"fills",
"in",
"the",
"default",
"value",
"if",
"it",
"doesn",
"t",
"exi... | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/plotting/helpers.py#L286-L315 | [
"def",
"_pop_colors_and_alpha",
"(",
"glyphclass",
",",
"kwargs",
",",
"prefix",
"=",
"\"\"",
",",
"default_alpha",
"=",
"1.0",
")",
":",
"result",
"=",
"dict",
"(",
")",
"# TODO: The need to do this and the complexity of managing this kind of",
"# thing throughout the co... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _tool_from_string | Takes a string and returns a corresponding `Tool` instance. | bokeh/plotting/helpers.py | def _tool_from_string(name):
""" Takes a string and returns a corresponding `Tool` instance. """
known_tools = sorted(_known_tools.keys())
if name in known_tools:
tool_fn = _known_tools[name]
if isinstance(tool_fn, string_types):
tool_fn = _known_tools[tool_fn]
return ... | def _tool_from_string(name):
""" Takes a string and returns a corresponding `Tool` instance. """
known_tools = sorted(_known_tools.keys())
if name in known_tools:
tool_fn = _known_tools[name]
if isinstance(tool_fn, string_types):
tool_fn = _known_tools[tool_fn]
return ... | [
"Takes",
"a",
"string",
"and",
"returns",
"a",
"corresponding",
"Tool",
"instance",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/plotting/helpers.py#L544-L561 | [
"def",
"_tool_from_string",
"(",
"name",
")",
":",
"known_tools",
"=",
"sorted",
"(",
"_known_tools",
".",
"keys",
"(",
")",
")",
"if",
"name",
"in",
"known_tools",
":",
"tool_fn",
"=",
"_known_tools",
"[",
"name",
"]",
"if",
"isinstance",
"(",
"tool_fn",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _process_tools_arg | Adds tools to the plot object
Args:
plot (Plot): instance of a plot object
tools (seq[Tool or str]|str): list of tool types or string listing the
tool names. Those are converted using the _tool_from_string
function. I.e.: `wheel_zoom,box_zoom,reset`.
tooltips (string... | bokeh/plotting/helpers.py | def _process_tools_arg(plot, tools, tooltips=None):
""" Adds tools to the plot object
Args:
plot (Plot): instance of a plot object
tools (seq[Tool or str]|str): list of tool types or string listing the
tool names. Those are converted using the _tool_from_string
function.... | def _process_tools_arg(plot, tools, tooltips=None):
""" Adds tools to the plot object
Args:
plot (Plot): instance of a plot object
tools (seq[Tool or str]|str): list of tool types or string listing the
tool names. Those are converted using the _tool_from_string
function.... | [
"Adds",
"tools",
"to",
"the",
"plot",
"object"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/plotting/helpers.py#L584-L638 | [
"def",
"_process_tools_arg",
"(",
"plot",
",",
"tools",
",",
"tooltips",
"=",
"None",
")",
":",
"tool_objs",
"=",
"[",
"]",
"tool_map",
"=",
"{",
"}",
"temp_tool_str",
"=",
"\"\"",
"repeated_tools",
"=",
"[",
"]",
"if",
"isinstance",
"(",
"tools",
",",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _process_active_tools | Adds tools to the plot object
Args:
toolbar (Toolbar): instance of a Toolbar object
tools_map (dict[str]|Tool): tool_map from _process_tools_arg
active_drag (str or Tool): the tool to set active for drag
active_inspect (str or Tool): the tool to set active for inspect
active... | bokeh/plotting/helpers.py | def _process_active_tools(toolbar, tool_map, active_drag, active_inspect, active_scroll, active_tap):
""" Adds tools to the plot object
Args:
toolbar (Toolbar): instance of a Toolbar object
tools_map (dict[str]|Tool): tool_map from _process_tools_arg
active_drag (str or Tool): the tool ... | def _process_active_tools(toolbar, tool_map, active_drag, active_inspect, active_scroll, active_tap):
""" Adds tools to the plot object
Args:
toolbar (Toolbar): instance of a Toolbar object
tools_map (dict[str]|Tool): tool_map from _process_tools_arg
active_drag (str or Tool): the tool ... | [
"Adds",
"tools",
"to",
"the",
"plot",
"object"
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/plotting/helpers.py#L641-L684 | [
"def",
"_process_active_tools",
"(",
"toolbar",
",",
"tool_map",
",",
"active_drag",
",",
"active_inspect",
",",
"active_scroll",
",",
"active_tap",
")",
":",
"if",
"active_drag",
"in",
"[",
"'auto'",
",",
"None",
"]",
"or",
"isinstance",
"(",
"active_drag",
"... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | CustomJS.from_py_func | Create a ``CustomJS`` instance from a Python function. The
function is translated to JavaScript using PScript. | bokeh/models/callbacks.py | def from_py_func(cls, func):
""" Create a ``CustomJS`` instance from a Python function. The
function is translated to JavaScript using PScript.
"""
from bokeh.util.deprecation import deprecated
deprecated("'from_py_func' is deprecated and will be removed in an eventual 2.0 releas... | def from_py_func(cls, func):
""" Create a ``CustomJS`` instance from a Python function. The
function is translated to JavaScript using PScript.
"""
from bokeh.util.deprecation import deprecated
deprecated("'from_py_func' is deprecated and will be removed in an eventual 2.0 releas... | [
"Create",
"a",
"CustomJS",
"instance",
"from",
"a",
"Python",
"function",
".",
"The",
"function",
"is",
"translated",
"to",
"JavaScript",
"using",
"PScript",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/callbacks.py#L85-L106 | [
"def",
"from_py_func",
"(",
"cls",
",",
"func",
")",
":",
"from",
"bokeh",
".",
"util",
".",
"deprecation",
"import",
"deprecated",
"deprecated",
"(",
"\"'from_py_func' is deprecated and will be removed in an eventual 2.0 release. \"",
"\"Use CustomJS directly instead.\"",
")... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | WebSocketClientConnectionWrapper.write_message | Write a message to the websocket after obtaining the appropriate
Bokeh Document lock. | bokeh/client/websocket.py | def write_message(self, message, binary=False, locked=True):
''' Write a message to the websocket after obtaining the appropriate
Bokeh Document lock.
'''
def write_message_unlocked():
if self._socket.protocol is None:
# Tornado is maybe supposed to do this, ... | def write_message(self, message, binary=False, locked=True):
''' Write a message to the websocket after obtaining the appropriate
Bokeh Document lock.
'''
def write_message_unlocked():
if self._socket.protocol is None:
# Tornado is maybe supposed to do this, ... | [
"Write",
"a",
"message",
"to",
"the",
"websocket",
"after",
"obtaining",
"the",
"appropriate",
"Bokeh",
"Document",
"lock",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/client/websocket.py#L62-L86 | [
"def",
"write_message",
"(",
"self",
",",
"message",
",",
"binary",
"=",
"False",
",",
"locked",
"=",
"True",
")",
":",
"def",
"write_message_unlocked",
"(",
")",
":",
"if",
"self",
".",
"_socket",
".",
"protocol",
"is",
"None",
":",
"# Tornado is maybe su... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | BaseResources._collect_external_resources | Collect external resources set on resource_attr attribute of all models. | bokeh/resources.py | def _collect_external_resources(self, resource_attr):
""" Collect external resources set on resource_attr attribute of all models."""
external_resources = []
for _, cls in sorted(Model.model_class_reverse_map.items(), key=lambda arg: arg[0]):
external = getattr(cls, resource_attr, ... | def _collect_external_resources(self, resource_attr):
""" Collect external resources set on resource_attr attribute of all models."""
external_resources = []
for _, cls in sorted(Model.model_class_reverse_map.items(), key=lambda arg: arg[0]):
external = getattr(cls, resource_attr, ... | [
"Collect",
"external",
"resources",
"set",
"on",
"resource_attr",
"attribute",
"of",
"all",
"models",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/resources.py#L155-L171 | [
"def",
"_collect_external_resources",
"(",
"self",
",",
"resource_attr",
")",
":",
"external_resources",
"=",
"[",
"]",
"for",
"_",
",",
"cls",
"in",
"sorted",
"(",
"Model",
".",
"model_class_reverse_map",
".",
"items",
"(",
")",
",",
"key",
"=",
"lambda",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _Settings.py_log_level | Set the log level for python Bokeh code. | bokeh/settings.py | def py_log_level(self, default='none'):
''' Set the log level for python Bokeh code.
'''
level = self._get_str("PY_LOG_LEVEL", default, "debug")
LEVELS = {'trace': logging.TRACE,
'debug': logging.DEBUG,
'info' : logging.INFO,
'warn' ... | def py_log_level(self, default='none'):
''' Set the log level for python Bokeh code.
'''
level = self._get_str("PY_LOG_LEVEL", default, "debug")
LEVELS = {'trace': logging.TRACE,
'debug': logging.DEBUG,
'info' : logging.INFO,
'warn' ... | [
"Set",
"the",
"log",
"level",
"for",
"python",
"Bokeh",
"code",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/settings.py#L275-L287 | [
"def",
"py_log_level",
"(",
"self",
",",
"default",
"=",
"'none'",
")",
":",
"level",
"=",
"self",
".",
"_get_str",
"(",
"\"PY_LOG_LEVEL\"",
",",
"default",
",",
"\"debug\"",
")",
"LEVELS",
"=",
"{",
"'trace'",
":",
"logging",
".",
"TRACE",
",",
"'debug'... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _Settings.secret_key_bytes | Return the secret_key, converted to bytes and cached. | bokeh/settings.py | def secret_key_bytes(self):
''' Return the secret_key, converted to bytes and cached.
'''
if not hasattr(self, '_secret_key_bytes'):
key = self.secret_key()
if key is None:
self._secret_key_bytes = None
else:
self._secret_key_b... | def secret_key_bytes(self):
''' Return the secret_key, converted to bytes and cached.
'''
if not hasattr(self, '_secret_key_bytes'):
key = self.secret_key()
if key is None:
self._secret_key_bytes = None
else:
self._secret_key_b... | [
"Return",
"the",
"secret_key",
"converted",
"to",
"bytes",
"and",
"cached",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/settings.py#L315-L325 | [
"def",
"secret_key_bytes",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_secret_key_bytes'",
")",
":",
"key",
"=",
"self",
".",
"secret_key",
"(",
")",
"if",
"key",
"is",
"None",
":",
"self",
".",
"_secret_key_bytes",
"=",
"None",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
train | _Settings.bokehjssrcdir | The absolute path of the BokehJS source code in the installed
Bokeh source tree. | bokeh/settings.py | def bokehjssrcdir(self):
''' The absolute path of the BokehJS source code in the installed
Bokeh source tree.
'''
if self._is_dev or self.debugjs:
bokehjssrcdir = abspath(join(ROOT_DIR, '..', 'bokehjs', 'src'))
if isdir(bokehjssrcdir):
return bok... | def bokehjssrcdir(self):
''' The absolute path of the BokehJS source code in the installed
Bokeh source tree.
'''
if self._is_dev or self.debugjs:
bokehjssrcdir = abspath(join(ROOT_DIR, '..', 'bokehjs', 'src'))
if isdir(bokehjssrcdir):
return bok... | [
"The",
"absolute",
"path",
"of",
"the",
"BokehJS",
"source",
"code",
"in",
"the",
"installed",
"Bokeh",
"source",
"tree",
"."
] | bokeh/bokeh | python | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/settings.py#L344-L355 | [
"def",
"bokehjssrcdir",
"(",
"self",
")",
":",
"if",
"self",
".",
"_is_dev",
"or",
"self",
".",
"debugjs",
":",
"bokehjssrcdir",
"=",
"abspath",
"(",
"join",
"(",
"ROOT_DIR",
",",
"'..'",
",",
"'bokehjs'",
",",
"'src'",
")",
")",
"if",
"isdir",
"(",
... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.