Create the task using the injector initialization.
        :param cls:
        :return:
325810
def _create_result(self, cls):
        # type:(Callable)->Tuple[Any, Callable]
        
        task = instantiate(cls)
        logging.getLogger(__name__).debug("Task object {0} created [{1}].".format(cls.__name__, task))
        return task, get_callable(task)
439618
def init(cls, *args, **kwargs):
        """"""
        instance = cls()
        instance._values.update(dict(*args, **kwargs))
        return instance
715310
async def async_init(self):
        
        self.session = aiohttp.ClientSession()
        asyncio.get_event_loop().create_task(self._deferred_init())
360293
def initialize_tasks(self):
        
        # Add a poison pill to shutdown each process.
        self.tasks = chain(self.iterable, [POISON_PILL] * self.num_processes)
        for task in islice(self.tasks, Q_MAX_SIZE):
            log.debug('Putting %s on queue', task)
            self.task_queue.put(task)
459597
def _inject_constructor(self, cls, func, name, resolution_level, keep,
                            trace):
        
        try:
            constructor = cls.__init__
        except AttributeError:
            def constructor(self, *_args, **_kwargs):
                pass

        # Possible name clash between keyword arguments of the tracked class'
        # constructor and the curried arguments of the injected constructor.
        # Therefore, the additional argument has a 'magic' name to make it less
        # likely that an argument name clash occurs.
        self._observers[cls] = _ClassObserver(constructor,
                                              name,
                                              resolution_level,
                                              keep,
                                              trace)
        cls.__init__ = instancemethod(
            lambda *args, **kwds: func(self._observers[cls], *args, **kwds),
            None,
            cls
        )
103544
def instantiate(pinfo, opts={})

      return nil unless pinfo

      pa_class_name, options = pinfo

      if rp = options['require_path']
        require(rp)
      end
      if lp = options['load_path']
        load(lp)
      end

      pa_class = Ruote.constantize(pa_class_name)
      pa_m = pa_class.instance_methods

      irt = opts[:if_respond_to?]

      if irt && ! (pa_m.include?(irt.to_s) || pa_m.include?(irt.to_sym))
        return nil
      end

      initialize_participant(pa_class, options)
    end
733763
protected void init() {
        log.debug("taskworker {} initializing...", this);

        scheduleVisibilityTimeoutExtender(task, new Date(), task.getVisibilityTimeout());

        log.debug("taskworker {} initialized", this);
        initialized = true;

    }
61405
def init(options=None, ini_paths=None, argv=None,
         strict=False, **parser_kwargs):
    
    global SINGLETON
    SINGLETON = Config(
        options=options,
        ini_paths=ini_paths,
        argv=argv,
        **parser_kwargs)
    SINGLETON.parse(argv, strict=strict)
    return SINGLETON
696184
def instantiate_tasks(self):
        
        self.tasks_instances = {}
        for task_name, task_class in self.tasks_classes.items():
            try:
                self.tasks_instances[task_name] = task_class()
            except Exception as ex:
                if not self.configuration[Configuration.ALGORITHM][Configuration.IOSF]:
                    raise GOSTaskException("An exception happened during the task instantiation."
                                           "{exception}".format(exception=ex))
582729
def Create(self, name):
    
    precondition.AssertType(name, Text)

    try:
      constructor = self._constructors[name]
    except KeyError:
      message = "No constructor for name '%s' has been registered"
      message %= name
      raise ValueError(message)

    instance = constructor()
    if not isinstance(instance, self._cls):
      message = ("Constructor %r for name '%s' returned instance of type %r "
                 "(expected %r)")
      message %= (constructor, name, type(instance), self._cls)
      raise TypeError(message)

    return instance
707837
private static Object newInstance(Class<?> clazz) {
        Object instance = null;
        try {
            instance = clazz.newInstance();
        } catch (Exception ex) {
            log.error("Error loading class: {}", clazz.getName(), ex);
        }
        return instance;
    }
1193784
def shot_create_task(self, *args, **kwargs):
        
        if not self.cur_shot:
            return
        task = self.create_task(element=self.cur_shot)
        if task:
            taskdata = djitemdata.TaskItemData(task)
            treemodel.TreeItem(taskdata, self.shot_task_model.root)
1230708
def bind(self, container, method_name):
        
        instance = super(Entrypoint, self).bind(container)
        instance.method_name = method_name
        return instance
1240019
def init(scope):
    
    # define wrapper compatibility symbols
    QtCore.THREADSAFE_NONE = XThreadNone()
    QtGui.QDialog = QDialog
    
    # define the importable symbols
    scope['QtCore'] = QtCore
    scope['QtGui'] = QtGui
    scope['QtWebKit'] = lazy_import('PySide.QtWebKit')
    scope['QtNetwork'] = lazy_import('PySide.QtNetwork')
    scope['QtXml'] = lazy_import('PySide.QtXml')
    
    scope['uic'] = Uic()
    scope['rcc_exe'] = 'pyside-rcc'
    
    # map overrides
    #QtCore.SIGNAL = SIGNAL
    
    # map shared core properties
    QtCore.QDate.toPyDate = lambda x: x.toPython()
    QtCore.QDateTime.toPyDateTime = lambda x: x.toPython()
    QtCore.QTime.toPyTime = lambda x: x.toPython()
    QtCore.QStringList = list
    QtCore.QString = unicode
997441
def _getOrCreate(cls):
        
        if not isinstance(cls._taskContext, BarrierTaskContext):
            cls._taskContext = object.__new__(cls)
        return cls._taskContext
560058
def init_and_start(self, taskParent, override={}):
        
        tag = self.initialize(taskParent, override=override)
        self.start()

        return tag
535950
def provide(self, cls):
        
        support.verify_class_type(cls, 'cls')
        if not self._is_injectable_fn(cls):
            provide_loc = locations.get_back_frame_loc()
            raise errors.NonExplicitlyBoundClassError(provide_loc, cls)
        try:
            return self._obj_provider.provide_class(
                cls, self._injection_context_factory.new(cls.__init__),
                direct_init_pargs=[], direct_init_kwargs={})
        except errors.Error as e:
            if self._use_short_stack_traces:
                raise e
            else:
                raise