Poll for changes in the evaluation

@method poll
350546
function() {
      var t = this,
          newValue = t.eval_control(t.key, t.depth);

      // Set the new value if it has changed from the current value
      if (!_.isEqual(newValue, t.get('value'))) {
        t.set({value: newValue});
      }
    }
701025
function toolbarChanged() {
		var updatedUrl, value, tests,
			field = this,
			params = {};

	// Detect if field is a select menu or a checkbox
		if ( "selectedIndex" in field ) {
			value = field.options[ field.selectedIndex ].value || undefined;
		} else {
			value = field.checked ? ( field.defaultValue || true ) : undefined;
		}

		params[ field.name ] = value;
		updatedUrl = setUrl( params );

	// Check if we can apply the change without a page refresh
		if ( "hidepassed" === field.name && "replaceState" in window.history ) {
			QUnit.urlParams[ field.name ] = value;
			config[ field.name ] = value || false;
			tests = id( "qunit-tests" );
			if ( tests ) {
				toggleClass( tests, "hidepass", value || false );
			}
			window.history.replaceState( null, "", updatedUrl );
		} else {
			window.location = updatedUrl;
		}
	}
963956
function updateOptions( $elem, prev, curr ) {
        var bselect = _callMethod( $elem, "element" );

        $.each( prev, function(key, val) {
            if ( curr[ key ] !== val ) {
                if ( key === "size" ) {
                    var sizes = $.map( bootstrapButtonSizes.slice( 0 ), function( size ) {
                        return "bselect-" + size;
                    }).join( " " );

                    bselect.removeClass( sizes );
                    if ( bootstrapButtonSizes.indexOf( curr.size ) > -1 ) {
                        bselect.addClass( "bselect-" + curr.size );
                    }
                }
            }
        });
    }
262344
def _poll_for_update(self):
    """"""
    test, test_state = _get_executing_test()

    if test is None:
      time.sleep(_WAIT_FOR_EXECUTING_TEST_POLL_S)
      return

    state_dict, event = self._to_dict_with_event(test_state)
    self._update_callback(state_dict)

    plug_manager = test_state.plug_manager
    plug_events = [
        plug_manager.get_plug_by_class_path(plug_name).asdict_with_event()[1]
        for plug_name in plug_manager.get_frontend_aware_plug_names()
    ]
    events = [event] + plug_events

    # Wait for the test state or a plug state to change, or for the previously
    # executing test to finish.
    while not _wait_for_any_event(events, _CHECK_FOR_FINISHED_TEST_POLL_S):
      new_test, _ = _get_executing_test()
      if test != new_test:
        break
585431
function() {
		edbml.Update.prototype.update.call(this);
		var element = this.element();
		if (this._beforeUpdate(element)) {
			this._update(element);
			this._afterUpdate(element);
			this._report();
		}
	}
201789
def _poll_loop(self):
        """"""
        next_poll = time.time()
        while True:
            next_poll += self._poll_period
            timeout = next_poll - time.time()
            if timeout < 0:
                timeout = 0
            try:
                return self._stop_queue.get(timeout=timeout)
            except TimeoutError:
                # No stop, no problem
                pass
            try:
                self.handle_changes(self.client.get_changes())
            except Exception:
                # TODO: should fault here?
                self.log.exception("Error while getting changes")
657160
function processAfterStateChange(el) {
    const optionValue = el.value;
    const optionIndex = Array.prototype.slice.call(el.parentNode.children).indexOf(el);
    this.setSelectedOption(optionValue);
    emitAndFire(this, 'select-change', {
        index: optionIndex,
        selected: [optionValue],
        el
    });
}
764259
function () {
    var self = this;
    if (self._pollsScheduledButNotStarted > 0)
      return;
    ++self._pollsScheduledButNotStarted;
    self._taskQueue.queueTask(function () {
      self._pollMongo();
    });
  }
454528
function() {
			this.writeDebug('sorting',arguments);
			var _this = this,
				$mapDiv = $('#' + _this.settings.mapID),
				$sortSelect = $('#' + _this.settings.sortID);

			if ($sortSelect.length === 0) {
				return;
			}

			$sortSelect.on('change.'+pluginName, function (e) {
				e.stopPropagation();

				// Reset pagination.
				if (_this.settings.pagination === true) {
					_this.paginationChange(0);
				}

				var sortMethod,
					sortVal;

				sortMethod = (typeof $(this).find(':selected').attr('data-method') !== 'undefined') ?  $(this).find(':selected').attr('data-method') : 'distance';
				sortVal = $(this).val();

				_this.settings.sortBy.method = sortMethod;
				_this.settings.sortBy.prop = sortVal;

				// Callback
				if (_this.settings.callbackSorting) {
					_this.settings.callbackSorting.call(this, _this.settings.sortBy);
				}

				if ($mapDiv.hasClass('bh-sl-map-open')) {
					_this.mapping(mappingObj);
				}
			});
		}
314919
function (args) {
            if (this._updatesStopped()) {
                return;
            }
            var dataName = args.dataName;
            if (dataName == "selected") {
                var item = args.dataHolder;
                if ((args.newValue && !args.oldValue) // item was just selected
                        || (!args.newValue && args.oldValue) // item was just unselected
                ) {
                    this._selectionChanged(item.index);
                }
            } else if (dataName == "initiallyDisabled") {
                this._updateCurrentlyDisabled([args.dataHolder]);
            }
        }
457857
function() {
		edbml.Update.prototype.update.call(this);
		var element = this.element();
		if (element && this._beforeUpdate(element)) {
			//gui.DOMPlugin.html ( element, this.xelement.outerHTML );
			gui.DOMPlugin.html(element, this.xelement.innerHTML);
			this._afterUpdate(element);
			this._report();
		}
	}
714554
function () {
            var newValue = !this.getProperty("value");
            this._cfg.value = newValue;
            this.setProperty("value", newValue);
            // setProperty on value might destroy the widget
            if (this._cfg) {
                this._setState();
                this._updateDomForState();
                var changeCallback = this._cfg.onchange;
                if (changeCallback) {
                    this.evalCallback(changeCallback);
                }
            }
        }
159456
def poll(self, offset=None, poll_timeout=600, cooldown=60, debug=False):
        '''

        '''
        if self.config['api_key'] is None:
            raise ValueError('config api_key is undefined')

        if offset or self.config.get('offset', None):
            self.offset = offset or self.config.get('offset', None)

        self._start()

        while True:
            try:
                response = self.get_updates(poll_timeout, self.offset)
                if response.get('ok', False) is False:
                    raise ValueError(response['error'])
                else:
                    self.process_updates(response)
            except Exception as e:
                print('Error: Unknown Exception')
                print(e)
                if debug:
                    raise e
                else:
                    time.sleep(cooldown)
1046817
function reset_poll()
	{
		global $db;

		$db->sql_transaction('begin');
		$sql = 'UPDATE ' . POLL_OPTIONS_TABLE . '
			SET poll_option_total = 0
			WHERE topic_id = ' . $this->topic_id;
		$db->sql_query($sql);

		$sql = 'DELETE FROM ' . POLL_VOTES_TABLE . '
			WHERE topic_id = ' . $this->topic_id;
		$db->sql_query($sql);

		$this->poll_start = time();
		$this->poll_last_vote = 0;
		$sql = 'UPDATE ' . TOPICS_TABLE . '
			SET poll_start = ' . $this->poll_start . ',
				poll_last_vote = 0
			WHERE topic_id = ' . $this->topic_id;
		$db->sql_query($sql);

		$db->sql_transaction('commit');
	}
301636
function (changes) {
            if (this.__isStopped) {
                this.__queuedChanges = changes.concat(this.__queuedChanges);
                return;
            }

            var sorted = this.__sortPaths();
            // var loaded = this.__textLoaded;
            var totalSelectors = 0;
            var styleBuilders = {};
            var utilsArray = ariaUtilsArray;

            for (var i = 0, len = sorted.length; i < len; i += 1) {
                var cssPath = sorted[i];
                var styleTagId = this.__styleTagAssociation[cssPath];

                if (!utilsArray.contains(changes, styleTagId)) {
                    // This tag shouldn't be updated
                    continue;
                } else if (!styleBuilders[styleTagId]) {
                    styleBuilders[styleTagId] = [];
                }

                styleBuilders[styleTagId].push("/**", cssPath, "**/", this.__textLoaded[cssPath].text);

                totalSelectors += this.__textLoaded[cssPath].lines || 0;
            }

            // IE only allows 4096 selectors, warn the user on any browser
            if (totalSelectors > 4000) {
                this.$logWarn(this.CSSTEMPLATE_MAX_SELECTORS_REACHED);
            }

            return this.__reloadStyleTags(styleBuilders);
            // returning something is important for unit tests
        }
397640
function pageDomHasChanged(page, ph, callback) {
    var elapsed = 0;
    var waitTimeOver = false;
    var domHasChanged = false;
    var originalDom = '';

    async.waterfall([
        // save the initial dom
        function (callback) {
            getData.takeSnapshot(page, ph, function (error, page, ph, dom) {
                if (error) {
                    callback (error);
                    return;
                }

                originalDom = dom;
                callback();
            });
        },

        // poll the page for changes in the dom or until timeout
        function (callback) {
            async.until(
                // conditions for stopping the poll
                function () {
                    waitTimeOver = elapsed > constants.WAIT_TIMEOUT;
                    return waitTimeOver || domHasChanged;
                },
                function (callback) {
                    // polls the page at an interval
                    setTimeout(function () {
                        elapsed += constants.POLL_INTERVAL;
                        getData.takeSnapshot(page, ph, function (error, page, ph, newDom) {
                            if (error) {
                                callback(error);
                                return;
                            }
                            domHasChanged = helpers.domIsDifferent(originalDom, newDom);
                            callback();
                        });
                    }, constants.POLL_INTERVAL);
                },

                function (error) {
                    if (waitTimeOver) {
                        callback('Timeout while waiting for dom to change');
                        return;
                    }
                    callback(error);
                }
            );
        }
    ], function (error) {
        callback(error, page, ph);
    });
}
773544
def poll(self):
        
        response = self.client.protocol.get('/uploads/{upload_id}',
                                            upload_id=self.upload_id,
                                            check_for_errors=False)

        self.update_from_response(response)