repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bokeh/bokeh | bokeh/util/tornado.py | _CallbackGroup.add_next_tick_callback | def add_next_tick_callback(self, callback, callback_id=None):
""" Adds a callback to be run on the next tick.
Returns an ID that can be used with remove_next_tick_callback."""
def wrapper(*args, **kwargs):
# this 'removed' flag is a hack because Tornado has no way
# to re... | python | def add_next_tick_callback(self, callback, callback_id=None):
""" Adds a callback to be run on the next tick.
Returns an ID that can be used with remove_next_tick_callback."""
def wrapper(*args, **kwargs):
# this 'removed' flag is a hack because Tornado has no way
# to re... | [
"def",
"add_next_tick_callback",
"(",
"self",
",",
"callback",
",",
"callback_id",
"=",
"None",
")",
":",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# this 'removed' flag is a hack because Tornado has no way",
"# to remove a \"next tick\" ... | Adds a callback to be run on the next tick.
Returns an ID that can be used with remove_next_tick_callback. | [
"Adds",
"a",
"callback",
"to",
"be",
"run",
"on",
"the",
"next",
"tick",
".",
"Returns",
"an",
"ID",
"that",
"can",
"be",
"used",
"with",
"remove_next_tick_callback",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/tornado.py#L207-L228 | train | Adds a callback to be run on the next tick. Returns an ID that can be used with remove_next_tick_callback. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/tornado.py | _CallbackGroup.add_timeout_callback | def add_timeout_callback(self, callback, timeout_milliseconds, callback_id=None):
""" Adds a callback to be run once after timeout_milliseconds.
Returns an ID that can be used with remove_timeout_callback."""
def wrapper(*args, **kwargs):
self.remove_timeout_callback(callback_id)
... | python | def add_timeout_callback(self, callback, timeout_milliseconds, callback_id=None):
""" Adds a callback to be run once after timeout_milliseconds.
Returns an ID that can be used with remove_timeout_callback."""
def wrapper(*args, **kwargs):
self.remove_timeout_callback(callback_id)
... | [
"def",
"add_timeout_callback",
"(",
"self",
",",
"callback",
",",
"timeout_milliseconds",
",",
"callback_id",
"=",
"None",
")",
":",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"remove_timeout_callback",
"(",
"callback... | Adds a callback to be run once after timeout_milliseconds.
Returns an ID that can be used with remove_timeout_callback. | [
"Adds",
"a",
"callback",
"to",
"be",
"run",
"once",
"after",
"timeout_milliseconds",
".",
"Returns",
"an",
"ID",
"that",
"can",
"be",
"used",
"with",
"remove_timeout_callback",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/tornado.py#L234-L249 | train | Adds a callback to be run once after timeout_milliseconds. Returns an ID that can be used with remove_timeout_callback. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/tornado.py | _CallbackGroup.add_periodic_callback | def add_periodic_callback(self, callback, period_milliseconds, callback_id=None):
""" Adds a callback to be run every period_milliseconds until it is removed.
Returns an ID that can be used with remove_periodic_callback."""
cb = _AsyncPeriodic(callback, period_milliseconds, io_loop=self._loop)
... | python | def add_periodic_callback(self, callback, period_milliseconds, callback_id=None):
""" Adds a callback to be run every period_milliseconds until it is removed.
Returns an ID that can be used with remove_periodic_callback."""
cb = _AsyncPeriodic(callback, period_milliseconds, io_loop=self._loop)
... | [
"def",
"add_periodic_callback",
"(",
"self",
",",
"callback",
",",
"period_milliseconds",
",",
"callback_id",
"=",
"None",
")",
":",
"cb",
"=",
"_AsyncPeriodic",
"(",
"callback",
",",
"period_milliseconds",
",",
"io_loop",
"=",
"self",
".",
"_loop",
")",
"call... | Adds a callback to be run every period_milliseconds until it is removed.
Returns an ID that can be used with remove_periodic_callback. | [
"Adds",
"a",
"callback",
"to",
"be",
"run",
"every",
"period_milliseconds",
"until",
"it",
"is",
"removed",
".",
"Returns",
"an",
"ID",
"that",
"can",
"be",
"used",
"with",
"remove_periodic_callback",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/tornado.py#L255-L262 | train | Adds a callback to be run every period_milliseconds until it is removed. Returns an ID that can be used with remove_periodic_callback. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/sphinxext/bokeh_github.py | bokeh_commit | def bokeh_commit(name, rawtext, text, lineno, inliner, options=None, content=None):
''' Link to a Bokeh Github issue.
Returns 2 part tuple containing list of nodes to insert into the
document and a list of system messages. Both are allowed to be
empty.
'''
app = inliner.document.settings.env.... | python | def bokeh_commit(name, rawtext, text, lineno, inliner, options=None, content=None):
''' Link to a Bokeh Github issue.
Returns 2 part tuple containing list of nodes to insert into the
document and a list of system messages. Both are allowed to be
empty.
'''
app = inliner.document.settings.env.... | [
"def",
"bokeh_commit",
"(",
"name",
",",
"rawtext",
",",
"text",
",",
"lineno",
",",
"inliner",
",",
"options",
"=",
"None",
",",
"content",
"=",
"None",
")",
":",
"app",
"=",
"inliner",
".",
"document",
".",
"settings",
".",
"env",
".",
"app",
"node... | Link to a Bokeh Github issue.
Returns 2 part tuple containing list of nodes to insert into the
document and a list of system messages. Both are allowed to be
empty. | [
"Link",
"to",
"a",
"Bokeh",
"Github",
"issue",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_github.py#L79-L89 | train | Link to a Bokeh Github issue. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/sphinxext/bokeh_github.py | bokeh_issue | def bokeh_issue(name, rawtext, text, lineno, inliner, options=None, content=None):
''' Link to a Bokeh Github issue.
Returns 2 part tuple containing list of nodes to insert into the
document and a list of system messages. Both are allowed to be
empty.
'''
app = inliner.document.settings.env.a... | python | def bokeh_issue(name, rawtext, text, lineno, inliner, options=None, content=None):
''' Link to a Bokeh Github issue.
Returns 2 part tuple containing list of nodes to insert into the
document and a list of system messages. Both are allowed to be
empty.
'''
app = inliner.document.settings.env.a... | [
"def",
"bokeh_issue",
"(",
"name",
",",
"rawtext",
",",
"text",
",",
"lineno",
",",
"inliner",
",",
"options",
"=",
"None",
",",
"content",
"=",
"None",
")",
":",
"app",
"=",
"inliner",
".",
"document",
".",
"settings",
".",
"env",
".",
"app",
"try",... | Link to a Bokeh Github issue.
Returns 2 part tuple containing list of nodes to insert into the
document and a list of system messages. Both are allowed to be
empty. | [
"Link",
"to",
"a",
"Bokeh",
"Github",
"issue",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_github.py#L91-L111 | train | Link to a Bokeh Github issue. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/sphinxext/bokeh_github.py | bokeh_tree | def bokeh_tree(name, rawtext, text, lineno, inliner, options=None, content=None):
''' Link to a URL in the Bokeh GitHub tree, pointing to appropriate tags
for releases, or to master otherwise.
The link text is simply the URL path supplied, so typical usage might
look like:
.. code-block:: none
... | python | def bokeh_tree(name, rawtext, text, lineno, inliner, options=None, content=None):
''' Link to a URL in the Bokeh GitHub tree, pointing to appropriate tags
for releases, or to master otherwise.
The link text is simply the URL path supplied, so typical usage might
look like:
.. code-block:: none
... | [
"def",
"bokeh_tree",
"(",
"name",
",",
"rawtext",
",",
"text",
",",
"lineno",
",",
"inliner",
",",
"options",
"=",
"None",
",",
"content",
"=",
"None",
")",
":",
"app",
"=",
"inliner",
".",
"document",
".",
"settings",
".",
"env",
".",
"app",
"tag",
... | Link to a URL in the Bokeh GitHub tree, pointing to appropriate tags
for releases, or to master otherwise.
The link text is simply the URL path supplied, so typical usage might
look like:
.. code-block:: none
All of the examples are located in the :bokeh-tree:`examples`
subdirectory o... | [
"Link",
"to",
"a",
"URL",
"in",
"the",
"Bokeh",
"GitHub",
"tree",
"pointing",
"to",
"appropriate",
"tags",
"for",
"releases",
"or",
"to",
"master",
"otherwise",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_github.py#L135-L162 | train | Link to a URL in the Bokeh GitHub tree pointing to appropriate tags
for releases or to master otherwise. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/sphinxext/bokeh_github.py | setup | def setup(app):
''' Required Sphinx extension setup function. '''
app.add_role('bokeh-commit', bokeh_commit)
app.add_role('bokeh-issue', bokeh_issue)
app.add_role('bokeh-pull', bokeh_pull)
app.add_role('bokeh-tree', bokeh_tree) | python | def setup(app):
''' Required Sphinx extension setup function. '''
app.add_role('bokeh-commit', bokeh_commit)
app.add_role('bokeh-issue', bokeh_issue)
app.add_role('bokeh-pull', bokeh_pull)
app.add_role('bokeh-tree', bokeh_tree) | [
"def",
"setup",
"(",
"app",
")",
":",
"app",
".",
"add_role",
"(",
"'bokeh-commit'",
",",
"bokeh_commit",
")",
"app",
".",
"add_role",
"(",
"'bokeh-issue'",
",",
"bokeh_issue",
")",
"app",
".",
"add_role",
"(",
"'bokeh-pull'",
",",
"bokeh_pull",
")",
"app"... | Required Sphinx extension setup function. | [
"Required",
"Sphinx",
"extension",
"setup",
"function",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_github.py#L164-L169 | train | Required Sphinx extension setup function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/sphinxext/bokeh_github.py | _make_gh_link_node | def _make_gh_link_node(app, rawtext, role, kind, api_type, id, options=None):
''' Return a link to a Bokeh Github resource.
Args:
app (Sphinx app) : current app
rawtext (str) : text being replaced with link node.
role (str) : role name
kind (str) : resource type (issue, pull, et... | python | def _make_gh_link_node(app, rawtext, role, kind, api_type, id, options=None):
''' Return a link to a Bokeh Github resource.
Args:
app (Sphinx app) : current app
rawtext (str) : text being replaced with link node.
role (str) : role name
kind (str) : resource type (issue, pull, et... | [
"def",
"_make_gh_link_node",
"(",
"app",
",",
"rawtext",
",",
"role",
",",
"kind",
",",
"api_type",
",",
"id",
",",
"options",
"=",
"None",
")",
":",
"url",
"=",
"\"%s/%s/%s\"",
"%",
"(",
"_BOKEH_GH",
",",
"api_type",
",",
"id",
")",
"options",
"=",
... | Return a link to a Bokeh Github resource.
Args:
app (Sphinx app) : current app
rawtext (str) : text being replaced with link node.
role (str) : role name
kind (str) : resource type (issue, pull, etc.)
api_type (str) : type for api link
id : (str) : id of the resource... | [
"Return",
"a",
"link",
"to",
"a",
"Bokeh",
"Github",
"resource",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_github.py#L177-L195 | train | Return a link node to a Bokeh Github resource. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/document/events.py | DocumentPatchedEvent.dispatch | 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... | python | 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",
")",
":",
"super",
"(",
"DocumentPatchedEvent",
",",
"self",
")",
".",
"dispatch",
"(",
"receiver",
")",
"if",
"hasattr",
"(",
"receiver",
",",
"'_document_patched'",
")",
":",
"receiver",
".",
"_document_patc... | Dispatch handling of this event to a receiver.
This method will invoke ``receiver._document_patched`` if it exists. | [
"Dispatch",
"handling",
"of",
"this",
"event",
"to",
"a",
"receiver",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L118-L126 | train | Dispatch handling of this event to a receiver. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/document/events.py | ModelChangedEvent.dispatch | 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'):
... | python | 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",
")",
":",
"super",
"(",
"ModelChangedEvent",
",",
"self",
")",
".",
"dispatch",
"(",
"receiver",
")",
"if",
"hasattr",
"(",
"receiver",
",",
"'_document_model_changed'",
")",
":",
"receiver",
".",
"_document_m... | Dispatch handling of this event to a receiver.
This method will invoke ``receiver._document_model_dhanged`` if it
exists. | [
"Dispatch",
"handling",
"of",
"this",
"event",
"to",
"a",
"receiver",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L237-L246 | train | Dispatch handling of this event to a receiver. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/document/events.py | ModelChangedEvent.generate | 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... | python | 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",
")",
":",
"from",
".",
".",
"model",
"import",
"collect_models",
"if",
"self",
".",
"hint",
"is",
"not",
"None",
":",
"return",
"self",
".",
"hint",
".",
"generate",
"(",
"references",
... | 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... | [
"Create",
"a",
"JSON",
"representation",
"of",
"this",
"event",
"suitable",
"for",
"sending",
"to",
"clients",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L248-L298 | train | Generates a JSON representation of this event suitable for sending to clients. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/document/events.py | ColumnDataChangedEvent.dispatch | 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... | python | 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",
")",
":",
"super",
"(",
"ColumnDataChangedEvent",
",",
"self",
")",
".",
"dispatch",
"(",
"receiver",
")",
"if",
"hasattr",
"(",
"receiver",
",",
"'_column_data_changed'",
")",
":",
"receiver",
".",
"_column_d... | Dispatch handling of this event to a receiver.
This method will invoke ``receiver._column_data_changed`` if it exists. | [
"Dispatch",
"handling",
"of",
"this",
"event",
"to",
"a",
"receiver",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L337-L345 | train | Dispatch handling of this event to a receiver. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/document/events.py | ColumnDataChangedEvent.generate | 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' ... | python | 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",
")",
":",
"from",
".",
".",
"util",
".",
"serialization",
"import",
"transform_column_source_data",
"data_dict",
"=",
"transform_column_source_data",
"(",
"self",
".",
"column_source",
".",
"data",... | 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>
... | [
"Create",
"a",
"JSON",
"representation",
"of",
"this",
"event",
"suitable",
"for",
"sending",
"to",
"clients",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L347-L384 | train | Generate a JSON representation of this event suitable for sending to Bokeh. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/document/events.py | ColumnsStreamedEvent.dispatch | 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... | python | 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",
")",
":",
"super",
"(",
"ColumnsStreamedEvent",
",",
"self",
")",
".",
"dispatch",
"(",
"receiver",
")",
"if",
"hasattr",
"(",
"receiver",
",",
"'_columns_streamed'",
")",
":",
"receiver",
".",
"_columns_strea... | Dispatch handling of this event to a receiver.
This method will invoke ``receiver._columns_streamed`` if it exists. | [
"Dispatch",
"handling",
"of",
"this",
"event",
"to",
"a",
"receiver",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L434-L442 | train | Dispatch handling of this event to a receiver. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/document/events.py | ColumnsStreamedEvent.generate | 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' ... | python | 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",
")",
":",
"return",
"{",
"'kind'",
":",
"'ColumnsStreamed'",
",",
"'column_source'",
":",
"self",
".",
"column_source",
".",
"ref",
",",
"'data'",
":",
"self",
".",
"data",
",",
"'rollover'... | 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>
... | [
"Create",
"a",
"JSON",
"representation",
"of",
"this",
"event",
"suitable",
"for",
"sending",
"to",
"clients",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L444-L476 | train | Generate a JSON representation of this event suitable for sending to clients. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/document/events.py | ColumnsPatchedEvent.dispatch | 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... | python | 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",
")",
":",
"super",
"(",
"ColumnsPatchedEvent",
",",
"self",
")",
".",
"dispatch",
"(",
"receiver",
")",
"if",
"hasattr",
"(",
"receiver",
",",
"'_columns_patched'",
")",
":",
"receiver",
".",
"_columns_patched... | Dispatch handling of this event to a receiver.
This method will invoke ``receiver._columns_patched`` if it exists. | [
"Dispatch",
"handling",
"of",
"this",
"event",
"to",
"a",
"receiver",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L513-L521 | train | Dispatch handling of this event to a receiver. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/document/events.py | RootAddedEvent.generate | 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... | python | 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",
")",
":",
"references",
".",
"update",
"(",
"self",
".",
"model",
".",
"references",
"(",
")",
")",
"return",
"{",
"'kind'",
":",
"'RootAdded'",
",",
"'model'",
":",
"self",
".",
"model... | 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 ... | [
"Create",
"a",
"JSON",
"representation",
"of",
"this",
"event",
"suitable",
"for",
"sending",
"to",
"clients",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L665-L694 | train | Generate a JSON representation of this event suitable for sending to clients. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/document/events.py | SessionCallbackAdded.dispatch | 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'):
... | python | 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",
")",
":",
"super",
"(",
"SessionCallbackAdded",
",",
"self",
")",
".",
"dispatch",
"(",
"receiver",
")",
"if",
"hasattr",
"(",
"receiver",
",",
"'_session_callback_added'",
")",
":",
"receiver",
".",
"_session... | Dispatch handling of this event to a receiver.
This method will invoke ``receiver._session_callback_added`` if
it exists. | [
"Dispatch",
"handling",
"of",
"this",
"event",
"to",
"a",
"receiver",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L779-L788 | train | Dispatch handling of this event to a receiver. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/document/events.py | SessionCallbackRemoved.dispatch | 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'):
... | python | 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",
")",
":",
"super",
"(",
"SessionCallbackRemoved",
",",
"self",
")",
".",
"dispatch",
"(",
"receiver",
")",
"if",
"hasattr",
"(",
"receiver",
",",
"'_session_callback_removed'",
")",
":",
"receiver",
".",
"_ses... | Dispatch handling of this event to a receiver.
This method will invoke ``receiver._session_callback_removed`` if
it exists. | [
"Dispatch",
"handling",
"of",
"this",
"event",
"to",
"a",
"receiver",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/document/events.py#L811-L820 | train | Dispatch handling of this event to a receiver. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | _setup_support.py | show_bokehjs | 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
... | python | 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",
"(",
")",
"if",
"develop",
":",
"print",
"(",
"\"Installed Bokeh for DEVELOPMENT:\"",
")",
"else",
":",
"print",
"(",
"\"Installed Bokeh:\"",
")",
"if",
"bokehjs_actio... | 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... | [
"Print",
"a",
"useful",
"report",
"after",
"setuptools",
"output",
"describing",
"where",
"and",
"how",
"BokehJS",
"is",
"installed",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L50-L74 | train | Prints a useful report after setuptools output describing where and how BokehJS is installed. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | _setup_support.py | show_help | 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 ... | python | 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",
"(",
")",
"if",
"bokehjs_action",
"in",
"[",
"'built'",
",",
"'installed'",
"]",
":",
"print",
"(",
"\"Bokeh-specific options available with 'install' or 'develop':\"",
")",
"print",
"(",
")",
"print",
... | 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",
"information",
"about",
"extra",
"Bokeh",
"-",
"specific",
"command",
"line",
"options",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L76-L97 | train | Prints information about extra BokehJS - specific command line options. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | _setup_support.py | build_or_install_bokehjs | 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 ... | python | 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",
"(",
")",
":",
"# 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",
"("... | 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... | [
"Build",
"a",
"new",
"BokehJS",
"(",
"and",
"install",
"it",
")",
"or",
"install",
"a",
"previously",
"build",
"BokehJS",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L103-L151 | train | Build a new BokehJS and install it. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | _setup_support.py | fixup_building_sdist | 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... | python | 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",
"(",
")",
":",
"if",
"\"sdist\"",
"in",
"sys",
".",
"argv",
":",
"if",
"\"--install-js\"",
"in",
"sys",
".",
"argv",
":",
"print",
"(",
"\"Removing '--install-js' incompatible with 'sdist'\"",
")",
"sys",
".",
"argv",
".",
"remove"... | 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:
... | [
"Check",
"for",
"sdist",
"and",
"ensure",
"we",
"always",
"build",
"BokehJS",
"when",
"packaging"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L157-L174 | train | Check for sdist and ensure we always build BokehJS when packaging
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | _setup_support.py | fixup_for_packaged | 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... | python | 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",
"exists",
"(",
"join",
"(",
"ROOT",
",",
"'PKG-INFO'",
")",
")",
":",
"if",
"\"--build-js\"",
"in",
"sys",
".",
"argv",
"or",
"\"--install-js\"",
"in",
"sys",
".",
"argv",
":",
"print",
"(",
"SDIST_BUILD_... | 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... | [
"If",
"we",
"are",
"installing",
"FROM",
"an",
"sdist",
"then",
"a",
"pre",
"-",
"built",
"BokehJS",
"is",
"already",
"installed",
"in",
"the",
"python",
"source",
"tree",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L176-L198 | train | Fixup for packaged BokehJS. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | _setup_support.py | get_cmdclass | 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
... | python | 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",
"(",
")",
":",
"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... | 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... | [
"A",
"cmdclass",
"that",
"works",
"around",
"a",
"setuptools",
"deficiency",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L203-L223 | train | A wrapper around versioneer. get_cmdclass that works around a setuptools deficiency. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | _setup_support.py | jsbuild_prompt | 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... | python | 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",
"(",
")",
":",
"print",
"(",
"BOKEHJS_BUILD_PROMPT",
")",
"mapping",
"=",
"{",
"\"1\"",
":",
"True",
",",
"\"2\"",
":",
"False",
"}",
"value",
"=",
"input",
"(",
"\"Choice? \"",
")",
"while",
"value",
"not",
"in",
"mapping",
":",... | Prompt users whether to build a new BokehJS or install an existing one.
Returns:
bool : True, if a new build is requested, False otherwise | [
"Prompt",
"users",
"whether",
"to",
"build",
"a",
"new",
"BokehJS",
"or",
"install",
"an",
"existing",
"one",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L245-L258 | train | Prompt users whether to build a new BokehJS or install an existing BokehJS. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | _setup_support.py | build_js | 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... | python | 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",
"(",
")",
":",
"print",
"(",
"\"Building BokehJS... \"",
",",
"end",
"=",
"\"\"",
")",
"sys",
".",
"stdout",
".",
"flush",
"(",
")",
"os",
".",
"chdir",
"(",
"'bokehjs'",
")",
"cmd",
"=",
"[",
"\"node\"",
",",
"\"make\"",
",",
"'bu... | 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... | [
"Build",
"BokehJS",
"files",
"(",
"CSS",
"JS",
"etc",
")",
"under",
"the",
"bokehjs",
"source",
"subdirectory",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L264-L338 | train | Builds the BokehJS assets under the bokehjs source directory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | _setup_support.py | install_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'),
... | python | 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",
"(",
")",
":",
"target_jsdir",
"=",
"join",
"(",
"SERVER",
",",
"'static'",
",",
"'js'",
")",
"target_cssdir",
"=",
"join",
"(",
"SERVER",
",",
"'static'",
",",
"'css'",
")",
"target_tslibdir",
"=",
"join",
"(",
"SERVER",
",",
"'stat... | Copy built BokehJS files into the Python source tree.
Returns:
None | [
"Copy",
"built",
"BokehJS",
"files",
"into",
"the",
"Python",
"source",
"tree",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/_setup_support.py#L340-L381 | train | Copy built BokehJS files into the Python source tree. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/hex.py | axial_to_cartesian | 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... | python | 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",
")",
":",
"if",
"orientation",
"==",
"\"pointytop\"",
":",
"x",
"=",
"size",
"*",
"np",
".",
"sqrt",
"(",
"3",
")",
"*",
"(",
"q",
"+",... | 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
... | [
"Map",
"axial",
"*",
"(",
"q",
"r",
")",
"*",
"coordinates",
"to",
"cartesian",
"*",
"(",
"x",
"y",
")",
"*",
"coordinates",
"of",
"tiles",
"centers",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/hex.py#L49-L98 | train | Map axial coordinates to cartesian coordinates of the binning of the Bokeh entry. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/hex.py | cartesian_to_axial | 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... | python | 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",
")",
":",
"HEX_FLAT",
"=",
"[",
"2.0",
"/",
"3.0",
",",
"0.0",
",",
"-",
"1.0",
"/",
"3.0",
",",
"np",
".",
"sqrt",
"(",
"3.0",
")",
... | 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 ... | [
"Map",
"Cartesion",
"*",
"(",
"x",
"y",
")",
"*",
"points",
"to",
"axial",
"*",
"(",
"q",
"r",
")",
"*",
"coordinates",
"of",
"enclosing",
"tiles",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/hex.py#L100-L150 | train | Converts a cartesian point to axial coordinates of the enclosing ArcGIS module. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/hex.py | hexbin | 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:
... | python | 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",
")",
":",
"pd",
"=",
"import_required",
"(",
"'pandas'",
",",
"'hexbin requires pandas to be installed'",
")",
"q",
",",
"r",
"=",
"c... | 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... | [
"Perform",
"an",
"equal",
"-",
"weight",
"binning",
"of",
"data",
"points",
"into",
"hexagonal",
"tiles",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/hex.py#L152-L204 | train | Perform an equal - weight binning of data points into hexagonal tiles. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/hex.py | _round_hex | 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
... | python | 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",
")",
":",
"x",
"=",
"q",
"z",
"=",
"r",
"y",
"=",
"-",
"x",
"-",
"z",
"rx",
"=",
"np",
".",
"round",
"(",
"x",
")",
"ry",
"=",
"np",
".",
"round",
"(",
"y",
")",
"rz",
"=",
"np",
".",
"round",
... | 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]) :
... | [
"Round",
"floating",
"point",
"axial",
"hex",
"coordinates",
"to",
"integer",
"*",
"(",
"q",
"r",
")",
"*",
"coordinates",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/hex.py#L214-L249 | train | Round floating point axial hex coordinates to integer * q * r *. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | versioneer.py | versions_from_parentdir | 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... | python | 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",
")",
":",
"rootdirs",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"3",
")",
":",
"dirname",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"root",
")",
"if",
"d... | 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 | [
"Try",
"to",
"determine",
"the",
"version",
"from",
"the",
"parent",
"directory",
"name",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/versioneer.py#L1166-L1188 | train | Try to determine the version from the parent directory name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | versioneer.py | render_pep440_pre | 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... | python | 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",
")",
":",
"if",
"pieces",
"[",
"\"closest-tag\"",
"]",
":",
"rendered",
"=",
"pieces",
"[",
"\"closest-tag\"",
"]",
"if",
"pieces",
"[",
"\"distance\"",
"]",
":",
"rendered",
"+=",
"\".post.dev%d\"",
"%",
"pieces",
... | TAG[.post.devDISTANCE] -- No -dirty.
Exceptions:
1: no tags. 0.post.devDISTANCE | [
"TAG",
"[",
".",
"post",
".",
"devDISTANCE",
"]",
"--",
"No",
"-",
"dirty",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/versioneer.py#L1268-L1281 | train | Render the pep440 pre tag. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/core/property/container.py | List.wrap | 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:
... | python | 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",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"list",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"PropertyValueList",
")",
":",
"return",
"value",
"else",
":",
"return",
"PropertyValueList",
"(",
"value",... | Some property types need to wrap their values in special containers, etc. | [
"Some",
"property",
"types",
"need",
"to",
"wrap",
"their",
"values",
"in",
"special",
"containers",
"etc",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/container.py#L124-L134 | train | Wrap the value in special containers etc. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/core/property/container.py | Dict.wrap | 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:
... | python | 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",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"PropertyValueDict",
")",
":",
"return",
"value",
"else",
":",
"return",
"PropertyValueDict",
"(",
"value",... | Some property types need to wrap their values in special containers, etc. | [
"Some",
"property",
"types",
"need",
"to",
"wrap",
"their",
"values",
"in",
"special",
"containers",
"etc",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/container.py#L193-L203 | train | Wrap the value in special containers etc. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/core/property/container.py | ColumnData.from_json | 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... | python | 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",
")",
":",
"if",
"json",
"is",
"None",
":",
"return",
"None",
"elif",
"not",
"isinstance",
"(",
"json",
",",
"dict",
")",
":",
"raise",
"DeserializationError",
"(",
"\"%s expected a... | Decodes column source data encoded as lists or base64 strings. | [
"Decodes",
"column",
"source",
"data",
"encoded",
"as",
"lists",
"or",
"base64",
"strings",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/container.py#L234-L257 | train | Decodes column source data encoded as lists or base64 strings. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/core/property/container.py | ColumnData.wrap | 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)
... | python | 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",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"PropertyValueColumnData",
")",
":",
"return",
"value",
"else",
":",
"return",
"PropertyValueColumnData",
"("... | Some property types need to wrap their values in special containers, etc. | [
"Some",
"property",
"types",
"need",
"to",
"wrap",
"their",
"values",
"in",
"special",
"containers",
"etc",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/property/container.py#L263-L273 | train | Wrap the value in special containers etc. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/serialization.py | convert_timedelta_type | 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... | python | 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",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"dt",
".",
"timedelta",
")",
":",
"return",
"obj",
".",
"total_seconds",
"(",
")",
"*",
"1000.",
"elif",
"isinstance",
"(",
"obj",
",",
"np",
".",
"timedelta64",
... | Convert any recognized timedelta value to floating point absolute
milliseconds.
Arg:
obj (object) : the object to convert
Returns:
float : milliseconds | [
"Convert",
"any",
"recognized",
"timedelta",
"value",
"to",
"floating",
"point",
"absolute",
"milliseconds",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L136-L150 | train | Convert any recognized timedelta value to floating point absolute
milliseconds. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/serialization.py | convert_datetime_type | 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
... | python | 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",
")",
":",
"# Pandas NaT",
"if",
"pd",
"and",
"obj",
"is",
"pd",
".",
"NaT",
":",
"return",
"np",
".",
"nan",
"# Pandas Period",
"if",
"pd",
"and",
"isinstance",
"(",
"obj",
",",
"pd",
".",
"Period",
")",
":",... | Convert any recognized date, time, or datetime value to floating point
milliseconds since epoch.
Arg:
obj (object) : the object to convert
Returns:
float : milliseconds | [
"Convert",
"any",
"recognized",
"date",
"time",
"or",
"datetime",
"value",
"to",
"floating",
"point",
"milliseconds",
"since",
"epoch",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L152-L193 | train | Convert any recognized date time or datetime value to floating point
milliseconds since epoch. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/serialization.py | convert_datetime_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
'''
... | python | 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",
")",
":",
"if",
"not",
"isinstance",
"(",
"array",
",",
"np",
".",
"ndarray",
")",
":",
"return",
"array",
"try",
":",
"dt2001",
"=",
"np",
".",
"datetime64",
"(",
"'2001'",
")",
"legacy_datetime64",
"=",
"(... | 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",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L195-L238 | train | Convert NumPy datetime arrays to milliseconds since epoch. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/serialization.py | make_id | 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... | python | 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",
"(",
")",
":",
"global",
"_simple_id",
"if",
"settings",
".",
"simple_ids",
"(",
"True",
")",
":",
"with",
"_simple_id_lock",
":",
"_simple_id",
"+=",
"1",
"return",
"str",
"(",
"_simple_id",
")",
"else",
":",
"return",
"make_globally_uniqu... | 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... | [
"Return",
"a",
"new",
"unique",
"ID",
"for",
"a",
"Bokeh",
"object",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L240-L259 | train | Returns a unique ID for a Bokeh object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/serialization.py | transform_array_to_list | 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... | python | 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",
")",
":",
"if",
"(",
"array",
".",
"dtype",
".",
"kind",
"in",
"(",
"'u'",
",",
"'i'",
",",
"'f'",
")",
"and",
"(",
"~",
"np",
".",
"isfinite",
"(",
"array",
")",
")",
".",
"any",
"(",
")",
")",
"... | Transforms a NumPy array into a list of values
Args:
array (np.nadarray) : the NumPy array series to transform
Returns:
list or dict | [
"Transforms",
"a",
"NumPy",
"array",
"into",
"a",
"list",
"of",
"values"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L330-L350 | train | Transforms a NumPy array into a list of values
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/serialization.py | transform_series | 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... | python | 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",
")",
":",
"# 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"... | 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... | [
"Transforms",
"a",
"Pandas",
"series",
"into",
"serialized",
"form"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L352-L384 | train | Transforms a Pandas Series into a list of base64 encoded version of the entry in the tree structure. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/serialization.py | serialize_array | 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 ... | python | 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",
")",
":",
"if",
"isinstance",
"(",
"array",
",",
"np",
".",
"ma",
".",
"MaskedArray",
")",
":",
"array",
"=",
"array",
".",
"filled",
"(",
"np",
"."... | 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 ... | [
"Transforms",
"a",
"NumPy",
"array",
"into",
"serialized",
"form",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L386-L421 | train | Transforms a NumPy array into a serialized form. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/serialization.py | traverse_data | 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... | python | 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",
")",
":",
"if",
"use_numpy",
"and",
"all",
"(",
"isinstance",
"(",
"el",
",",
"np",
".",
"ndarray",
")",
"for",
"el",
"in",
"obj",
")",
":",
"return",
"... | 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... | [
"Recursively",
"traverse",
"an",
"object",
"until",
"a",
"flat",
"list",
"is",
"found",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L423-L456 | train | Recursively traverse an object until a flat list is found. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/serialization.py | transform_column_source_data | 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... | python | 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",
")",
":",
"to_transform",
"=",
"set",
"(",
"data",
")",
"if",
"cols",
"is",
"None",
"else",
"set",
"(",
"cols",
")",
"data_copy",
"=",
"{",
"}",
... | 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... | [
"Transform",
"ColumnSourceData",
"data",
"to",
"a",
"serialized",
"format"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L458-L492 | train | Transform ColumnSourceData to a JSON compatible format | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/serialization.py | encode_binary_dict | 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... | python | 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",
")",
":",
"buffer_id",
"=",
"make_id",
"(",
")",
"buf",
"=",
"(",
"dict",
"(",
"id",
"=",
"buffer_id",
")",
",",
"array",
".",
"tobytes",
"(",
")",
")",
"buffers",
".",
"append",
"(",
"buf",
... | 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' ... | [
"Send",
"a",
"numpy",
"array",
"as",
"an",
"unencoded",
"binary",
"buffer"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L494-L530 | train | Encode a numpy array as an unencoded binary buffer. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/serialization.py | decode_base64_dict | 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... | python | 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",
")",
":",
"b64",
"=",
"base64",
".",
"b64decode",
"(",
"data",
"[",
"'__ndarray__'",
"]",
")",
"array",
"=",
"np",
".",
"copy",
"(",
"np",
".",
"frombuffer",
"(",
"b64",
",",
"dtype",
"=",
"data",
"[",
"'dtyp... | 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 | [
"Decode",
"a",
"base64",
"encoded",
"array",
"into",
"a",
"NumPy",
"array",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/serialization.py#L559-L575 | train | Decode a base64 encoded array into a NumPy array. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/models/tools.py | CustomJSHover.from_py_func | 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
... | python | 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",
")",
":",
"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.\"",... | 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.
... | [
"Create",
"a",
"CustomJSHover",
"instance",
"from",
"a",
"Python",
"functions",
".",
"The",
"function",
"is",
"translated",
"to",
"JavaScript",
"using",
"PScript",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/tools.py#L882-L932 | train | Create a CustomJSHover instance from a Python function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/models/tools.py | CustomJSHover.from_coffeescript | 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`` (... | python | 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",
"=",
"{",
"}",
")",
":",
"compiled",
"=",
"nodejs_compile",
"(",
"code",
",",
"lang",
"=",
"\"coffeescript\"",
",",
"file",
"=",
"\"???\"",
")",
"if",
"\"error\"",
"in",
"compiled",
":",
... | 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... | [
"Create",
"a",
"CustomJSHover",
"instance",
"from",
"a",
"CoffeeScript",
"snippet",
".",
"The",
"function",
"bodies",
"are",
"translated",
"to",
"JavaScript",
"functions",
"using",
"node",
"and",
"therefore",
"require",
"return",
"statements",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/models/tools.py#L935-L962 | train | Create a CustomJSHover instance from a CoffeeScript snippet. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/sphinxext/bokehjs_content.py | setup | 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) | python | 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",
")",
":",
"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. | [
"Required",
"Sphinx",
"extension",
"setup",
"function",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokehjs_content.py#L268-L277 | train | Required Sphinx extension setup function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/sphinxext/bokehjs_content.py | BokehJSContent.get_codeblock_node | 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
... | python | 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",
")",
":",
"# type: () -> List[nodes.Node]",
"document",
"=",
"self",
".",
"state",
".",
"document",
"location",
"=",
"self",
".",
"state_machine",
".",
"get_source_and_line",
"(",
"self",
".... | 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 | [
"this",
"is",
"copied",
"from",
"sphinx",
".",
"directives",
".",
"code",
".",
"CodeBlock",
".",
"run"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokehjs_content.py#L117-L174 | train | returns a node for the code block | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/sphinxext/bokehjs_content.py | BokehJSContent.get_code_language | 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... | python | 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",
")",
":",
"js_source",
"=",
"self",
".",
"get_js_source",
"(",
")",
"if",
"self",
".",
"options",
".",
"get",
"(",
"\"include_html\"",
",",
"False",
")",
":",
"resources",
"=",
"get_sphinx_resources",
"(",
"include_bo... | This is largely copied from bokeh.sphinxext.bokeh_plot.run | [
"This",
"is",
"largely",
"copied",
"from",
"bokeh",
".",
"sphinxext",
".",
"bokeh_plot",
".",
"run"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokehjs_content.py#L196-L209 | train | Returns the code language of the current page. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/embed/standalone.py | autoload_static | 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... | python | 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",
")",
":",
"# 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... | 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... | [
"Return",
"JavaScript",
"code",
"and",
"a",
"script",
"tag",
"that",
"can",
"be",
"used",
"to",
"embed",
"Bokeh",
"Plots",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/standalone.py#L55-L109 | train | Loads the Bokeh Plots from a single model or document. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/embed/standalone.py | components | 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... | python | 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",
")",
":",
"# 1) Convert single items and dicts into list",
"was_single_object",
"=",
"isinstance",
"(",
"models",
",",
"Model",
... | 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 ... | [
"Return",
"HTML",
"components",
"to",
"embed",
"a",
"Bokeh",
"plot",
".",
"The",
"data",
"for",
"the",
"plot",
"is",
"stored",
"directly",
"in",
"the",
"returned",
"HTML",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/standalone.py#L111-L248 | train | Return HTML components to embed a Bokeh plot. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/embed/standalone.py | file_html | 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 ... | python | 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",
"=",
... | 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... | [
"Return",
"an",
"HTML",
"document",
"that",
"embeds",
"Bokeh",
"Model",
"or",
"Document",
"objects",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/standalone.py#L250-L312 | train | Returns an HTML document that embeds a Bokeh Model or Document object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/embed/standalone.py | json_item | 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
... | python | 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",
")",
":",
"with",
"OutputDocumentFor",
"(",
"[",
"model",
"]",
",",
"apply_theme",
"=",
"theme",
")",
"as",
"doc",
":",
"doc",
".",
"title",
"=",
"\"\"",
"... | 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... | [
"Return",
"a",
"JSON",
"block",
"that",
"can",
"be",
"used",
"to",
"embed",
"standalone",
"Bokeh",
"content",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/embed/standalone.py#L314-L383 | train | Return a JSON block that can be used to embed a Bokeh object into a standalone Bokeh document. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/protocol/messages/patch_doc.py | process_document_events | 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... | python | 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",
")",
":",
"json_events",
"=",
"[",
"]",
"references",
"=",
"set",
"(",
")",
"buffers",
"=",
"[",
"]",
"if",
"use_buffers",
"else",
"None",
"for",
"event",
"in",
"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 | [
"Create",
"a",
"JSON",
"string",
"describing",
"a",
"patch",
"to",
"be",
"applied",
"as",
"well",
"as",
"any",
"optional",
"buffers",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/protocol/messages/patch_doc.py#L109-L136 | train | Create a JSON string describing a patch to be applied to make the given updates to obj
. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/server/callbacks.py | PeriodicCallback._copy_with_changed_callback | 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) | python | 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",
")",
":",
"return",
"PeriodicCallback",
"(",
"self",
".",
"_document",
",",
"new_callback",
",",
"self",
".",
"_period",
",",
"self",
".",
"_id",
")"
] | Dev API used to wrap the callback with decorators. | [
"Dev",
"API",
"used",
"to",
"wrap",
"the",
"callback",
"with",
"decorators",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/callbacks.py#L139-L141 | train | Copy the callback with the same parameters. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/server/callbacks.py | TimeoutCallback._copy_with_changed_callback | 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) | python | 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",
")",
":",
"return",
"TimeoutCallback",
"(",
"self",
".",
"_document",
",",
"new_callback",
",",
"self",
".",
"_timeout",
",",
"self",
".",
"_id",
")"
] | Dev API used to wrap the callback with decorators. | [
"Dev",
"API",
"used",
"to",
"wrap",
"the",
"callback",
"with",
"decorators",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/callbacks.py#L171-L173 | train | Copy the timeout callback with the same document and id. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/compiler.py | calc_cache_key | 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... | python | 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",
")",
":",
"model_names",
"=",
"{",
"model",
".",
"full_name",
"for",
"model",
"in",
"custom_models",
".",
"values",
"(",
")",
"}",
"encoded_names",
"=",
"\",\"",
".",
"join",
"(",
"sorted",
"(",
"model_names",
... | 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. | [
"Generate",
"a",
"key",
"to",
"cache",
"a",
"custom",
"extension",
"implementation",
"with",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/compiler.py#L312-L324 | train | Generate a cache key for a list of custom models. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/compiler.py | bundle_models | 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... | python | 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",
")",
":",
"custom_models",
"=",
"_get_custom_models",
"(",
"models",
")",
"if",
"custom_models",
"is",
"None",
":",
"return",
"None",
"key",
"=",
"calc_cache_key",
"(",
"custom_models",
")",
"bundle",
"=",
"_bundle_cache",
... | Create a bundle of selected `models`. | [
"Create",
"a",
"bundle",
"of",
"selected",
"models",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/compiler.py#L328-L343 | train | Create a bundle of selected models. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/compiler.py | _get_custom_models | 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... | python | 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",
")",
":",
"if",
"models",
"is",
"None",
":",
"models",
"=",
"Model",
".",
"model_class_reverse_map",
".",
"values",
"(",
")",
"custom_models",
"=",
"OrderedDict",
"(",
")",
"for",
"cls",
"in",
"models",
":",
"imp... | Returns CustomModels for models with a custom `__implementation__` | [
"Returns",
"CustomModels",
"for",
"models",
"with",
"a",
"custom",
"__implementation__"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/compiler.py#L501-L516 | train | Returns a dict of custom models for models with a custom __implementation__ attribute | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/compiler.py | _compile_models | 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... | python | 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",
")",
":",
"ordered_models",
"=",
"sorted",
"(",
"custom_models",
".",
"values",
"(",
")",
",",
"key",
"=",
"lambda",
"model",
":",
"model",
".",
"full_name",
")",
"custom_impls",
"=",
"{",
"}",
"dependencies",
... | Returns the compiled implementation of supplied `models`. | [
"Returns",
"the",
"compiled",
"implementation",
"of",
"supplied",
"models",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/compiler.py#L518-L542 | train | Returns the compiled implementation of the supplied models. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/util/compiler.py | _bundle_models | 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"... | python | 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",
")",
":",
"exports",
"=",
"[",
"]",
"modules",
"=",
"[",
"]",
"def",
"read_json",
"(",
"name",
")",
":",
"with",
"io",
".",
"open",
"(",
"join",
"(",
"bokehjs_dir",
",",
"\"js\"",
",",
"name",
"+",
"\".j... | Create a JavaScript bundle with selected `models`. | [
"Create",
"a",
"JavaScript",
"bundle",
"with",
"selected",
"models",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/util/compiler.py#L544-L634 | train | Create a JavaScript bundle with selected models. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/command/util.py | die | 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... | python | 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",
"(",
"message",
",",
"file",
"=",
"sys",
".",
"stderr",
")",
"sys",
".",
"exit",
"(",
"status",
")"
] | 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",
"an",
"error",
"message",
"and",
"exit",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/command/util.py#L52-L65 | train | Print an error message and exit. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/command/util.py | build_single_handler_application | 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`... | python | 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",
")",
":",
"argv",
"=",
"argv",
"or",
"[",
"]",
"path",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"path",
")",
"# There are certainly race conditions here if the file/directory is ... | 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... | [
"Return",
"a",
"Bokeh",
"application",
"built",
"using",
"a",
"single",
"handler",
"for",
"a",
"script",
"notebook",
"or",
"directory",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/command/util.py#L77-L139 | train | Build a single Bokeh application using a single handler for a script notebook or directory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/command/util.py | build_single_handler_applications | 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... | python | 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",
")",
":",
"applications",
"=",
"{",
"}",
"argvs",
"=",
"{",
"}",
"or",
"argvs",
"for",
"path",
"in",
"paths",
":",
"application",
"=",
"build_single_handler_application",
"(",... | 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 (... | [
"Return",
"a",
"dictionary",
"mapping",
"routes",
"to",
"Bokeh",
"applications",
"built",
"using",
"single",
"handlers",
"for",
"specified",
"files",
"or",
"directories",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/command/util.py#L141-L177 | train | Returns a dictionary mapping routes to Bokeh applications built using single handlers for specified files or directories. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/command/util.py | report_server_init_errors | 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... | python | 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",
")",
":",
"try",
":",
"yield",
"except",
"EnvironmentError",
"as",
"e",
":",
"if",
"e",
".",
"errno",
"==",
"errno",
".",
"EADDRINUSE",
... | 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... | [
"A",
"context",
"manager",
"to",
"help",
"print",
"more",
"informative",
"error",
"messages",
"when",
"a",
"Server",
"cannot",
"be",
"started",
"due",
"to",
"a",
"network",
"problem",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/command/util.py#L181-L212 | train | A context manager to help print more informative error messages when a Bokeh server cannot be started due to a network problem. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | examples/models/file/trail.py | distance | 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... | python | 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",
")",
":",
"R",
"=",
"6371",
"lat1",
",",
"lon1",
"=",
"p1",
"lat2",
",",
"lon2",
"=",
"p2",
"phi1",
"=",
"radians",
"(",
"lat1",
")",
"phi2",
"=",
"radians",
"(",
"lat2",
")",
"delta_lat",
"=",
"radians",
... | Distance between (lat1, lon1) and (lat2, lon2). | [
"Distance",
"between",
"(",
"lat1",
"lon1",
")",
"and",
"(",
"lat2",
"lon2",
")",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/examples/models/file/trail.py#L29-L42 | train | Distance between two points. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/sphinxext/bokeh_plot.py | setup | 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... | python | 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",
")",
":",
"# 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... | Required Sphinx extension setup function. | [
"Required",
"Sphinx",
"extension",
"setup",
"function",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_plot.py#L212-L222 | train | Required Sphinx extension setup function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/server/util.py | bind_sockets | 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... | python | 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",
")",
":",
"ss",
"=",
"netutil",
".",
"bind_sockets",
"(",
"port",
"=",
"port",
"or",
"0",
",",
"address",
"=",
"address",
")",
"assert",
"len",
"(",
"ss",
")",
"ports",
"=",
"{",
"s",
".",
"getsoc... | 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 ... | [
"Bind",
"a",
"socket",
"to",
"a",
"port",
"on",
"an",
"address",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/util.py#L46-L73 | train | Bind a socket to a port on an address. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/server/util.py | check_whitelist | 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]) :
... | python | 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",
")",
":",
"if",
"':'",
"not",
"in",
"host",
":",
"host",
"=",
"host",
"+",
"':80'",
"if",
"host",
"in",
"whitelist",
":",
"return",
"True",
"return",
"any",
"(",
"match_host",
"(",
"host",
",",
... | 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... | [
"Check",
"a",
"given",
"request",
"host",
"against",
"a",
"whitelist",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/util.py#L75-L99 | train | Checks a given request host against a whitelist. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/server/util.py | match_host | 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... | python | 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",
")",
":",
"if",
"':'",
"in",
"host",
":",
"host",
",",
"host_port",
"=",
"host",
".",
"rsplit",
"(",
"':'",
",",
"1",
")",
"else",
":",
"host_port",
"=",
"None",
"if",
"':'",
"in",
"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.
This function will return ``True`` if the ... | [
"Match",
"a",
"host",
"string",
"against",
"a",
"pattern"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/util.py#L164-L240 | train | Match a host string against a pattern. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/io/state.py | State.notebook_type | 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... | python | 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",
")",
":",
"if",
"notebook_type",
"is",
"None",
"or",
"not",
"isinstance",
"(",
"notebook_type",
",",
"string_types",
")",
":",
"raise",
"ValueError",
"(",
"\"Notebook type must be a string\"",
")",
"self",... | Notebook type, acceptable values are 'jupyter' as well as any names
defined by external notebook hooks that have been installed. | [
"Notebook",
"type",
"acceptable",
"values",
"are",
"jupyter",
"as",
"well",
"as",
"any",
"names",
"defined",
"by",
"external",
"notebook",
"hooks",
"that",
"have",
"been",
"installed",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/state.py#L124-L131 | train | Sets the notebook type acceptable values are jupyter and any names
defined by external notebook hooks that have been installed. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/io/state.py | State.output_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... | python | 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",
")",
":",
"self",
".",
"_file",
"=",
"{",
"'filename'",
":",
"filename",
",",
"'resources'",
":",
"Resourc... | 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:
... | [
"Configure",
"output",
"to",
"a",
"standalone",
"HTML",
"file",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/state.py#L135-L171 | train | Configure output to a standalone HTML file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/io/saving.py | save | 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
... | python | 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",
")",
":",
"if",
"state",
"is",
"None",
":",
"stat... | 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... | [
"Save",
"an",
"HTML",
"file",
"with",
"the",
"data",
"for",
"the",
"current",
"document",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/saving.py#L50-L87 | train | Save an HTML file with the data for the current document. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/sphinxext/bokeh_sitemap.py | html_page_context | 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") | python | 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",
")",
":",
"site",
"=",
"context",
"[",
"'SITEMAP_BASE_URL'",
"]",
"version",
"=",
"context",
"[",
"'version'",
"]",
"app",
".",
"sitemap_links",
"."... | Collect page names for the sitemap as HTML pages are built. | [
"Collect",
"page",
"names",
"for",
"the",
"sitemap",
"as",
"HTML",
"pages",
"are",
"built",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_sitemap.py#L58-L64 | train | Add the sitemap page name to the sitemap_links list. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/sphinxext/bokeh_sitemap.py | build_finished | 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... ',
... | python | 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",
")",
":",
"filename",
"=",
"join",
"(",
"app",
".",
"outdir",
",",
"\"sitemap.txt\"",
")",
"links_iter",
"=",
"status_iterator",
"(",
"sorted",
"(",
"app",
".",
"sitemap_links",
")",
",",
"'adding links ... | Generate a ``sitemap.txt`` from the collected HTML page links. | [
"Generate",
"a",
"sitemap",
".",
"txt",
"from",
"the",
"collected",
"HTML",
"page",
"links",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_sitemap.py#L66-L83 | train | Generate a sitemap. txt from the collected HTML page links. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/sphinxext/bokeh_sitemap.py | setup | 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() | python | 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",
")",
":",
"app",
".",
"connect",
"(",
"'html-page-context'",
",",
"html_page_context",
")",
"app",
".",
"connect",
"(",
"'build-finished'",
",",
"build_finished",
")",
"app",
".",
"sitemap_links",
"=",
"set",
"(",
")"
] | Required Sphinx extension setup function. | [
"Required",
"Sphinx",
"extension",
"setup",
"function",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_sitemap.py#L85-L89 | train | Required Sphinx extension setup function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/server/tornado.py | BokehTornado.initialize | 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... | python | 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",
")",
":",
"self",
".",
"_loop",
"=",
"io_loop",
"for",
"app_context",
"in",
"self",
".",
"_applications",
".",
"values",
"(",
")",
":",
"app_context",
".",
"_loop",
"=",
"self",
".",
"_loop",
"self",
".... | Start a Bokeh Server Tornado Application on a given Tornado IOLoop. | [
"Start",
"a",
"Bokeh",
"Server",
"Tornado",
"Application",
"on",
"a",
"given",
"Tornado",
"IOLoop",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/tornado.py#L319-L346 | train | Initialize the internal state of the object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/server/tornado.py | BokehTornado.resources | 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,
... | python | 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",
")",
":",
"if",
"absolute_url",
":",
"return",
"Resources",
"(",
"mode",
"=",
"\"server\"",
",",
"root_url",
"=",
"absolute_url",
"+",
"self",
".",
"_prefix",
",",
"path_versioner",
"=",
"S... | 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) | [
"Provide",
"a",
":",
"class",
":",
"~bokeh",
".",
"resources",
".",
"Resources",
"that",
"specifies",
"where",
"Bokeh",
"application",
"sessions",
"should",
"load",
"BokehJS",
"resources",
"from",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/tornado.py#L411-L423 | train | Provides a : class : ~bokeh. resources. Resources that provides BokehJS resources from. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/server/tornado.py | BokehTornado.start | 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... | python | 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",
")",
":",
"self",
".",
"_stats_job",
".",
"start",
"(",
")",
"if",
"self",
".",
"_mem_job",
"is",
"not",
"None",
":",
"self",
".",
"_mem_job",
".",
"start",
"(",
")",
"self",
".",
"_cleanup_job",
".",
"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. | [
"Start",
"the",
"Bokeh",
"Server",
"application",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/tornado.py#L425-L441 | train | Start the Bokeh Server Tornado application. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/server/tornado.py | BokehTornado.stop | 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 ... | python | 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",
")",
":",
"# TODO should probably close all connections and shut down all sessions here",
"for",
"context",
"in",
"self",
".",
"_applications",
".",
"values",
"(",
")",
":",
"context",
".",
"run_unload_hook",
"("... | Stop the Bokeh Server application.
Args:
wait (bool): whether to wait for orderly cleanup (default: True)
Returns:
None | [
"Stop",
"the",
"Bokeh",
"Server",
"application",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/tornado.py#L443-L465 | train | Stop the Bokeh Server application. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/server/tornado.py | BokehTornado.get_session | 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) :
... | python | 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",
")",
":",
"if",
"app_path",
"not",
"in",
"self",
".",
"_applications",
":",
"raise",
"ValueError",
"(",
"\"Application %s does not exist on this server\"",
"%",
"app_path",
")",
"return",
"self... | 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... | [
"Get",
"an",
"active",
"a",
"session",
"by",
"name",
"application",
"path",
"and",
"session",
"ID",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/tornado.py#L476-L493 | train | Returns an active session by name application path and session ID. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/server/tornado.py | BokehTornado.get_sessions | 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]
'''
... | python | 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",
")",
":",
"if",
"app_path",
"not",
"in",
"self",
".",
"_applications",
":",
"raise",
"ValueError",
"(",
"\"Application %s does not exist on this server\"",
"%",
"app_path",
")",
"return",
"list",
"(",
"self",
... | 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",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/server/tornado.py#L495-L509 | train | Returns all currently active sessions for an application. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/core/validation/decorators.py | _validator | 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... | python | 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",
")",
":",
"if",
"validator_type",
"==",
"\"error\"",
":",
"from",
".",
"errors",
"import",
"codes",
"from",
".",
"errors",
"import",
"EXT",
"elif",
"validator_type",
"==",
"\"warning\"",
":",
"fr... | 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 | [
"Internal",
"shared",
"implementation",
"to",
"handle",
"both",
"error",
"and",
"warning",
"validation",
"checks",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/validation/decorators.py#L44-L80 | train | Internal helper function to handle both error and warning validation checks. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/core/query.py | find | 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... | python | 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",
")",
":",
"return",
"(",
"obj",
"for",
"obj",
"in",
"objs",
"if",
"match",
"(",
"obj",
",",
"selector",
",",
"context",
")",
")"
] | 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... | [
"Query",
"a",
"collection",
"of",
"Bokeh",
"models",
"and",
"yield",
"any",
"that",
"match",
"the",
"a",
"selector",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/query.py#L52-L87 | train | Query a collection of Bokeh models and yield any that match the
a selector. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/core/query.py | match | 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... | python | 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",
")",
":",
"context",
"=",
"context",
"or",
"{",
"}",
"for",
"key",
",",
"val",
"in",
"selector",
".",
"items",
"(",
")",
":",
"# test attributes",
"if",
"isinstance",
"(",
"key... | 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... | [
"Test",
"whether",
"a",
"given",
"Bokeh",
"model",
"matches",
"a",
"given",
"selector",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/core/query.py#L89-L211 | train | Test whether a given object matches a given selector. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/sphinxext/bokeh_gallery.py | setup | 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) | python | 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",
")",
":",
"app",
".",
"add_config_value",
"(",
"'bokeh_gallery_dir'",
",",
"join",
"(",
"\"docs\"",
",",
"\"gallery\"",
")",
",",
"'html'",
")",
"app",
".",
"connect",
"(",
"'config-inited'",
",",
"config_inited_handler",
")",
"ap... | Required Sphinx extension setup function. | [
"Required",
"Sphinx",
"extension",
"setup",
"function",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_gallery.py#L124-L128 | train | Required Sphinx extension setup function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/io/util.py | default_filename | 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... | python | 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",
")",
":",
"if",
"ext",
"==",
"\"py\"",
":",
"raise",
"RuntimeError",
"(",
"\"asked for a default filename with 'py' extension\"",
")",
"filename",
"=",
"detect_current_filename",
"(",
")",
"if",
"filename",
"is",
"None",
":",
... | 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... | [
"Generate",
"a",
"default",
"filename",
"with",
"a",
"given",
"extension",
"attempting",
"to",
"use",
"the",
"filename",
"of",
"the",
"currently",
"running",
"process",
"if",
"possible",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/util.py#L50-L82 | train | Generate a default filename with a given extension. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/io/util.py | detect_current_filename | 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') != '_... | python | 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",
"(",
")",
":",
"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
Returns None if the filename cannot be detected. | [
"Attempt",
"to",
"return",
"the",
"filename",
"of",
"the",
"currently",
"running",
"Python",
"process"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/util.py#L84-L101 | train | Attempt to return the filename of the currently running Python process
Returns None if the filename cannot be detected. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/io/util.py | _no_access | 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) | python | 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",
")",
":",
"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 | [
"Return",
"True",
"if",
"the",
"given",
"base",
"dir",
"is",
"not",
"accessible",
"or",
"writeable"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/util.py#L113-L118 | train | Return True if the given base dir is not accessible or writeable | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/io/util.py | _shares_exec_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)) | python | 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",
")",
":",
"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 | [
"Whether",
"a",
"give",
"base",
"directory",
"is",
"on",
"the",
"system",
"exex",
"prefix"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/io/util.py#L120-L126 | train | Whether a give base directory is on the system exex prefix
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/sphinxext/bokeh_palette_group.py | setup | 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) | python | 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",
")",
":",
"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. | [
"Required",
"Sphinx",
"extension",
"setup",
"function",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/sphinxext/bokeh_palette_group.py#L100-L103 | train | Required Sphinx extension setup function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/command/subcommands/file_output.py | FileOutputSubcommand.other_args | 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... | python | 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",
"(",
"(",
"(",
"'-o'",
",",
"'--output'",
")",
",",
"dict",
"(",
"metavar",
"=",
"'FILENAME'",
",",
"action",
"=",
"'append'",
",",
"type",
"=",
"str",
",",
"help",
"=",
"\"Name of the output file or -... | 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... | [
"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",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/command/subcommands/file_output.py#L89-L124 | train | Return args for the other command line args for the specified base class. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/plotting/helpers.py | _pop_colors_and_alpha | 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... | python | 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",
")",
":",
"result",
"=",
"dict",
"(",
")",
"# TODO: The need to do this and the complexity of managing this kind of",
"# thing throughout the co... | 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. | [
"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... | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/plotting/helpers.py#L286-L315 | train | Given a kwargs dict and a prefix and a default value looks for different
color and alpha fields of the given prefix and fills in the default value
alpha is 1. 0. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/plotting/helpers.py | _tool_from_string | 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 ... | python | 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",
")",
":",
"known_tools",
"=",
"sorted",
"(",
"_known_tools",
".",
"keys",
"(",
")",
")",
"if",
"name",
"in",
"known_tools",
":",
"tool_fn",
"=",
"_known_tools",
"[",
"name",
"]",
"if",
"isinstance",
"(",
"tool_fn",
... | Takes a string and returns a corresponding `Tool` instance. | [
"Takes",
"a",
"string",
"and",
"returns",
"a",
"corresponding",
"Tool",
"instance",
"."
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/plotting/helpers.py#L544-L561 | train | Takes a string and returns a corresponding Tool instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
bokeh/bokeh | bokeh/plotting/helpers.py | _process_tools_arg | 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.... | python | 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",
")",
":",
"tool_objs",
"=",
"[",
"]",
"tool_map",
"=",
"{",
"}",
"temp_tool_str",
"=",
"\"\"",
"repeated_tools",
"=",
"[",
"]",
"if",
"isinstance",
"(",
"tools",
",",
... | 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... | [
"Adds",
"tools",
"to",
"the",
"plot",
"object"
] | dc8cf49e4e4302fd38537ad089ece81fbcca4737 | https://github.com/bokeh/bokeh/blob/dc8cf49e4e4302fd38537ad089ece81fbcca4737/bokeh/plotting/helpers.py#L584-L638 | train | Adds tools to the object tree. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.