Creates a unified context source for all those passed in.  An Exception
may be thrown if the call to a source's getContextType() method throws
an exception.
421974
public void init(ClassLoader loader,
                     ContextSource[] contextSources,
                     String[] prefixes, boolean profilingEnabled) throws Exception {


        mSources = contextSources;
        int len = contextSources.length;
        ArrayList<Class<?>> contextList = new ArrayList<Class<?>>(len);
        ArrayList<ClassLoader> delegateList = new ArrayList<ClassLoader>(len);

        for (int j = 0; j < contextSources.length; j++) {
            Class<?> type = contextSources[j].getContextType();
            if (type != null) {
                contextList.add(type);
                ClassLoader scout = type.getClassLoader();
                if (scout != null && !delegateList.contains(scout)) {
                    delegateList.add(scout);
                }
            }
        }

        mContextsInOrder = contextList.toArray(new Class[contextList.size()]);
        ClassLoader[] delegateLoaders =
            delegateList.toArray(new ClassLoader[delegateList.size()]);

        mInjector = new ClassInjector
            (new DelegateClassLoader(loader, delegateLoaders));

        mProfilingEnabled = profilingEnabled;

        int observerMode = profilingEnabled ? MergedClass.OBSERVER_ENABLED | MergedClass.OBSERVER_EXTERNAL : MergedClass.OBSERVER_ENABLED;

        // temporarily include interface for UtilityContext for backwards
        // compatibility with old code relying on it.
        Class<?>[] interfaces = { UtilityContext.class };
        mConstr = MergedClass.getConstructor2(mInjector,
                                              mContextsInOrder,
                                              prefixes,
                                              interfaces,
                                              observerMode);
    }
211899
@Override
    protected WeldCreationalContext<T> getCreationalContext(ManagedObjectInvocationContext<T> invocationContext, boolean nonContextual) throws ManagedObjectException {

        ManagedObjectContext moc;
        // for managed bean case, if invocation context is not null, use that
        if (invocationContext != null) {
            moc = invocationContext.getManagedObjectContext();

        } else {
            //otherwise, use the one created when creating this object(annotated with scope)
            moc = createContext(nonContextual);
        }
        @SuppressWarnings("unchecked")
        WeldCreationalContext<T> creationalContext = moc.getContextData(WeldCreationalContext.class);
        return creationalContext;
    }
178209
def fuse_get_context():
    ''

    ctxp = _libfuse.fuse_get_context()
    ctx = ctxp.contents
    return ctx.uid, ctx.gid, ctx.pid
1035250
public com.google.api.ads.adwords.axis.v201809.cm.RequestContextOperandContextType getContextType() {
        return contextType;
    }
636184
@Override
    public synchronized Enumeration getSubContexts() {
        Enumeration e = mySubContexts.elements();
        class Adapter implements Enumeration {
            Enumeration base;

            public Adapter(Enumeration e) {
                this.base = e;
            }

            @Override
            public boolean hasMoreElements() {
                return base.hasMoreElements();
            }

            @Override
            public Object nextElement() {
                return ((Entry) base.nextElement()).getCtx();
            }
        }
        return new Adapter(e);
    }
815806
function _createContext(context) {
  let newContext = context || _defaultContext
  if (_isString(newContext) || _isArray(newContext)) {
    newContext = {
      any: _arrayify(newContext),
    }
  } else {
    newContext = _arrayizeContext(context)
  }
  return newContext
}
1069285
public ParamValueType<WebAppType<T>> getOrCreateContextParam()
   {
      List<Node> nodeList = childNode.get("context-param");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new ParamValueTypeImpl<WebAppType<T>>(this, "context-param", childNode, nodeList.get(0));
      }
      return createContextParam();
   }
199147
private TeaServletTemplateSource createTemplateSource(
                                         ContextSource contextSource) {
        return TeaServletTemplateSource.createTemplateSource(
            getServletContext(),
            (TeaServletContextSource) contextSource,
            getProperties().subMap("template"),
            getLog());
    }
924258
@Override
    public String getContextPath() {
        try {
            collaborator.preInvoke(componentMetaData);
            return request.getContextPath();
        } finally {
            collaborator.postInvoke();
        }
    }
855633
public ContextItems getMarshaledContext() {
        ContextItems marshaledContext = new ContextItems();

        for (IManagedContext<?> managedContext : managedContexts) {
            marshaledContext.addItems(managedContext.getContextItems(false));
        }

        return marshaledContext;
    }
1364767
protected void _generate(SarlClass clazz, IExtraLanguageGeneratorContext context) {
		final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(clazz);
		final PyAppendable appendable = createAppendable(jvmType, context);
		if (generateTypeDeclaration(
				this.qualifiedNameProvider.getFullyQualifiedName(clazz).toString(),
				clazz.getName(), clazz.isAbstract(),
				getSuperTypes(clazz.getExtends(), clazz.getImplements()),
				getTypeBuilder().getDocumentation(clazz),
				true,
				clazz.getMembers(), appendable, context, null)) {
			final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(clazz);
			writeFile(name, appendable, context);
		}
	}
1097649
static Type getSupertype(Type context, Class<?> contextRawType, Class<?> supertype) {
    if (!supertype.isAssignableFrom(contextRawType)) {
      throw new IllegalArgumentException();
    }
    return resolve(context, contextRawType,
        getGenericSupertype(context, contextRawType, supertype));
  }
57943
public Output compile(Context context) throws CompilationException {
    Objects.requireNonNull(context, "Parameter context must not be null");

    if (context instanceof FileContext) {
      return compile((FileContext) context);
    }

    if (context instanceof StringContext) {
      return compile((StringContext) context);
    }

    throw new UnsupportedContextException(context);
  }
486152
public void createUISharedContext(Context context) {
		if (session != null) {
			uiContexts.put(context.getIndex(), context.duplicate());
		}
	}
156456
public static ContextFilter createContextFilter(Config config) {
    // For now always return an accept-all context filter.
    if (config.hasPath(CONTEXT_FILTER_CLASS)) {
      try {
        return ContextFilter.class.cast(
            ConstructorUtils.invokeConstructor(Class.forName(config.getString(CONTEXT_FILTER_CLASS)), config));
      } catch (ReflectiveOperationException rfe) {
        log.error("Failed to instantiate context filter with class " + config.getString(CONTEXT_FILTER_CLASS), rfe);
      }
    }
    return new AllContextFilter();
  }
174131
@Override
	public InputStream createResourceAsStream(GeneratorContext context) {

		String path = context.getPath();
		InputStream is = null;
		if (FileNameUtils.hasImageExtension(path)) {
			try {
				is = context.getResourceReaderHandler().getResourceAsStream(path, false);
			} catch (ResourceNotFoundException e) {
				// Nothing to do
			}
		}

		return is;
	}
948366
public HttpContext createHttpContext(ApplicationRequest req,
                                         ApplicationResponse resp)
        throws Exception {

        Template template = (Template) req.getTemplate();

        return createHttpContext(req, resp,
                                 template.getTemplateSource().getContextSource());
    }