Will be called before every subject
340887
public function init()
    {
        $this->values      = Enum66::getValues();
        $this->enumerators = Enum66::getEnumerators();

        $this->emptyMap = new EnumMap(Enum66::class);
        $this->fullMap  = new EnumMap(Enum66::class);
        foreach ($this->enumerators as $i => $enumerator) {
            $this->fullMap->offsetSet($enumerator, $i);
        }
    }
1024216
void ensurePrestart() {
        int wc = workerCountOf(ctl.get());
        if (wc < corePoolSize)
            addWorker(null, true);
        else if (wc == 0)
            addWorker(null, false);
    }
557027
def pre_order(self):
        """"""
        yield self
        for child in self.children:
            for node in child.pre_order():
                yield node
1095041
public static Betner before(String target, String separator) {
		return betn(target).before(separator);
	}
571686
def list_all_before(self, message_id, limit=None):
        
        return self.list_before(message_id, limit=limit).autopage()
1057026
function each(test) {
        return function (Class) {
            var key,
                subject = context.subject,
                len;

            if (context.subjectConstructor === Array) {
                len = subject.length;
                for (key = 0; key < len; key++) {
                    value(subject[key]);
                    if (test(Class) === false) {
                        return false;
                    }
                }
            } else {
                for (key in subject) {
                    if (subject.hasOwnProperty(key)) {
                        value(subject[key]);
                        if (test(Class) === false) {
                            return false;
                        }
                    }
                }
            }
            return true;
        };
    }
1264140
public function runBeforeSystem() {
        if($this->_beforeSystem !== null) {
            foreach($this->_beforeSystem as $hookProvider) {
                $hookProvider->doBeforeSystem();
            }
        }
    }
1249408
function before(targetFunction, beforeFunction) {

    // Replacing the target function
    return function() {

      // Applying our function
      beforeFunction.apply(this, Array.prototype.slice.call(arguments));

      // Applying the original function
      return targetFunction.apply(this, Array.prototype.slice.call(arguments));
    };
  }
514002
function beforeList (controller, args, fields, title, form, links, defaultQueryArgs) {
    // get model from controller
    var model = controller.model
    // set limit
    var limit = args.limit || controller.defaultLimit
    var offset = args.offset || 0
    // set to true to show clear option for filters/sort
    var clear = false
    // set minimum limit to 2
    if (limit < 2) {
        limit = 2
    }
    // build arguments for query
    var query = {
        session: args.session,
    }
    // if query args are passed use them
    if (defined(defaultQueryArgs)) {
        _.merge(query, defaultQueryArgs)
    }
    // add order if set
    if (defined(args.orderColumn)) {
        query.order = [args.orderColumn]
        // if custom order is set add clear option
        clear = true
        // add direction if set
        if (defined(args.orderDirection)) {
            query.order.push(args.orderDirection)
        }
    }
    // add where if set
    if (defined(args.where)) {
        query.where = JSON.parse(args.where)
    }
    // included deleted records
    if (defined(args.deleted)) {
        // create where query if not set
        if (!defined(query.where)) {
            query.where = {}
        }
        // include deleted records - if argument is only then only deleted
        query.where.isDeleted = args.deleted === 'only'
            ? true: null
    }
    // add extra columns as query param options
    _.each(model.extraColumns, (spec, name) => {
        // if param is set in args add to where query
        if (typeof args[name] === 'string') {
            // create where query if not set
            if (!defined(query.where)) {
                query.where = {}
            }
            // if query is quoted then do exact match
            var queryArg = args[name].charAt(0) === '"' && args[name].charAt(args[name].length - 1) === '"'
                // strip leading and trailing quotes
                ? args[name].substr(1, args[name].length - 2)
                // add wildcards to string
                : `%${args[name]}%`
            // set like query
            query.where[name] = {like: queryArg}
            // if filter is set add clear option
            clear = true
            // and param to sort links
            _.each(fields, field => {
                if (field.orderAscUrl) {
                    field.orderAscUrl += '&'+name+'='+args[name]
                }
                if (field.orderDescUrl) {
                    field.orderDescUrl += '&'+name+'='+args[name]
                }
            })
        }
    })
    // if originalId set add to query
    if (args.originalId) {
        // create where query if not set
        if (!query.where) {
            query.where = {}
        }
        // set originalId in query
        query.where.originalId = {eq: args.originalId}
    }
    // do database query
    return model.query(query)
    // prepare args for primary method
    .then(result => {
        // remove session from query args for presentation
        delete query.session
        // fetch records
        return result.fetch(limit, offset)
        // resolve with result and record data
        .then(records => {
            // add actions to records
            _.each(records, record => {
                buildActions(controller, record)
            })
            // return data that will be merged into args for primary method
            return {
                clear: clear,
                fields: fields,
                form: form,
                links: links,
                query: query,
                records: records,
                result: {
                    length: result.length,
                },
                title: title,
            }
        })
    })
}
373016
public function before()
    {
        parent::before();
        // check if user have permission to access there
        if (!App::$User->isAuth() || !App::$User->identity()->role->can('global/file'))
            throw new NativeException('Permission denied');

        App::$Translate->append(__DIR__ . '/Translation/' . App::$Request->getLanguage() . '.php');
    }
964425
protected void beforeMaterialization()
	{
		if (_listeners != null)
		{
			MaterializationListener listener;

			for (int idx = _listeners.size() - 1; idx >= 0; idx--)
			{
				listener = (MaterializationListener) _listeners.get(idx);
				listener.beforeMaterialization(this, _id);
			}
		}
	}
415934
function before(f, before, changeArgs){
		return changeArgs ? 
			function before_changeArgs(){
				return f.apply(this,before.apply(this,arguments));
			}:
			function before_args(){
				before.apply(this,arguments);
				return f.apply(this,arguments);
			}
	}
787305
public void prePersist() {
        this.createdAt = getCurrentTime();

        if (this.createdBy == null || this.createdBy.trim().length()<1) {
            this.createdBy = getUserName();
        }
    }
243231
def prepare(self):
		""""""
		self.scope = 0
		self.mapping = deque([0])
		self._handler = [i() for i in sorted(self.handlers, key=lambda handler: handler.priority)]
1163398
public void onPrepareMenu(){
        if(mGroupChanged || mMenuDataChanged){
            mToolbar.getViewTreeObserver().addOnGlobalLayoutListener(mOnGlobalLayoutListener);

            Menu menu = mToolbar.getMenu();
            for(int i = 0, count = menu.size(); i < count; i++){
                MenuItem item = menu.getItem(i);
                item.setVisible(item.getGroupId() == mCurrentGroup || item.getGroupId() == 0);
            }

            mMenuDataChanged = false;
        }
    }
72727
private function preload(): void
    {
        $iterator = new \RecursiveIteratorIterator(
            new \RecursiveDirectoryIterator(
                __DIR__
            )
        );

        /** @var \SplFileInfo $file */
        foreach ($iterator as $file) {
            if ($file->isFile() && $file->getExtension() === 'php') {
                require_once $file->getRealPath();
            }
        }

        $definedClasses = get_declared_classes();
        /** @var string $definedClass */
        foreach ($definedClasses as $definedClass) {
            try {
                $reflection = new \ReflectionClass($definedClass);
                if ($reflection->implementsInterface(PreloadInterface::class)) {
                    $callback = [$definedClass, 'preload'];
                    assert(is_callable($callback));
                    call_user_func($callback, $this->composer);
                }
            } catch (\ReflectionException $e) {
                continue;
            }
        }
    }
729301
def insertBefore(self, node: AbstractNode,
                     ref_node: AbstractNode) -> AbstractNode:
        """"""
        return self._insert_before(node, ref_node)