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