this can happen ASAP in the POST_MODULE Phase
340340
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {

    DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();

    if(!ProcessApplicationAttachments.isProcessApplication(deploymentUnit)) {
      return;
    }

    final Module module = deploymentUnit.getAttachment(MODULE);

    // read @ProcessApplication annotation of PA-component
    String[] deploymentDescriptors = getDeploymentDescriptors(deploymentUnit);

    // load all processes.xml files
    List<URL> deploymentDescriptorURLs = getDeploymentDescriptorUrls(module, deploymentDescriptors);

    for (URL processesXmlResource : deploymentDescriptorURLs) {
      VirtualFile processesXmlFile = getFile(processesXmlResource);

      // parse processes.xml metadata.
      ProcessesXml processesXml = null;
      if(isEmptyFile(processesXmlResource)) {
        processesXml = ProcessesXml.EMPTY_PROCESSES_XML;
      } else {
        processesXml = parseProcessesXml(processesXmlResource);
      }

      // add the parsed metadata to the attachment list
      ProcessApplicationAttachments.addProcessesXml(deploymentUnit, new ProcessesXmlWrapper(processesXml, processesXmlFile));
    }
  }
114400
function(rpc_method, fn) {
        rpc.on(rpc_method, _.partial(moduleEventWrap, rpc_method, fn));
    }
150945
def _pd_post_process(self, cfg):
        
        loop_back_edges = self._cfg.get_loop_back_edges()

        for b1, b2 in loop_back_edges:
            # The edge between b1 and b2 is manually broken
            # The post dominator of b1 should be b2 (or not?)

            successors = list(self._pd_graph_successors(cfg, b1))

            if len(successors) == 0:
                if b2 in self._post_dom:
                    self._post_dom.add_edge(b1, b2)
                else:
                    _l.debug("%s is not in post dominator dict.", b2)
124254
private void postProcess(StringBuilder result, NFRuleSet ruleSet) {
        if (postProcessRules != null) {
            if (postProcessor == null) {
                int ix = postProcessRules.indexOf(";");
                if (ix == -1) {
                    ix = postProcessRules.length();
                }
                String ppClassName = postProcessRules.substring(0, ix).trim();
                try {
                    Class<?> cls = Class.forName(ppClassName);
                    postProcessor = (RBNFPostProcessor)cls.newInstance();
                    postProcessor.init(this, postProcessRules);
                }
                catch (Exception e) {
                    // if debug, print it out
                    if (DEBUG) System.out.println("could not locate " + ppClassName + ", error " +
                                       e.getClass().getName() + ", " + e.getMessage());
                    postProcessor = null;
                    postProcessRules = null; // don't try again
                    return;
                }
            }

            postProcessor.process(result, ruleSet);
        }
    }
833314
def _rm_mods(pre_mods, post_mods):
    '''
    
    '''
    pre = set()
    post = set()
    for mod in pre_mods:
        pre.add(mod['module'])
    for mod in post_mods:
        post.add(mod['module'])
    return pre - post
1055359
@Override
  public final void onModuleLoad() {
    GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
      @Override
      public void onUncaughtException(Throwable e) {
        HtmlPlatform.log.error("Uncaught Exception: ", e);
      }
    });

    // Need to do everything else in a deferred command, so that
    // the uncaught exception handler has taken effect
    Scheduler.get().scheduleDeferred(new ScheduledCommand() {

      @Override
      public void execute() {
        start();
      }

    });
  }
783859
public function postPersist()
    {
        if ($this->lifecycleEventsActive) {
            $collection = $this->resourceManager->getCollection($this->collectionName);
            $collection->getTarget()->publishResource($this, $collection);
        }
    }
1344338
def post_template_trigger(template, time, time_unit, event, zephyr)
      data = {}
      data['template'] = template
      data['time'] = time
      data['time_unit'] = time_unit
      data['event'] = event
      data['zephyr'] = zephyr
      api_post(:trigger, data)
    end
84395
public function postLoad()
    {
        $tmpModified = $this->_modified;
        $this->isloaded = true;
        $this->initData();
        $this->_modified = $tmpModified;
    }
180253
function check() {
    module.hot.check(function(err, updatedModules) {
      if (err) return handleError(err);

      if (!updatedModules) {
        logger.warn('Cannot find update any update.');
        return;
      }

      apply(updatedModules);
    });
  }
532778
@Override
    public <T> void postProcess(T anyContext) {
        Tuple2<List<String>, List<String>> dimsAndMetrics = (Tuple2<List<String>, List<String>>)anyContext;
        List<String> dims = dimsAndMetrics._1();
        List<String> metrics = dimsAndMetrics._2();
        Iterator<Map.Entry<String, String>> colIter = fetchDimensions.entrySet().iterator();
        while (colIter.hasNext()) {
            Map.Entry<String, String> entry = colIter.next();
            if (dims.contains(entry.getKey())) {
                //No action.
            } else if (metrics.contains(entry.getKey())) {
                fetchMetrics.add(entry.getKey());
                colIter.remove();
            } else {//TODO: Handle error
                
            }
        }
    }
994698
function postRouter(sessions, controllers, nonObjTemplatelogLevel, req, res, next) {

    if (req.originalUrl.match(/amorphic\/xhr\?path\=/) && url.parse(req.originalUrl, true).query.form && req.method === 'POST') {
        processPost(req, res, sessions, controllers, nonObjTemplatelogLevel);
    }
    else {
        next();
    }
}
1298891
function waitTimeoutNotice() {
        var hangModules = [];
        var missModules = [];
        var missModulesMap = {};
        var hasError;

        for ( var id in modModules ) {
            if ( !modIsDefined( id ) ) {
                hasError = 1;
                hangModules.push( id );
            }

            each(
                modModules[ id ].depMs || [],
                function ( dep ) {
                    var depId = dep.absId;
                    if ( !modModules[ depId ] && !missModulesMap[ depId ] ) {
                        hasError = 1;
                        missModules.push( depId );
                        missModulesMap[ depId ] = 1;
                    }
                }
            );
        }

        if ( hasError ) {
            throw new Error( '[MODULE_TIMEOUT]Hang( '
                + ( hangModules.join( ', ' ) || 'none' )
                + ' ) Miss( '
                + ( missModules.join( ', ' ) || 'none' )
                + ' )'
            );
        }
    }
255597
protected void postProcessing()
   {
      //
      // Update the internal structure. We'll take this opportunity to
      // generate outline numbers for the tasks as they don't appear to
      // be present in the MPP file.
      //
      ProjectConfig config = m_project.getProjectConfig();
      config.setAutoWBS(m_autoWBS);
      config.setAutoOutlineNumber(true);
      m_project.updateStructure();
      config.setAutoOutlineNumber(false);

      //
      // Perform post-processing to set the summary flag
      //
      for (Task task : m_project.getTasks())
      {
         task.setSummary(task.hasChildTasks());
      }

      //
      // Ensure that the unique ID counters are correct
      //
      config.updateUniqueCounters();
   }
411549
def prepare_module(self):
        
        # Modules can define a post_config_hook() method which will be run
        # after the module has had it config settings applied and before it has
        # its main method(s) called for the first time.  This allows modules to
        # perform any necessary setup.
        if self.has_post_config_hook:
            try:
                self.module_class.post_config_hook()
            except Exception as e:
                # An exception has been thrown in post_config_hook() disable
                # the module and show error in module output
                self.terminated = True
                self.error_index = 0

                self.error_messages = [
                    self.module_nice_name,
                    u"{}: {}".format(
                        self.module_nice_name, str(e) or e.__class__.__name__
                    ),
                ]
                self.error_output(self.error_messages[0])
                msg = "Exception in `%s` post_config_hook()" % self.module_full_name
                self._py3_wrapper.report_exception(msg, notify_user=False)
                self._py3_wrapper.log("terminating module %s" % self.module_full_name)
        self.enabled = True
924214
function(next) {
            if (options.noModules) return next();
            var opts = {
                denyModules: options.denyModules || core.denyModules[core.role] || core.denyModules[""],
                allowModules: options.allowModules || core.allowModules[core.role] || core.allowModules[""],
                stopOnError: options.stopOnError || core.stopOnError,
            };
            var modules = path.resolve(__dirname, "../modules");
            core.loadModules(modules, opts);
            core.path.modules.forEach(function(mod) {
                if (modules == path.resolve(mod)) return;
                core.loadModules(mod, opts);
            });
            next();
        }
1314458
def _post_process(self):
        
        self._process = None
        shutil.move(self._temp_capture_file_path, self._capture_file_path)