def _status_setter(self, status):
    event = (status if isinstance(status, ComponentEvent) else ComponentEvent(status, self))
    if (event.status in self._dependent_statuses):
        children = set(filter((lambda c: isinstance(c, Component)), self.children))
        ready = set(filter((lambda c: c.hasstatus(event.status)), children))
        if (len(children) > len(ready)):
            if ('events' in self._debug):
                pending = ', '.join((c.id for c in children.difference(ready)))
                self.debug(f'Status "{event.status}" waiting on {pending}')
            return
    if (self.hasstatus('aborted') and (event.status != 'exited')):
        if ('events' in self._debug):
            self.debug(f'Ignoring status "{event.status}" because the component is in aborted state')
        return
    if ('events' in self._debug):
        self.debug(f'Emitting event "{event.id}"')
    self._status = event.status
    _events[event.id].set()
    for queue in _event_queues:
        queue.put_nowait(event)
    if (self.parent and (event.status != 'aborted') and (not isinstance(self, LocalEvents))):
        self.parent.status = event.status
    for callback in _event_callbacks[event.id]:
        asyncio.ensure_future(callback())
    _event_callbacks[event.id].clear()
def _status_setter(self, status):
    event = (status if isinstance(status, ComponentEvent) else ComponentEvent(status, self))
    if (event.status in self._dependent_statuses):
        children = set(filter((lambda c: isinstance(c, Component)), self.children))
        ready = set(filter((lambda c: c.hasstatus(event.status)), children))
        if (len(children) > len(ready)):
            if ('events' in self._debug):
                pending = ', '.join((c.id for c in children.difference(ready)))
                self.debug(f'Status "{event.status}" waiting on {pending}')
            return
    if (self.hasstatus('aborted') and (event.status != 'exited')):
        if ('events' in self._debug):
            self.debug(f'Ignoring status "{event.status}" because the component is in aborted state')
        return
    if ('events' in self._debug):
        self.debug(f'Emitting event "{event.id}"')
    self._status = event.status
    _events[event.id].set()
    for queue in _event_queues:
        queue.put_nowait(event)
    if (self.parent and (event.status != 'aborted') and (not isinstance(self, LocalEvents))):
        self.parent.status = event.status
    for callback in _event_callbacks[event.id]:
        asyncio.ensure_future(callback())
    _event_callbacks[event.id].clear()