Returns an ivy instance bootstrapped by this bootstrapper.

    :param bootstrap_workunit_factory: the optional workunit to bootstrap under.
    :raises: Bootstrapper.Error if ivy could not be bootstrapped
499433
def ivy(self, bootstrap_workunit_factory=None):
    
    return Ivy(self._get_classpath(bootstrap_workunit_factory),
               ivy_settings=self._ivy_subsystem.get_options().ivy_settings,
               ivy_resolution_cache_dir=self._ivy_subsystem.resolution_cache_dir(),
               extra_jvm_options=self._ivy_subsystem.extra_jvm_options())
1038542
static WorkClassLoader createWorkClassLoader(final ClassBundle cb)
   {
      return AccessController.doPrivileged(new PrivilegedAction<WorkClassLoader>() 
      {
         public WorkClassLoader run()
         {
            return new WorkClassLoader(cb);
         }
      });
   }
1294568
def from_uuid(cls, uuid, **extra_data):
        
        model = Workflow.query.get(uuid)
        if model is None:
            raise LookupError(
                "No workflow with UUID {} was found".format(uuid)
            )
        instance = cls(model=model, **extra_data)
        instance.objects = WorkflowObjectModel.query.filter(
            WorkflowObjectModel.id_workflow == uuid,
            WorkflowObjectModel.id_parent == None,  # noqa
        ).all()
        return instance
1260187
def create(fc_layers=None, dropout=None, pretrained=True):
    
    def instantiate(**_):
        return Resnet34(fc_layers, dropout, pretrained)

    return ModelFactory.generic(instantiate)
628411
protected final FactoryPersistableBase
    createPutFactoryPersistableBase(
      final Class<?> pBeanClass) throws Exception {
    FactoryPersistableBase factory = new FactoryPersistableBase();
    factory.setObjectClass(pBeanClass);
    factory.setDatabaseId(this.srvDatabase.getIdDatabase());
    //assigning fully initialized object:
    this.factoriesMap
      .put(pBeanClass, factory);
    return factory;
  }
856340
@SuppressWarnings("unchecked")
	public static ChannelOperations.OnSetup channelOperationFactory(AbstractBootstrap<?, ?> b) {
		Objects.requireNonNull(b, "bootstrap");
		ChannelOperations.OnSetup ops =
				(ChannelOperations.OnSetup) b.config()
				                             .options()
				                             .get(OPS_OPTION);
		b.option(OPS_OPTION, null);
		if (ops == null) {
			return ChannelOperations.OnSetup.empty(); //will not be triggered in
		}
		return ops;
	}
175583
def __get_factory_with_context(self, factory_name):
        # type: (str) -> Tuple[type, FactoryContext]
        
        factory = self.__factories.get(factory_name)
        if factory is None:
            raise TypeError("Unknown factory '{0}'".format(factory_name))

        # Get the factory context
        factory_context = getattr(
            factory, constants.IPOPO_FACTORY_CONTEXT, None
        )
        if factory_context is None:
            raise TypeError(
                "Factory context missing in '{0}'".format(factory_name)
            )

        return factory, factory_context
1098792
def bootstrap_main(args):
    
    version_info = sys.version_info
    if version_info.major != 3 or version_info.minor < 6:
        return None, "python36"
    main_fn = load_module_as_package("nionui_app.nionswift")
    if main_fn:
        return main_fn(["nionui_app.nionswift"] + args, {"pyqt": None}), None
    return None, "main"
516522
def new_workunit(self, name, labels=None, cmd='', log_config=None):
    
    with self.run_tracker.new_workunit(name=name, labels=labels, cmd=cmd, log_config=log_config) as workunit:
      yield workunit
307521
@SuppressWarnings("unchecked")
   private <T extends WorkContext> Class<T> getSupportedWorkContextClass(Class<T> adaptorWorkContext)
   {
      for (Class<? extends WorkContext> supportedWorkContext : SUPPORTED_WORK_CONTEXT_CLASSES)
      {
         // Assignable or not
         if (supportedWorkContext.isAssignableFrom(adaptorWorkContext))
         {
            Class clz = adaptorWorkContext;

            while (clz != null)
            {
               // Supported by the server
               if (clz.equals(supportedWorkContext))
               {
                  return clz;
               }

               clz = clz.getSuperclass();
            }
         }
      }

      return null;
   }
518677
def load_or_create_workflow(self):
        
        self.workflow_spec = self.get_worfklow_spec()
        return self._load_workflow() or self.create_workflow()
68139
def getSamplingWorkflowEnabled(self):
        
        template = self.getTemplate()
        if template:
            return template.getSamplingRequired()
        return self.bika_setup.getSamplingWorkflowEnabled()
1018960
public WorkUnit createWorkUnit(SubTask execUnit) {
        WorkUnit wu = new WorkUnit(this, execUnit);
        workUnits.add(wu);
        return wu;
    }
1186860
def of(self, klass, name="default"):
        
        return FactoryBuilder(
            klass, name, self._definitions, self._faker, self._resolver
        )
1304995
def get_bootstrap(cls, name, ctx):
        '''
        '''
        if name is None:
            return None
        if not hasattr(cls, 'bootstraps'):
            cls.bootstraps = {}
        if name in cls.bootstraps:
            return cls.bootstraps[name]
        mod = importlib.import_module('pythonforandroid.bootstraps.{}'
                                      .format(name))
        if len(logger.handlers) > 1:
            logger.removeHandler(logger.handlers[1])
        bootstrap = mod.bootstrap
        bootstrap.bootstrap_dir = join(ctx.root_dir, 'bootstraps', name)
        bootstrap.ctx = ctx
        return bootstrap
1373704
def instantiate(self, seed=0, serial_id=0, preset='default', extra_args=None) -> gym.Env:
        
        settings = self.get_preset(preset)
        return wrapped_env_maker(self.envname, seed, serial_id, **settings)
26085
public <T> T getWorkContext(Class<T> workContextClass)
   {
      T instance = null;

      if (workContexts != null && workContexts.containsKey(workContextClass))
      {
         instance = workContextClass.cast(workContexts.get(workContextClass));
      }

      return instance;
   }