Calls preprocessors before pre_validation
431839
def pre_validate(self, form):
        ''''''
        for preprocessor in self._preprocessors:
            preprocessor(form, self)
        super(FieldHelper, self).pre_validate(form)
649951
protected function handlePrePersist()
    {
        $environment = $this->getEnvironment();
        if (null !== $this->preFunction) {
            \call_user_func($this->preFunction, $environment, $this->model, $this->originalModel);
        }

        $environment->getEventDispatcher()->dispatch(
            PrePersistModelEvent::NAME,
            new PrePersistModelEvent($environment, $this->model, $this->originalModel)
        );
    }
538665
protected function before_validate() {
        $this->beforeupdate = null;
        $this->newparent = null;

        // During update.
        if ($this->get('id')) {
            $this->beforeupdate = new competency($this->get('id'));

            // The parent ID has changed.
            if ($this->beforeupdate->get('parentid') != $this->get('parentid')) {
                $this->newparent = $this->get_parent();

                // Update path and sortorder.
                $this->set_new_path($this->newparent);
                $this->set_new_sortorder();
            }

        } else {
            // During create.

            $this->set_new_path();
            // Always generate new sortorder when we create new competency.
            $this->set_new_sortorder();

        }
    }
232289
function preprocessCode (code) {

  // Remove starting comments
  while (code.indexOf('//') === 0) {
    code = code.slice(code.indexOf('\n'));
  }

  // Starts with an object literal
  if (code.indexOf('{') === 0) {
    code = 'var json = ' + code;

  // Starts with an object property
  } else if (code.indexOf(':') !== -1 &&
             code.indexOf(':') < code.indexOf(' ')) {
    code = 'var json = {' + code + '}';
  }

  // Starts with an anonymous function
  if (code.indexOf('function') === 0) {
    code = 'var func = ' + code;
  }

  // Contains ...
  return code.replace('...', '');
}
745184
def preprocess(self, dt):
        
        # Process
        try:  # this block should not raise errors, and if it does -- they should not be wrapped with `Invalid`
            # localize
            if self.localize and dt.tzinfo is None:
                dt = self.localize(dt)

            # astimezone
            if self.astz and dt.tzinfo is not None:
                dt = self.astz(dt)

            # Finish
            return dt
        except Exception as e:
            if isinstance(e, Invalid):
                raise
            six.reraise(RuntimeError, e)
156067
public function beforeCompile(): void
	{
		$builder = $this->getContainerBuilder();
		$config = $this->config;

		// Handle nette/mail configuration
		if ($this->name === 'mail') {
			return;
		}

		if ($config->mode === self::MODE_STANDALONE) {
			// Disable autowiring of nette.mailer
			if ($builder->hasDefinition('mail.mailer')) {
				$builder->getDefinition('mail.mailer')
					->setAutowired(false);
			}
		} elseif ($config->mode === self::MODE_OVERRIDE) {
			// Remove nette.mailer and replace with our mailer
			$builder->removeDefinition('mail.mailer');
			$builder->addAlias('mail.mailer', $this->prefix('mailer'));
		}
	}
945557
public function beforeCompile(): void
	{
		$config = $this->validateConfig($this->defaults);

		if ($config['autoload'] === true) {
			if ($config['lazy'] === true) {
				$this->doBeforeCompileLaziness();
			} else {
				$this->doBeforeCompile();
			}
		}
	}
45114
def before(f, chain=False):
    """"""
    def decorator(g):
        @wraps(g)
        def h(*args, **kargs):
            if chain:
                return g(f(*args, **kargs))
            else:
                f(*args, **kargs)
                return g(*args, **kargs)
        return h
    return decorator
488323
def before(self, context):
        ""
        run.before_each.execute(context)
        self._invoke(self._before, context)
848705
protected function before_user_func()
    {
        if ($this->config['error_reporting'] !== false) {
            set_error_handler(sprintf('%s::error_handler', __CLASS__), $this->config['error_reporting']);
        }

        if (empty($_POST['phery']['csrf'])) {
            $_POST['phery']['csrf'] = '';
        }

        if ($this->csrf($_POST['phery']['csrf']) === false) {
            self::exception($this, 'Invalid CSRF token', self::ERROR_CSRF);
        }
    }
915668
def pre_process(classes_hash, opts)
      Process::IgnoredClasses.new(classes_hash).process_all!
      Process::GlobalMembers.new(classes_hash, opts).process_all!
      Process::Accessors.new(classes_hash).process_all!
      Process::Ext4Events.new(classes_hash, opts).process_all!
      Process::Enums.new(classes_hash).process_all!
      Process::Overrides.new(classes_hash, opts).process_all!

      classes_hash.values
    end
1185372
protected function prepareForValidation(): void
    {
        $data = $this->all();
        $duration = explode(' - ', $data['duration']);

        $data['starts_at'] = (new Carbon($duration[0]))->toDateTimeString();
        $data['ends_at'] = (new Carbon($duration[1]))->toDateTimeString();

        $this->replace($data);
    }
1163043
public static function preProcessing(Compiler $compiler, array $params, $prepend, $append, $type)
    {
        $params       = $compiler->getCompiledParams($params);
        $parsedParams = array();
        if (!isset($params['*'])) {
            $params['*'] = array();
        }
        foreach ($params['*'] as $param => $defValue) {
            if (is_numeric($param)) {
                $param    = $defValue;
                $defValue = null;
            }
            $param = trim($param, '\'"');
            if (!preg_match('#^[a-z0-9_]+$#i', $param)) {
                throw new CompilationException($compiler, 'Function : parameter names must contain only A-Z, 0-9 or _');
            }
            $parsedParams[$param] = $defValue;
        }
        $params['name'] = substr($params['name'], 1, - 1);
        $params['*']    = $parsedParams;
        $params['uuid'] = uniqid();
        $compiler->addTemplatePlugin($params['name'], $parsedParams, $params['uuid']);
        $currentBlock           = &$compiler->getCurrentBlock();
        $currentBlock['params'] = $params;

        return '';
    }
1321215
public static function preProcessing(Compiler $compiler, array $params, $prepend, $append, $type)
    {
        $params     = $compiler->getCompiledParams($params);
        $func       = $params['__funcname'];
        $pluginType = $params['__functype'];
        $params     = $params['*'];

        if ($pluginType & Core::CUSTOM_PLUGIN) {
            $customPlugins = $compiler->getCore()->getCustomPlugins();
            $callback      = $customPlugins[$func]['callback'];
            if (is_array($callback)) {
                if (is_object($callback[0])) {
                    $callback = '$this->customPlugins[\'' . $func . '\'][0]->' . $callback[1] . '(';
                } else {
                    $callback = '' . $callback[0] . '::' . $callback[1] . '(';
                }
            } else {
                $callback = $callback . '(';
            }
        } else {
            $callback = 'smarty_block_' . $func . '(';
        }

        $paramsOut = '';
        foreach ($params as $i => $p) {
            $paramsOut .= var_export($i, true) . ' => ' . $p . ',';
        }

        $curBlock                      = &$compiler->getCurrentBlock();
        $curBlock['params']['postOut'] = Compiler::PHP_OPEN . ' $_block_content = ob_get_clean(); $_block_repeat=false; echo ' . $callback . '$_tag_stack[count($_tag_stack)-1], $_block_content, $this, $_block_repeat); } array_pop($_tag_stack);' . Compiler::PHP_CLOSE;

        return Compiler::PHP_OPEN . $prepend . ' if (!isset($_tag_stack)){ $_tag_stack = array(); } $_tag_stack[] = array(' . $paramsOut . '); $_block_repeat=true; ' . $callback . '$_tag_stack[count($_tag_stack)-1], null, $this, $_block_repeat); while ($_block_repeat) { ob_start();' . Compiler::PHP_CLOSE;
    }
1219367
def set_pre_handler(self, handler):
        '''
        '''
        set_flag = False
        for protoc in self._pre_handler_table:
            if isinstance(handler, self._pre_handler_table[protoc]["type"]):
                self._pre_handler_table[protoc]["obj"] = handler
                return RET_OK

        if set_flag is False:
            return RET_ERROR
392443
def do_preprocess(defn):
    
    from pycparser.ply import lex, cpp
    lexer = lex.lex(cpp)
    p = cpp.Preprocessor(lexer)
    # p.add_path(dir) will add dir to the include search path
    p.parse(defn)
    return ''.join(tok.value for tok in p.parser if tok.type not in p.ignore)
732522
public static function preProcessing(Compiler $compiler, array $params, $prepend, $append, $type)
    {
        $preContent = '';
        while (true) {
            $preContent .= $compiler->removeTopBlock();
            $block      = &$compiler->getCurrentBlock();
            $interfaces = class_implements($block['class']);
            if (in_array('Dwoo\IElseable', $interfaces) !== false) {
                break;
            }
        }

        $params['initialized'] = true;
        $compiler->injectBlock($type, $params);

        return $preContent;
    }