overrridden in Kwc_Root_Category_GeneratorEvents
321289
protected function _getComponentsFromRow($row, $select)
    {
        $idColumn = $this->_getGenerator()->getIdColumn();
        if ($this->_getGenerator()->hasSetting('dbIdShortcut') && $this->_getGenerator()->getSetting('dbIdShortcut')) {
            $dbId = $this->_getGenerator()->getSetting('dbIdShortcut') .
                $row->$idColumn;
            $ret = Kwf_Component_Data_Root::getInstance()->getComponentsByDbId($dbId, $select);
        } else if ($row->getModel()->hasColumn('component_id')) {
            $dbId = $row->component_id .
                $this->_getGenerator()->getIdSeparator() .
                $row->$idColumn;
            $ret = Kwf_Component_Data_Root::getInstance()->getComponentsByDbId($dbId, $select);
        } else {
            $cls = $this->_getClassFromRowFromGenerator($row);
            $select['id'] = $this->_getGenerator()->getIdSeparator().$row->$idColumn;
            $ret = Kwf_Component_Data_Root::getInstance()
                ->getComponentsBySameClass($cls, $select);
        }
        foreach ($ret as $k=>$i) {
            if ($i->generator !== $this->_getGenerator()) {
                unset($ret[$k]);
            }
        }
        return array_values($ret);
    }
719060
public static function afterDuplicate(Kwf_Component_Data $rootSource, Kwf_Component_Data $rootTarget)
    {
        foreach (Kwf_Component_Abstract::getComponentClasses() as $c) {
            $admin = Kwf_Component_Abstract_Admin::getInstance($c);
            $admin->afterDuplicate($rootSource, $rootTarget);
        }
    }
785790
def event_gen(
            self, timeout_s=None, yield_nones=True, filter_predicate=None,
            terminal_events=_DEFAULT_TERMINAL_EVENTS):
        

        # We will either return due to the optional filter or because of a
        # timeout. The former will always set this. The latter will never set
        # this.
        self.__last_success_return = None

        last_hit_s = time.time()
        while True:
            block_duration_s = self.__get_block_duration()

            # Poll, but manage signal-related errors.

            try:
                events = self.__epoll.poll(block_duration_s)
            except IOError as e:
                if e.errno != EINTR:
                    raise

                if timeout_s is not None:
                    time_since_event_s = time.time() - last_hit_s
                    if time_since_event_s > timeout_s:
                        break

                continue

            # Process events.

            for fd, event_type in events:
                # (fd) looks to always match the inotify FD.

                names = self._get_event_names(event_type)
                _LOGGER.debug("Events received from epoll: {}".format(names))

                for (header, type_names, path, filename) \
                        in self._handle_inotify_event(fd):
                    last_hit_s = time.time()

                    e = (header, type_names, path, filename)
                    for type_name in type_names:
                        if filter_predicate is not None and \
                           filter_predicate(type_name, e) is False:
                             self.__last_success_return = (type_name, e)
                             return
                        elif type_name in terminal_events:
                            raise TerminalEventException(type_name, e)

                    yield e

            if timeout_s is not None:
                time_since_event_s = time.time() - last_hit_s
                if time_since_event_s > timeout_s:
                    break

            if yield_nones is True:
                yield None
104263
def all_generators(self):
        
        for arg_gen in self.arg_gens:
            yield arg_gen

        for kwarg_gen in self.kwarg_gens.values():
            yield kwarg_gen
328818
@Override
    public void fireAddAppenderEvent(Category logger, Appender appender) {
        if (listeners != null) {
            HierarchyEventListener listener;
            for (Iterator<HierarchyEventListener> it = listeners.iterator(); it
                    .hasNext();) {
                listener = it.next();
                listener.addAppenderEvent(logger, appender);
            }
        }
    }
157316
def override_build_kwarg(workflow, k, v, platform=None):
    
    key = OrchestrateBuildPlugin.key
    # Use None to indicate an override for all platforms

    workspace = workflow.plugin_workspace.setdefault(key, {})
    override_kwargs = workspace.setdefault(WORKSPACE_KEY_OVERRIDE_KWARGS, {})
    override_kwargs.setdefault(platform, {})
    override_kwargs[platform][k] = v
753272
private static void validateGeneration(int generation) {
    if (generation == CONTEXT_DEPTH_WARN_THRESH) {
      log.log(
          Level.SEVERE,
          "Context ancestry chain length is abnormally long. "
              + "This suggests an error in application code. "
              + "Length exceeded: " + CONTEXT_DEPTH_WARN_THRESH,
          new Exception());
    }
  }
1286240
def reset_input_generators(self, seed):
        
        seed_generator = SeedGenerator().reset(seed=seed)

        for gen in self.input_generators:
            gen.reset(next(seed_generator))
            try:
                # In case `gen` is itself a derived generator,
                # recursively reset its own input generators.
                gen.reset_input_generators(next(seed_generator))
            except AttributeError:
                pass
415931
function overrideLunrTokenizer() {

		var origTokenizer = lunr.tokenizer;
		var rSeparators = /[-./#_,;\(\)=><|]/g;

		lunr.tokenizer = function(str) {
			return origTokenizer.call(lunr, str).reduce( function (result, token) {
				if ( rSeparators.test(token) ) {
					token = token.replace(rSeparators, " ");
					result.push.apply(result, token.toLowerCase().split(/ +/));
				} else {
					result.push(token.toLowerCase());
				}
				return result;
			}, []);
		};
		Object.keys(origTokenizer).forEach(function (key) {
			lunr.tokenizer[key] = origTokenizer[key];
		});
	}
592097
protected function removeOveriddenEvents()
	{
		// Events need to be sorted by date and id (both ascending) in order for overridden occurrences not to show
		$this->sort();

		$events = array();

		// New events array is created with the occurrence overrides replacing the relevant occurrences
		array_walk($this->allEvents, function ($event) use (&$events) {
			if ($event->getOccurrenceDate()) {
			    $events[$event->getOccurrenceDate()->format('Y-m-d H:i:s').'.'.($event->getParentId() ?: $event->getId())] = $event;
			} elseif (!isset($events[$event->getStartDate()->format('Y-m-d H:i:s').'.'.($event->getParentId() ?: $event->getId())])) {
			    $events[$event->getStartDate()->format('Y-m-d H:i:s').'.'.($event->getParentId() ?: $event->getId())] = $event;
			}
		});

		$this->allEvents = $events;
	}
537748
def fix_config(self, options):
        
        opt = "setup"
        if opt not in options:
            options[opt] = datagen.DataGenerator(classname="weka.datagenerators.classifiers.classification.Agrawal")
        if opt not in self.help:
            self.help[opt] = "The data generator to use (DataGenerator)."

        opt = "incremental"
        if opt not in options:
            options[opt] = False
        if opt not in self.help:
            self.help[opt] = "Whether to output the data incrementally, in case the generator supports that (bool)."

        return super(DataGenerator, self).fix_config(options)
218065
def attr_category_postprocess(get_attr_category_func):
    """"""
    @functools.wraps(get_attr_category_func)
    def wrapped(
        name: str, attr: Any, obj: Any
    ) -> Tuple[AttrCategory, ...]:
        category = get_attr_category_func(name, attr, obj)
        category = list(category) if isinstance(category, tuple) else [category]
        if is_slotted_attr(obj, name):
            # Refactoring all tuples to lists is not easy
            # and pleasant. Maybe do this in future if necessary
            category.append(AttrCategory.SLOT)
        return tuple(category)

    return wrapped
1165779
function Generator(sOutputFolder, bPrettyPrint) {
	if (!(this instanceof Generator)) {
		return new Generator(sOutputFolder, bPrettyPrint);
	}
	this._sOutputFolder = sOutputFolder;
	this._bPrettyPrint = bPrettyPrint;
	events.EventEmitter.call(this);
}
304350
def attach_events(self, *events, **kwargs):
        """"""
        reg = self.registry
        insert = 'insert' in kwargs
        for e in events:
            cregexp = e.compile(self.config)
            regexp = getattr(e.regexp, 're', e.regexp)
            if regexp not in reg.events[e.iotype]:
                if insert:
                    reg.events_re[e.iotype].insert(0, (regexp, cregexp))
                else:
                    reg.events_re[e.iotype].append((regexp, cregexp))
            if insert:
                reg.events[e.iotype][regexp].insert(0, e)
            else:
                reg.events[e.iotype][regexp].append(e)
761624
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
        if ("FINISHED".equals(EVENT_TYPE)) {
            if ( gauge.isHighlightSections() ) {
                redraw();
            }
        } else if ("VISIBILITY".equals(EVENT_TYPE)) {
            Helper.enableNode(ledCanvas, gauge.isLedVisible());
            Helper.enableNode(titleText, !gauge.getTitle().isEmpty());
            Helper.enableNode(unitText, !gauge.getUnit().isEmpty());
            Helper.enableNode(valueText, gauge.isValueVisible());
            Helper.enableNode(lcd, (gauge.isLcdVisible() && gauge.isValueVisible()));
            Helper.enableNode(barHighlight, gauge.isBarEffectEnabled());
            resize();
            redraw();
        } else if ("LED".equals(EVENT_TYPE)) {
            if (gauge.isLedVisible()) { drawLed(); }
        } else if ("LCD".equals(EVENT_TYPE)) {
            if (gauge.isLcdVisible()) redraw();
        } else if ("SECTION".equals(EVENT_TYPE)) {
            sections = gauge.getSections();
            areas    = gauge.getAreas();
            resize();
            redraw();
        } else if ("RECALC".equals(EVENT_TYPE)) {
            orientation = gauge.getOrientation();
            if (Orientation.VERTICAL == orientation) {
                width    = height / aspectRatio;
//                stepSize = Math.abs(0.67143 * height / gauge.getRange());
            } else {
                height   = width / aspectRatio;
//                stepSize = Math.abs(0.75 * width / gauge.getRange());
            }
            resize();
            redraw();
        }
    }
1210275
protected function setGeneratorCategories()
    {
        $this->logger->debug('Base:setGeneratorCategories');
        $this->setParam('generator', 'categories');
        $this->setParam('gclprop', 'hidden|timestamp');
        $this->setParam('gcllimit', $this->getLimit());
    }
1329950
def appliesToEvent(self, event):
        '''  '''
        return (
            event in self.individualEvents.all() or
            event.session in self.eventSessions.all() or
            event.category in self.seriesCategories.all() or
            event.category in self.eventCategories.all()
        )