/*
@see org.springframework.ldap.core.DirContextProcessor#preProcess(javax.naming.directory.DirContext)
500384
public void preProcess(DirContext ctx) throws NamingException {
        for (DirContextProcessor processor : dirContextProcessors) {
            processor.preProcess(ctx);
        }
    }
1158226
public void postProcess(DirContext ctx) throws NamingException {

		LdapContext ldapContext = (LdapContext) ctx;
		Control[] responseControls = ldapContext.getResponseControls();
		if (responseControls == null) {
			responseControls = new Control[0];
		}

		// Go through response controls and get info, regardless of class
		for (int i = 0; i < responseControls.length; i++) {
			Control responseControl = responseControls[i];

			// check for match, try fallback otherwise
			if (responseControl.getClass().isAssignableFrom(responseControlClass)) {
				Object control = responseControl;
				byte[] result = (byte[]) invokeMethod("getCookie", responseControlClass, control);
				this.cookie = new PagedResultsCookie(result);
				Integer wrapper = (Integer) invokeMethod("getResultSize", responseControlClass, control);
				this.resultSize = wrapper.intValue();
				return;
			}
		}

		log.error("No matching response control found for paged results - looking for '{}", responseControlClass);
	}
435092
public void doProcess(Instance carrier)	{
		try {
			if(prePipe!=null)
				prePipe.addThruPipe(carrier);
			carrier.setSource(carrier.getData());
			featurePipe.addThruPipe(carrier);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
320711
def prep_directory(self, target_dir):
        
        dirname = path.dirname(target_dir)
        if dirname:
            dirname = path.join(settings.BUILD_DIR, dirname)
            if not self.fs.exists(dirname):
                logger.debug("Creating directory at {}{}".format(self.fs_name, dirname))
                self.fs.makedirs(dirname)
1088847
protected DirContext createContext(Hashtable<String, Object> environment) {
		DirContext ctx = null;

		try {
			ctx = getDirContextInstance(environment);

			if (LOG.isInfoEnabled()) {
				Hashtable<?, ?> ctxEnv = ctx.getEnvironment();
				String ldapUrl = (String) ctxEnv.get(Context.PROVIDER_URL);
				LOG.debug("Got Ldap context on server '" + ldapUrl + "'");
			}

			return ctx;
		}
		catch (NamingException e) {
			closeContext(ctx);
			throw LdapUtils.convertLdapException(e);
		}
	}
436385
private ProjectFile handleFileInDirectory(File directory) throws Exception
   {
      List<File> directories = new ArrayList<File>();
      File[] files = directory.listFiles();

      if (files != null)
      {
         // Try files first
         for (File file : files)
         {
            if (file.isDirectory())
            {
               directories.add(file);
            }
            else
            {
               UniversalProjectReader reader = new UniversalProjectReader();
               ProjectFile result = reader.read(file);
               if (result != null)
               {
                  return result;
               }
            }
         }

         // Haven't found a file we can read? Try the directories.
         for (File file : directories)
         {
            ProjectFile result = handleDirectory(file);
            if (result != null)
            {
               return result;
            }
         }
      }
      return null;
   }
1167317
@Override public void process(MPPReader reader, ProjectFile file, DirectoryEntry root) throws MPXJException, IOException
   {
      try
      {
         populateMemberData(reader, file, root);
         processProjectProperties();

         if (!reader.getReadPropertiesOnly())
         {
            processCalendarData();
            processResourceData();
            processTaskData();
            processConstraintData();
            processAssignmentData();

            if (reader.getReadPresentationData())
            {
               processViewPropertyData();
               processViewData();
               processTableData();
            }
         }
      }

      finally
      {
         clearMemberData();
      }
   }
326721
@Override
    public void start(StartContext startContext) throws StartException {
        try {
            LdapKeyStore.Builder builder = LdapKeyStore.builder()
                    .setDirContextSupplier(dirContextSupplierInjector.getValue())
                    .setSearchPath(searchPath);

            if (filterAlias != null) builder.setFilterAlias(filterAlias);
            if (filterCertificate != null) builder.setFilterCertificate(filterCertificate);
            if (filterIterate != null) builder.setFilterIterate(filterIterate);
            if (createPath != null) builder.setCreatePath(createPath);
            if (createRdn != null) builder.setCreateRdn(createRdn);
            if (createAttributes != null) builder.setCreateAttributes(createAttributes);
            if (aliasAttribute != null) builder.setAliasAttribute(aliasAttribute);
            if (certificateAttribute != null) builder.setCertificateAttribute(certificateAttribute);
            if (certificateType != null) builder.setCertificateType(certificateType);
            if (certificateChainAttribute != null) builder.setCertificateChainAttribute(certificateChainAttribute);
            if (certificateChainEncoding != null) builder.setCertificateChainEncoding(certificateChainEncoding);
            if (keyAttribute != null) builder.setKeyAttribute(keyAttribute);
            if (keyType != null) builder.setKeyType(keyType);

            KeyStore keyStore = builder.build();
            keyStore.load(null); // initialize
            this.modifiableKeyStore = keyStore;
            this.unmodifiableKeyStore = UnmodifiableKeyStore.unmodifiableKeyStore(keyStore);
        } catch (GeneralSecurityException | IOException e) {
            throw ROOT_LOGGER.unableToStartService(e);
        }
    }
1374932
public JavaCompiler doProcessing(Context context,
                                     List<JCCompilationUnit> roots,
                                     List<ClassSymbol> classSymbols,
                                     Iterable<? extends PackageSymbol> pckSymbols,
                                     Log.DeferredDiagnosticHandler deferredDiagnosticHandler) {
        log = Log.instance(context);

        Set<PackageSymbol> specifiedPackages = new LinkedHashSet<PackageSymbol>();
        for (PackageSymbol psym : pckSymbols)
            specifiedPackages.add(psym);
        this.specifiedPackages = Collections.unmodifiableSet(specifiedPackages);

        Round round = new Round(context, roots, classSymbols, deferredDiagnosticHandler);

        boolean errorStatus;
        boolean moreToDo;
        do {
            // Run processors for round n
            round.run(false, false);

            // Processors for round n have run to completion.
            // Check for errors and whether there is more work to do.
            errorStatus = round.unrecoverableError();
            moreToDo = moreToDo();

            round.showDiagnostics(errorStatus || showResolveErrors);

            // Set up next round.
            // Copy mutable collections returned from filer.
            round = round.next(
                    new LinkedHashSet<JavaFileObject>(filer.getGeneratedSourceFileObjects()),
                    new LinkedHashMap<String,JavaFileObject>(filer.getGeneratedClasses()));

             // Check for errors during setup.
            if (round.unrecoverableError())
                errorStatus = true;

        } while (moreToDo && !errorStatus);

        // run last round
        round.run(true, errorStatus);
        round.showDiagnostics(true);

        filer.warnIfUnclosedFiles();
        warnIfUnmatchedOptions();

        /*
         * If an annotation processor raises an error in a round,
         * that round runs to completion and one last round occurs.
         * The last round may also occur because no more source or
         * class files have been generated.  Therefore, if an error
         * was raised on either of the last *two* rounds, the compile
         * should exit with a nonzero exit code.  The current value of
         * errorStatus holds whether or not an error was raised on the
         * second to last round; errorRaised() gives the error status
         * of the last round.
         */
        if (messager.errorRaised()
                || werror && round.warningCount() > 0 && round.errorCount() > 0)
            errorStatus = true;

        Set<JavaFileObject> newSourceFiles =
                new LinkedHashSet<JavaFileObject>(filer.getGeneratedSourceFileObjects());
        roots = cleanTrees(round.roots);

        JavaCompiler compiler = round.finalCompiler();

        if (newSourceFiles.size() > 0)
            roots = roots.appendList(compiler.parseFiles(newSourceFiles));

        errorStatus = errorStatus || (compiler.errorCount() > 0);

        // Free resources
        this.close();

        if (!taskListener.isEmpty())
            taskListener.finished(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING));

        if (errorStatus) {
            if (compiler.errorCount() == 0)
                compiler.log.nerrors++;
            return compiler;
        }

        compiler.enterTreesIfNeeded(roots);

        return compiler;
    }
843984
private void handlePredicates(QualifiedName context, QualifiedName qualifiedName) {
	List<QualifiedName> members = new ArrayList<QualifiedName>();
	List<QualifiedName> dictionaryMembers = new ArrayList<QualifiedName>();

	List<Statement> statements = collators.get(context).get(qualifiedName);
	for (Statement statement : statements) {
	    QualifiedName predQ = convertURIToQualifiedName(statement.getPredicate());
	    Value value = statement.getObject();

	    if (predQ.equals(onto.QualifiedName_PROVO_wasInfluencedBy)) {
		QualifiedName anyQ = convertResourceToQualifiedName((Resource) (statement.getObject()));
		WasInfluencedBy wib = pFactory.newWasInfluencedBy(null, qualifiedName,
								  anyQ, null);

		store(convertResourceToQualifiedName(statement.getContext()), wib);
	    }

	    if (predQ.equals(onto.QualifiedName_PROVO_influenced)) {
		QualifiedName anyQ = convertResourceToQualifiedName((Resource) (statement.getObject()));

		WasInfluencedBy wib = pFactory.newWasInfluencedBy(null, anyQ,
								  qualifiedName, null);

		store(convertResourceToQualifiedName(statement.getContext()), wib);
	    }

	    if (value instanceof Resource) {
		QualifiedName valueQ = convertResourceToQualifiedName((Resource) value);
		if (predQ.equals(onto.QualifiedName_PROVO_wasDerivedFrom)) {
		    WasDerivedFrom wdf = pFactory.newWasDerivedFrom((QualifiedName) null,
								    qualifiedName,
								    valueQ,
								    null, null,
								    null, null);

		    store(context, wdf);
		} else if (predQ.equals(onto.QualifiedName_PROVO_hadPrimarySource)) {
		    WasDerivedFrom wdf = pFactory.newWasDerivedFrom(null,
								    qualifiedName,
								    valueQ,
								    null, null,
								    null, null);

		    pFactory.addPrimarySourceType(wdf);
		    store(context, wdf);
		} else if (predQ.equals(onto.QualifiedName_PROVO_wasQuotedFrom)) {
		    WasDerivedFrom wdf = pFactory.newWasDerivedFrom(null,
								    qualifiedName,
								    valueQ,
								    null, null,
								    null, null);
		    pFactory.addQuotationType(wdf);
		    store(context, wdf);
		} else if (predQ.equals(onto.QualifiedName_PROVO_wasRevisionOf)) {
		    WasDerivedFrom wdf = pFactory.newWasDerivedFrom(null,
								    qualifiedName,
								    valueQ,
								    null, null,
								    null, null);
		    pFactory.addRevisionType(wdf);
		    store(context, wdf);
		} else if (predQ.equals(onto.QualifiedName_PROVO_wasGeneratedBy)) {
		    WasGeneratedBy wgb = pFactory.newWasGeneratedBy(null,
								    qualifiedName,
								    valueQ,
								    null, null);

		    store(context, wgb);
		} else if (predQ.equals(onto.QualifiedName_PROVO_alternateOf)) {
		    AlternateOf ao = pFactory.newAlternateOf(qualifiedName, valueQ);

		    store(context, ao);
		} else if (predQ.equals(onto.QualifiedName_PROVO_specializationOf)) {
		    SpecializationOf so = pFactory.newSpecializationOf(qualifiedName,
								       valueQ);

		    store(context, so);
		} else if (predQ.equals(onto.QualifiedName_PROVO_wasInvalidatedBy)) {
		    WasInvalidatedBy wib = pFactory.newWasInvalidatedBy(null,
									qualifiedName,
									valueQ,
									null,
									null);

		    store(context, wib);
		} else if (predQ.equals(onto.QualifiedName_PROVO_wasAttributedTo)) {
		    WasAttributedTo wit = pFactory.newWasAttributedTo(null,
								      qualifiedName,
								      valueQ,
								      null);

		    store(context, wit);
		} else if (predQ.equals(onto.QualifiedName_PROVO_mentionOf)) {
		    Statement asInBundleStatement = getSingleStatementForPredicate(context,
										   qualifiedName,
										   onto.QualifiedName_PROVO_asInBundle);
		    Object o = (asInBundleStatement == null) ? null
			    : asInBundleStatement.getObject();
		    QualifiedName bundleQ = (o == null) ? null
			    : convertURIToQualifiedName((URI) o);
		    QualifiedName entityQ = (value == null) ? null
			    : convertURIToQualifiedName((URI) value);
		    MentionOf mo = pFactory.newMentionOf(entityQ, qualifiedName,
							 bundleQ);

		    store(context, mo);
		} else if (predQ.equals(onto.QualifiedName_PROVO_wasAssociatedWith)) {
		    WasAssociatedWith waw = pFactory.newWasAssociatedWith(null,
									  qualifiedName,
									  valueQ,
									  null,
									  null);

		    store(context, waw);

		} else if (predQ.equals(onto.QualifiedName_PROVO_used)) {
		    Used used = pFactory.newUsed(null, qualifiedName,valueQ, null,
						 null);
		    store(context, used);

		} else if (predQ.equals(onto.QualifiedName_PROVO_wasStartedBy)) {
		    WasStartedBy wsb = pFactory.newWasStartedBy(null, qualifiedName,
								valueQ, null,
								null, null);
		    store(context, wsb);

		} else if (predQ.equals(onto.QualifiedName_PROVO_generated)) {
		    WasGeneratedBy wgb = pFactory.newWasGeneratedBy(null,
								    valueQ,
								    qualifiedName,
								    null, null);
		    store(context, wgb);

		} else if (predQ.equals(onto.QualifiedName_PROVO_wasEndedBy)) {
		    WasEndedBy web = pFactory.newWasEndedBy(null, qualifiedName,
							    valueQ, null, null,
							    null);
		    store(context, web);

		} else if (predQ.equals(onto.QualifiedName_PROVO_wasInformedBy)) {
		    WasInformedBy wib = pFactory.newWasInformedBy(null, qualifiedName,
								  valueQ, null);
		    store(context, wib);
		} else if (predQ.equals(onto.QualifiedName_PROVO_actedOnBehalfOf)) {
		    QualifiedName agentQ = convertResourceToQualifiedName((Resource) value);
		    ActedOnBehalfOf aobo = pFactory.newActedOnBehalfOf(null,
								       qualifiedName,
								       agentQ,
								       null,
								       null);

		    store(context, aobo);
		} else if (predQ.equals(onto.QualifiedName_PROVO_hadMember)) {
		    members.add(convertResourceToQualifiedName((Resource) (statement.getObject())));
		} else if (predQ.equals(onto.QualifiedName_PROVO_hadDictionaryMember)) {
		    dictionaryMembers.add(convertResourceToQualifiedName((Resource) (statement.getObject())));
		}
	    }
	}

	if (members.size() > 0) {
	    HadMember hm = pFactory.newHadMember(qualifiedName, members);
	    store(context, hm);
	}
	if (dictionaryMembers.size() > 0) {
	    List<Entry> pairs = createKeyEntityPairs(context,
							    dictionaryMembers);

	    DictionaryMembership hm = pFactory.newDictionaryMembership(qualifiedName,
								       pairs);
	    store(context, hm);
	}
    }
1283606
public static void preprocess(String absolutePath) {
        if (absolutePath == null) {
            return;
        }

        if (config == null) {
            System.setProperty(Key.APPLICATION_CONFIG.toString(), basePath + Default.CONFIG_PATH.toString());
            config = new Config();
        }

        if (config.isApplicationPreprocessLess() && absolutePath.endsWith(LESS)) {
            lessify(new File(absolutePath));
        } else if (config.isApplicationPreprocessSass() && absolutePath.endsWith(SASS)) {
            sassify(new File(absolutePath));
        }
    }
791698
def _preprocess(project_dict):
        
        handlers = {
            ('archive',): _list_if_none,
            ('on-run-start',): _list_if_none_or_string,
            ('on-run-end',): _list_if_none_or_string,
        }

        for k in ('models', 'seeds'):
            handlers[(k,)] = _dict_if_none
            handlers[(k, 'vars')] = _dict_if_none
            handlers[(k, 'pre-hook')] = _list_if_none_or_string
            handlers[(k, 'post-hook')] = _list_if_none_or_string
        handlers[('seeds', 'column_types')] = _dict_if_none

        def converter(value, keypath):
            if keypath in handlers:
                handler = handlers[keypath]
                return handler(value)
            else:
                return value

        return deep_map(converter, project_dict)
959209
public synchronized void startup(AppContextWrapper context) {
		ContainerRegistryBuilder cb;
		try {
			cb = (ContainerRegistryBuilder) context.getAttribute(ContainerRegistryBuilder.APPLICATION_CONTEXT_ATTRIBUTE_NAME);
			if (cb == null) {
				Debug.logError("[JdonFramework] at first call prepare method");
				return;
			}
			if (cb.isKernelStartup())
				return;
			ContainerDirector cd = new ContainerDirector(cb);
			cd.startup();
		} catch (Exception ex) {
			Debug.logError(ex, module);
		}
	}
1010043
protected function preProcess(): void
    {
        Router::process();

        // disable Layout for XmlHttpRequests
        if (Request::isXmlHttpRequest()) {
            $this->layoutFlag = false;
        }

        // switch to JSON response based on Accept header
        if (Request::checkAccept([Request::TYPE_HTML, Request::TYPE_JSON]) === Request::TYPE_JSON) {
            $this->layoutFlag = false;
            Response::setType('JSON');
        }
    }
536479
public void process(Connection connection, String directory) throws Exception
   {
      connection.setAutoCommit(true);

      //
      // Retrieve meta data about the connection
      //
      DatabaseMetaData dmd = connection.getMetaData();

      String[] types =
      {
         "TABLE"
      };

      FileWriter fw = new FileWriter(directory);
      PrintWriter pw = new PrintWriter(fw);

      pw.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
      pw.println();
      pw.println("<database>");

      ResultSet tables = dmd.getTables(null, null, null, types);
      while (tables.next() == true)
      {
         processTable(pw, connection, tables.getString("TABLE_NAME"));
      }

      pw.println("</database>");

      pw.close();

      tables.close();
   }
740527
protected function prepareProcessContext()
    {
        if (null !== $this->context) {
            $this->context->setData($this->data);
            $this->context->setProcessor($this);
            return;
        }

        $class = $this->processContextClass;

        $this->context = new $class($this->data, $this->settings, $this);

    }
95275
public static void processSource(Context cx, String filename)
            throws IOException
    {
        if (filename == null || filename.equals("-")) {
            Scriptable scope = getShellScope();
            Charset cs;
            String charEnc = shellContextFactory.getCharacterEncoding();
            if (charEnc != null) {
                cs = Charset.forName(charEnc);
            } else {
                cs = Charset.defaultCharset();
            }
            ShellConsole console = global.getConsole(cs);
            if (filename == null) {
                // print implementation version
                console.println(cx.getImplementationVersion());
            }

            int lineno = 1;
            boolean hitEOF = false;
            while (!hitEOF) {
                String[] prompts = global.getPrompts(cx);
                String prompt = null;
                if (filename == null)
                    prompt = prompts[0];
                console.flush();
                String source = "";

                // Collect lines of source to compile.
                while (true) {
                    String newline;
                    try {
                        newline = console.readLine(prompt);
                    }
                    catch (IOException ioe) {
                        console.println(ioe.toString());
                        break;
                    }
                    if (newline == null) {
                        hitEOF = true;
                        break;
                    }
                    source = source + newline + "\n";
                    lineno++;
                    if (cx.stringIsCompilableUnit(source))
                        break;
                    prompt = prompts[1];
                }
                try {
                    Script script = cx.compileString(source, "<stdin>", lineno, null);
                    if (script != null) {
                        Object result = script.exec(cx, scope);
                        // Avoid printing out undefined or function definitions.
                        if (result != Context.getUndefinedValue() &&
                                !(result instanceof Function &&
                                        source.trim().startsWith("function")))
                        {
                            try {
                                console.println(Context.toString(result));
                            } catch (RhinoException rex) {
                                ToolErrorReporter.reportException(
                                        cx.getErrorReporter(), rex);
                            }
                        }
                        NativeArray h = global.history;
                        h.put((int)h.getLength(), h, source);
                    }
                } catch (RhinoException rex) {
                    ToolErrorReporter.reportException(
                        cx.getErrorReporter(), rex);
                    exitCode = EXITCODE_RUNTIME_ERROR;
                } catch (VirtualMachineError ex) {
                    // Treat StackOverflow and OutOfMemory as runtime errors
                    ex.printStackTrace();
                    String msg = ToolErrorReporter.getMessage(
                        "msg.uncaughtJSException", ex.toString());
                    Context.reportError(msg);
                    exitCode = EXITCODE_RUNTIME_ERROR;
                }
            }
            console.println();
            console.flush();
        } else if (useRequire && filename.equals(mainModule)) {
            require.requireMain(cx, filename);
        } else {
            processFile(cx, getScope(filename), filename);
        }
    }