Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
__all__ = ['GroupedInnotation', 'RepeatInnotation']
from ipywidgets import HBox, VBox, Button
from .data import Innotation
from .mixins import ChildrenChangeNotifierMixin
class GroupedInnotation(Innotation):
def __init__(self, *args, **kwargs):
super().__init__(**kwargs)
self.childinnotations = args
def post_register(self, datamanager):
for innot in self.childinnotations:
innot.post_register(datamanager)
def post_widget_create(self, datamanager):
for innot in self.childinnotations:
innot.post_widget_create(datamanager)
def _create_widget(self):
def __init__(self, inputs, targets, indexes=None):
if inputs is None: inputs = []
if targets is None: targets = []
self.inputs = [inputs] if isinstance(inputs, Innotation) else inputs
self.targets = [targets] if isinstance(targets, Innotation) else targets
self.alldws = {}
l = -1
for dw in self.inputs+self.targets:
l = self._add_to_alldws(dw, l)
self.underlying_len = l
self.indexes = indexes
if indexes is not None:
if len(indexes) == 0:
raise Exception("indexes must be a non-empty array-like containing integers or booleans")
# boolean or numpy.bool_ - and might be a col vector
def __init__(self, inputs, targets, indexes=None):
if inputs is None: inputs = []
if targets is None: targets = []
self.inputs = [inputs] if isinstance(inputs, Innotation) else inputs
self.targets = [targets] if isinstance(targets, Innotation) else targets
self.alldws = {}
l = -1
for dw in self.inputs+self.targets:
l = self._add_to_alldws(dw, l)
self.underlying_len = l
self.indexes = indexes
if indexes is not None:
if len(indexes) == 0:
raise Exception("indexes must be a non-empty array-like containing integers or booleans")