Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if extension and not getattr(_hv.extension, '_loaded', False):
_hv.extension(extension, logo=logo)
def _patch_doc(cls, kind):
method = getattr(cls, kind)
docstring = _get_doc(cls, kind, get_ipy())
if sys.version_info.major == 2:
method.__func__.__doc__ = docstring
else:
method.__doc__ = docstring
# Patch docstrings
for cls in [hvPlot, hvPlotTabular]:
for _kind in HoloViewsConverter._kind_mapping:
if hasattr(cls, _kind):
_patch_doc(cls, _kind)
def __getattribute__(self, name):
"""
Custom getattribute to expose user defined subplots.
"""
plots = object.__getattribute__(self, '_plots')
if name in plots:
plot_opts = plots[name]
if 'kind' in plot_opts and name in HoloViewsConverter._kind_mapping:
param.main.warning("Custom options for existing plot types should not "
"declare the 'kind' argument. The .%s plot method "
"was unexpectedly customized with kind=%r."
% (plot_opts['kind'], name))
plot_opts['kind'] = name
return hvPlotBase(self._data, **dict(self._metadata, **plot_opts))
return super(hvPlotBase, self).__getattribute__(name)