--------------------------------------------------------------------------
973479
public Any command_inout_2(final String in_cmd, final Any in_data, final DevSource source)
	    throws DevFailed, SystemException {
	Util.out4.println("Device_2Impl.command_inout_2 arrived, source = " + source
		+ ", command = " + in_cmd);

	PollObj polled_cmd = null;
	boolean polling_failed = false;

	// If the source parameter specifies device, call the command_inout
	// method
	// implemented by the DeviceImpl class
	if (source == DevSource.DEV) {
	    return command_inout(in_cmd, in_data);
	}

	try {
	    // Record operation request in black box
	    blackbox.insert_cmd(in_cmd, 2);

	    final String cmd_str = in_cmd.toLowerCase();

	    // Check that device supports this command
	    check_command_exists(cmd_str);
	    // Check that the command is polled
	    boolean found = false;
	    final Vector poll_list = get_poll_obj_list(); // PollObj
	    for (int i = 0; i < poll_list.size(); i++) {
		final PollObj poll_obj = (PollObj) poll_list.elementAt(i);
		if (poll_obj.get_type() == Tango_POLL_CMD
			&& poll_obj.get_name().equals(in_cmd.toLowerCase())) {
		    polled_cmd = poll_obj;
		    found = true;
		}
	    }
	    // If the command is not polled but its polling update period is
	    // defined, and the command is not in the device list of command
	    // which should not be polled, start to poll it
	    if (found == false) {
		final Command cmd = get_command(cmd_str);
		final int poll_period = cmd.get_polling_period();
		if (poll_period == 0) {
		    Except.throw_exception("API_CmdNotPolled", "Command " + in_cmd + " not polled",
			    "Device_2Impl.command_inout");
		}

		found = false;
		final Vector napc = get_non_auto_polled_cmd();
		for (int i = 0; i < napc.size(); i++) {
		    final String s = (String) napc.elementAt(i);
		    if (s.equals(cmd_str)) {
			found = true;
		    }
		}
		if (found == true) {
		    Except.throw_exception("API_CmdNotPolled", "Command " + in_cmd + " not polled",
			    "Device_2Impl.command_inout");
		}

		else {
		    final Util tg = Util.instance();
		    final DServer adm_dev = tg.get_dserver_device();

		    final DevVarLongStringArray send = new DevVarLongStringArray();
		    send.lvalue = new int[1];
		    send.svalue = new String[3];

		    send.lvalue[0] = poll_period;
		    send.svalue[0] = device_name;
		    send.svalue[1] = "command";
		    send.svalue[2] = in_cmd;

		    adm_dev.add_obj_polling(send, false);

		    // Wait for first polling. Release monitor during this
		    // sleep in order to give it to the polling thread
		    /*
		     * ext.only_one.rel_monitor(); try { Thread.sleep(500); }
		     * catch (InterruptedException e){}
		     * ext.only_one.get_monitor();
		     */
		    // Update the polled-cmd pointer to the new polled object
		    for (int i = 0; i < poll_list.size(); i++) {
			final PollObj poll_obj = (PollObj) poll_list.elementAt(i);
			if (poll_obj.get_type() == Tango_POLL_CMD
				&& poll_obj.get_name().equals(in_cmd)) {
			    polled_cmd = poll_obj;
			    break;
			}
		    }
		}
	    }

	    if (polled_cmd == null) {
		Except.throw_exception("API_CommandNotPolled", "Command not found.",
			"Device_2Impl.command_inout");
	    }
	    // Check that some data is available in cache
	    assert polled_cmd != null;
	    if (polled_cmd.is_ring_empty()) {
		Except.throw_exception("API_NoDataYet", "No data available in cache for command "
			+ in_cmd, "Device_2Impl.command_inout");
	    }
	    // Check that data are still refreshed by the polling thread
	    final long ctm = System.currentTimeMillis();
	    int tv_sec = (int) (ctm / 1000);
	    final int tv_usec = (int) (ctm - 1000 * tv_sec) * 1000;
	    tv_sec = tv_sec - Tango_DELTA_T;
	    final double last = polled_cmd.get_last_insert_date();
	    final double now_d = tv_sec + (double) tv_usec / 1000000;
	    final double diff_d = now_d - last;
	    if (diff_d > polled_cmd.get_authorized_delta()) {
		Except.throw_exception("API_NotUpdatedAnyMore", "Data in cache for command "
			+ in_cmd + " not updated any more", "Device_2Impl.command_inout");
	    }
	} catch (final DevFailed e) {
	    if (source == DevSource.CACHE) {
		throw e;
	    }
	    polling_failed = true;
	}
	// Get cmd result (or exception)
	if (source == DevSource.CACHE) {
	    Util.out4.println("Device_2Impl: Returning data from polling buffer");
	    assert polled_cmd != null;
	    return polled_cmd.get_last_cmd_result();
	} else {
	    if (polling_failed == false) {
		Util.out4.println("Device_2Impl: Returning data from polling buffer");
		return polled_cmd.get_last_cmd_result();
	    } else {
		return command_inout(in_cmd, in_data);
	    }
	}

    }
769814
public function init()
	{
		if (!isset($this->htmlOptions['class']))
			$this->htmlOptions['class'] = 'form-' . $this->type;
		else
			$this->htmlOptions['class'] .= ' form-' . $this->type;

		if (!isset($this->inlineErrors))
			$this->inlineErrors = $this->type === self::TYPE_HORIZONTAL;

		if ($this->inlineErrors)
			$this->errorMessageCssClass = 'help-inline error';
		else
			$this->errorMessageCssClass = 'help-block error';

		parent::init();
	}
1009299
public function join($element)
	{
		if($element->slave!==null)
			$this->join($element->slave);
		if(!empty($element->relation->select))
			$this->selects[]=$element->getColumnSelect($element->relation->select);
		$this->conditions[]=$element->relation->condition;
		$this->orders[]=$element->relation->order;
		$this->joins[]=$element->getJoinCondition();
		$this->joins[]=$element->relation->join;
		$this->groups[]=$element->relation->group;
		$this->havings[]=$element->relation->having;

		if(is_array($element->relation->params))
		{
			if(is_array($this->params))
				$this->params=array_merge($this->params,$element->relation->params);
			else
				$this->params=$element->relation->params;
		}
		$this->elements[$element->id]=true;
	}
1058597
function () {
        while (this.head !== null) {
            var temp = this.head;
            this.head = this.head.next();   // use next() the instead of "_next", otherwise it will loop forever
            temp._list = null;
            temp._next = null;
            temp._prev = null;
        }

        this.head = null;
        this.size = 0;
    }
367409
private void onEnd()
   {
      long result = System.currentTimeMillis() - currentTime.get().poll();
      times.incrementAndGet();
      if (result < min.get())
      {
         min.set(result);
      }
      if (max.get() < result)
      {
         max.set(result);
      }
      total.addAndGet(result);
   }
328688
public function execute()
    {
        if (!$this->isEmpty()) {
            $this->table->update($this->context + $this->values, $this->where)->run();
        }

        parent::execute();
    }
619344
public function index()
    {
        $this->getListingService()
            ->setOrder($this->getOrder())
            ->setPagination($this->getPagination())
            ->getFilters()->add($this->getSearchFilter());
        $this->set(
            [
                $this->getEntityNamePlural() => $this->getListingService()
                    ->getList(),
                'pagination' => $this->getListingService()->getPagination()
            ]
        );
    }
1069542
public function init() {
		$this->normalizeData();

		$this->normalizeOptions();

		$this->addEmptyItemIfPlaceholderDefined();

		$this->setDefaultWidthIfEmpty();

		// disabled & readonly
		if (!empty($this->htmlOptions['readonly'])) {
			$this->readonly = true;
		}
		if (!empty($this->htmlOptions['disabled'])) {
			$this->disabled = true;
		}
	}
527420
public function initialize()
    {
        parent::initialize();

        $this->setHtmlAttribute('data-type', 'range');
        $this->setHtmlAttribute('class', 'column-filter');

        $this->getFrom()->initialize();
        $this->getTo()->initialize();

        $this->getFrom()->removeHtmlAttribute('data-type');
        $this->getTo()->removeHtmlAttribute('data-type');
    }
1123840
public function init()
    {
        parent::init();
        $this->db = Instance::ensure($this->db, Connection::className());
        if ($this->cache !== null) {
            $this->cache = Instance::ensure($this->cache, Cache::className());
        }
    }
670801
public function init()
    {
        parent::init();

        foreach ($this->columns as $column) {
            $column->init();
            // index the column by id if it is not already indexed
            if (!array_key_exists($column->id, $this->columns_by_id)) {
                $this->columns_by_id[$column->id] = $column;
            }
        }

        foreach ($this->extra_rows as $row) {
            $row->init();
            // index the row by id if it is not already indexed
            if (!array_key_exists($row->id, $this->rows_by_id)) {
                $this->rows_by_id[$row->id] = $row;
            }
        }

        foreach ($this->groups as $group) {
            $group->init();
            // index the group by id if it is not already indexed
            if (!array_key_exists($group->id, $this->groups_by_id)) {
                $this->groups_by_id[$group->id] = $group;
            }
        }

        foreach ($this->spanning_columns as $column) {
            $column->init();
            // index the row column by id if it is not already indexed
            if (!array_key_exists($column->id, $this->spanning_columns_by_id)) {
                $this->spanning_columns_by_id[$column->id] = $column;
            }
        }
    }
901841
function(each){
    var ast = [];
    var indexVarName = each.key || 'pug_index' + this.eachCount;
    this.eachCount++;


    var body =  [
                  t.variableDeclaration('var', [
                    t.variableDeclarator(t.identifier('$$obj'), each.astObj || this.parseExpr(each.obj))
                  ])
                ]

    var func =  t.expressionStatement(
                  this.wrapCallExpression(t.callExpression(
                    t.memberExpression(
                      t.functionExpression(
                        null,
                        [],
                        t.blockStatement(body),
                        this.useGenerators
                      ),
                      t.identifier('call')
                    )
                    ,[t.thisExpression()]
                  ))
                )
    ast.push(func)


      var blockEach = [
        t.variableDeclaration('var', [
            t.variableDeclarator(t.identifier(each.val), t.memberExpression(t.identifier('$$obj'), t.identifier(indexVarName), true) )
        ])
      ];
      var blockAlt = [];
 
      push.apply(blockEach, this.visit(each.block, each));
      var arrayLoop = 
          t.blockStatement([t.forStatement(
            t.variableDeclaration('var', [
              t.variableDeclarator(t.identifier(indexVarName), t.numericLiteral(0)),
              t.variableDeclarator(t.identifier('$$l'), t.memberExpression(t.identifier('$$obj'), t.identifier('length')))
            ]),
            t.binaryExpression('<', t.identifier(indexVarName), t.identifier('$$l')),
            t.updateExpression('++', t.identifier(indexVarName), false),
            t.blockStatement(blockEach)
          )]);


      var blockObj = [
        t.expressionStatement(t.updateExpression('++', t.identifier('$$l'), false)),
        t.variableDeclaration('var', [
          t.variableDeclarator(t.identifier(each.val), t.memberExpression(t.identifier('$$obj'), t.identifier(indexVarName), true) )
        ])
      ]
      var blockObjAlt = [];

      push.apply(blockObj, this.visit(each.block, each));
      var objectLoop = t.blockStatement([
        t.variableDeclaration('var', [
          t.variableDeclarator(t.identifier('$$l'), t.numericLiteral(0))
        ]),
        t.forInStatement(
          t.variableDeclaration('var', [
            t.variableDeclarator(t.identifier(indexVarName))
          ]),
          t.identifier('$$obj'),
          t.blockStatement(blockObj)
        )
      ])



    if (each.alternate) {
      push.apply(blockAlt, this.visit(each.alternate, each));
      arrayLoop = t.ifStatement(
        t.memberExpression(t.identifier('$$obj'), t.identifier('length')),
        arrayLoop,
        t.blockStatement(blockAlt)
      );
   }


    if (each.alternate) {
      push.apply(blockObjAlt, this.visit(each.alternate, each));
      objectLoop.body.push(t.ifStatement(
            t.binaryExpression('===', t.identifier('$$l'), t.numericLiteral(0)),
            t.blockStatement(blockObjAlt)
      ))
    }

    var it = t.ifStatement(
        t.binaryExpression('==', t.stringLiteral('number'), t.unaryExpression('typeof', t.memberExpression(t.identifier('$$obj'), t.identifier('length')))),
        arrayLoop, objectLoop)
    body.push(it);

    return ast;

  }
763322
public function afterFind()
    {
        /** @var ActiveRecord $owner */
        $owner = $this->owner;

        if ($owner->isRelationPopulated('translations') && $related = $owner->getRelatedRecords()['translations']) {
            $translations = $this->indexByLanguage($related);
            foreach ($this->_languageKeys as $language) {
                foreach ($this->attributes as $attribute) {
                    foreach ($translations as $translation) {
                        if ($translation->{$this->languageField} == $language) {
                            $attributeName = $this->localizedPrefix . $attribute;
                            $this->setMultilingualAttribute($this->getAttributeName($attribute, $language), $translation->{$attributeName});
                        }
                    }
                }
            }
        } else if ($owner->getAttribute($this->_ownerPrimaryKey) !== null) {
            if (!$owner->isRelationPopulated('translation')) {
                $owner->translation;
            }

            $translation = $owner->getRelatedRecords()['translation'];
            if ($translation) {
                foreach ($this->attributes as $attribute) {
                    $attribute_name = $this->localizedPrefix . $attribute;
                    $owner->setMultilingualAttribute($attribute, $translation->$attribute_name);
                }
            }
        }

        foreach ($this->attributes as $attribute) {
            if ($owner->hasAttribute($attribute) && $this->getMultilingualAttribute($attribute)) {
                $owner->setAttribute($attribute, $this->getMultilingualAttribute($attribute));
            }
        }
    }
759689
public function init()
    {
        $this->renameTableQueries = array();
        $this->dropCheckQueries = array();
        $this->dropForeignKeyQueries = array();
        $this->dropIndexQueries = array();
        $this->dropPrimaryKeyQueries = array();
        $this->dropColumnQueries = array();
        $this->alterColumnQueries = array();
        $this->createColumnQueries = array();
        $this->createPrimaryKeyQueries = array();
        $this->createIndexQueries = array();
        $this->createForeignKeyQueries = array();
        $this->createCheckQueries = array();
    }
1024039
public function initializeObject()
    {
        if ($this->cache->has('rulesets') && $this->cache->has('rulesetsIndices')) {
            $this->rulesets = $this->cache->get('rulesets');
            $this->rulesetsIndices = $this->cache->get('rulesetsIndices');
        } else {
            $this->generateRulesets();
            $this->cache->set('rulesets', $this->rulesets);
            $this->cache->set('rulesetsIndices', $this->rulesetsIndices);
        }
    }
1136189
function(){
        while(this.numPairs>0){
            var pair=this.pairs[--this.numPairs];
            pair.shape1=null;
            pair.shape2=null;
        }
        this.numPairChecks=0;
        this.collectPairs();
    }
1008357
public function next()
    {
        parent::next();
        if ($this->_validValues) {
            $this->_values->next();
        }
        $this->_validValues = $this->_values->valid();
    }