Initializes the context of this flow.
776764
def InitializeContext(self, args):
    """"""
    if args is None:
      args = rdf_flow_runner.FlowRunnerArgs()

    output_plugins_states = []
    for plugin_descriptor in args.output_plugins:
      if not args.client_id:
        self.Log(
            "Not initializing output plugin %s as flow does not run on "
            "the client.", plugin_descriptor.plugin_name)
        continue

      plugin_class = plugin_descriptor.GetPluginClass()
      try:
        plugin, plugin_state = plugin_class.CreatePluginAndDefaultState(
            source_urn=self.flow_obj.output_urn,
            args=plugin_descriptor.plugin_args,
            token=self.token)
        # TODO(amoser): Those do not need to be inside the state, they
        # could be part of the plugin descriptor.
        plugin_state["logs"] = []
        plugin_state["errors"] = []

        output_plugins_states.append(
            rdf_flow_runner.OutputPluginState(
                plugin_state=plugin_state, plugin_descriptor=plugin_descriptor))
      except Exception as e:  # pylint: disable=broad-except
        logging.exception("Plugin %s failed to initialize (%s), ignoring it.",
                          plugin, e)

    parent_creator = None
    if self.parent_runner:
      parent_creator = self.parent_runner.context.creator

    context = rdf_flow_runner.FlowContext(
        create_time=rdfvalue.RDFDatetime.Now(),
        creator=parent_creator or self.token.username,
        current_state="Start",
        output_plugins_states=output_plugins_states,
        state=rdf_flow_runner.FlowContext.State.RUNNING,
    )

    return context
81807
public static void init(@NonNull Context ctx) {
        if (!INIT_DONE) {
            String[] fonts = GenericsUtil.getDefinedFonts(ctx);
            for (String fontsClassPath : fonts) {
                try {
                    ITypeface typeface = (ITypeface) Class.forName(fontsClassPath).newInstance();
                    validateFont(typeface);
                    FONTS.put(typeface.getMappingPrefix(), typeface);
                } catch (Exception e) {
                    Log.e(TAG, "Can't init: " + fontsClassPath);
                }
            }
            String[] processors = GenericsUtil.getDefinedProcessors(ctx);
            for (String processorClassPath : processors) {
                try {
                    IconicsAnimationProcessor processor = (IconicsAnimationProcessor) Class.forName(processorClassPath).newInstance();
                    registerProcessor(processor);
                } catch (Exception e) {
                    Log.e(TAG, "Can't init: " + processorClassPath);
                }
            }
            INIT_DONE = true;
        }
    }
823110
private void init(Context context) {
    try {
      if (FrescoSystrace.isTracing()) {
        FrescoSystrace.beginSection("DraweeView#init");
      }
      if (mInitialised) {
        return;
      }
      mInitialised = true;
      mDraweeHolder = DraweeHolder.create(null, context);
      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        ColorStateList imageTintList = getImageTintList();
        if (imageTintList == null) {
          return;
        }
        setColorFilter(imageTintList.getDefaultColor());
      }
      // In Android N and above, visibility handling for Drawables has been changed, which breaks
      // activity transitions with DraweeViews.
      mLegacyVisibilityHandlingEnabled =
          sGlobalLegacyVisibilityHandlingEnabled
              && context.getApplicationInfo().targetSdkVersion >= 24; // Build.VERSION_CODES.N
    } finally {
      if (FrescoSystrace.isTracing()) {
        FrescoSystrace.endSection();
      }
    }
  }
1023738
public void start() throws ContextClientCodeException {
    synchronized (this.contextStack) {
      LOG.log(Level.FINEST, "Instantiating root context.");
      this.contextStack.push(this.launchContext.get().getRootContext());

      if (this.launchContext.get().getInitialTaskConfiguration().isPresent()) {
        LOG.log(Level.FINEST, "Launching the initial Task");
        try {
          this.contextStack.peek().startTask(this.launchContext.get().getInitialTaskConfiguration().get());
        } catch (final TaskClientCodeException e) {
          this.handleTaskException(e);
        }
      }
    }
  }
1171164
private function initializeInstance(Context $context)
    {
        foreach ($this->contextInitializers as $initializer) {
            $initializer->initializeContext($context);
        }
    }
353875
private void initializeAnimations() {
    Context context = getContext();
    rerouteSlideDownTop = AnimationUtils.loadAnimation(context, R.anim.slide_down_top);
    rerouteSlideUpTop = AnimationUtils.loadAnimation(context, R.anim.slide_up_top);
  }
980738
@Override
	public void contextInitialized(ServletContextEvent sce) {
		Gig.bootstrap(sce.getServletContext());
		Jaguar.assemble(this);
	}
409424
@PostConstruct
    public synchronized void initialize() {
        final FwCoreDirection direction = assistCoreDirection();
        final ConcurrentAsyncExecutorProvider provider = direction.assistConcurrentAsyncExecutorProvider();
        defaultConcurrentAsyncOption = provider != null ? provider.provideDefaultOption() : null;
        if (defaultConcurrentAsyncOption == null) {
            defaultConcurrentAsyncOption = new ConcurrentAsyncOption();
        }
        primaryExecutorService = createDefaultPrimaryExecutorService(provider);
        secondaryExecutorService = createDefaultSecondaryExecutorService(provider);
        tertiaryExecutorService = createDefaultSecondaryExecutorService(provider);
        showBootLogging();
    }
93114
static void init() {
        contextMap = null;
        final PropertiesUtil managerProps = PropertiesUtil.getProperties();
        disableAll = managerProps.getBooleanProperty(DISABLE_ALL);
        useStack = !(managerProps.getBooleanProperty(DISABLE_STACK) || disableAll);
        useMap = !(managerProps.getBooleanProperty(DISABLE_MAP) || disableAll);

        contextStack = new Log4jv2ThreadContextStack(useStack);
        contextMap = new Log4jv2ThreadContextMap();
    }
198371
public void initialize(UimaContext context) throws ResourceInitializationException {

        super.initialize(context);

        TokenizerModel model;

        try {
            TokenizerModelResource modelResource =
                            (TokenizerModelResource) context.getResourceObject(UimaUtil.MODEL_PARAMETER);

            model = modelResource.getModel();
        } catch (ResourceAccessException e) {
            throw new ResourceInitializationException(e);
        }

        tokenizer = new TokenizerME(model);
    }
267380
public static void init(Context context) {
    String apiKey = readApiKey(context);
    init(context, apiKey);
  }
1062992
private function initializeSessionContext()
    {
        $sessionServer = SessionServer::create($this)->getValue();
        $this->sessionContext = SessionContext::create($sessionServer);
    }
1316505
protected void init() {
        if (defaults) {
            initializeDefaults();
            return;
        }
        mapfx(cfgMap, new MapFunction<String, String>() {
            @Override
            public void apply(String name, String value) {
                processSetting(name, value);
            }
        });
        readComplete();
    }
718728
public static synchronized void initialize(Context context) {
    if (FrescoSystrace.isTracing()) {
      FrescoSystrace.beginSection("ImagePipelineFactory#initialize");
    }
    initialize(ImagePipelineConfig.newBuilder(context).build());
    if (FrescoSystrace.isTracing()) {
      FrescoSystrace.endSection();
    }
  }
94805
private void runInitializers(ExecutionContext context) throws ExecutionContextException
    {
        for (ExecutionContextInitializer initializer : this.initializerProvider.get()) {
            initializer.initialize(context);
        }
    }
343649
public static synchronized void init(Context context) {
        mContext = context;

        // Set the appropriate log TAG
        setTAG(QuickUtils.system.getApplicationNameByContext());

        // resets all timestamps
        QuickUtils.timer.resetAllTimestamps();

        // init Rest
        QuickUtils.rest.init();

        // init image cache
        QuickUtils.imageCache.initialize(context);

        // init the objects cache
        try {
            cacheMagic.init(4096); // in bytes
        } catch (Exception e) {
           QuickUtils.log.e("Error initing cache");
        }
    }
115321
public static void init(@NonNull final Context context, IInnerImageSetter innerImageSetter,
        Class<? extends ImageView> imageClazz) {
        if (sInitialized) {
            return;
        }
        //noinspection ConstantConditions
        Preconditions.checkArgument(context != null, "context should not be null");
        Preconditions
            .checkArgument(innerImageSetter != null, "innerImageSetter should not be null");
        Preconditions.checkArgument(imageClazz != null, "imageClazz should not be null");
        TangramViewMetrics.initWith(context.getApplicationContext());
        ImageUtils.sImageClass = imageClazz;
        ImageUtils.setImageSetter(innerImageSetter);
        sInitialized = true;
    }