def register(self, task):
        assert self._startup
        assert task not in self._group_index
        assert isinstance(task, Runnable)

        log.trace("Registering task %s", task)

        task_deps = task.getAllDependencies()
        all_groups = chain.from_iterable(self._group_index[d]
                                         for d in task_deps)
        groups = set(g for g in all_groups if g.repeat == task.repeat)

        update_index = set(task_deps)
        update_index.add(task)

        if not groups:
            group = RunnableGroup([task], task.repeat)
            self._update_stats(group)
            self._registered.add(group)
            log.trace("Created group %s", group)
        else:
            group = groups.pop()
            group.addDependency(task)
            log.trace("Updated group %s", group)
            for extra_group in groups:
                self._update_stats(extra_group, -1)
                self._registered.remove(extra_group)
                group.addDependencies(extra_group)
                update_index.update(extra_group.getAllDependencies())
                log.trace("Merged group %s", extra_group)

        for runnable in update_index:
            # If the group set is empty this runnable is new, count it.
            if not self._group_index[runnable]:
                self._update_stats(runnable)
            # Add our selected group, discard extras
            self._group_index[runnable].add(group)
            self._group_index[runnable].difference_update(groups)
Includes the search form with a list of models to use as choices
dataset/ETHPy150Open marineam/nagcat/python/nagcat/scheduler.py/Scheduler.register--crossover with--dataset/ETHPy150Open stephenmcd/mezzanine/mezzanine/core/templatetags/mezzanine_tags.py/search_form