Check the dirty state and fire events if needed.
767843
protected void updateDirtyState() {
		boolean dirty = isDirty();
		if (oldDirty != dirty) {
			oldDirty = dirty;
			firePropertyChange(DIRTY_PROPERTY, !dirty, dirty);
		}
	}
865925
public void fireChange() {
        if (getNotification() && listeners != null) {
            EventObject event = new EventObject(this);
            for (int i = 0; i < listeners.size(); i++) {
                listeners.get(i).stateChanged(event);
            }
        }
    }
232870
function() {

		if (Lava.schema.DEBUG && (this._argument.isWaitingRefresh() || this._foreach_scope.isWaitingRefresh())) Lava.t("Rendering a view in dirty state");
		this._requires_refresh_children && this._refreshChildren();
		return this._refresher.render(this._current_templates);

	}
26763
private void checkRunningState() {
    RunningJob running = null;
    try {
      running = jc.getJob(this.mapredJobID);
      if (running.isComplete()) {
        if (running.isSuccessful()) {
          this.state = Job.SUCCESS;
        } else {
          this.state = Job.FAILED;
          this.message = "Job failed!";
          try {
            running.killJob();
          } catch (IOException e1) {

          }
          try {
            this.jc.close();
          } catch (IOException e2) {

          }
        }
      }

    } catch (IOException ioe) {
      this.state = Job.FAILED;
      this.message = StringUtils.stringifyException(ioe);
      try {
        if (running != null)
          running.killJob();
      } catch (IOException e1) {

      }
      try {
        this.jc.close();
      } catch (IOException e1) {

      }
    }
  }
494183
private void checkState()  {
    Preconditions.checkNotNull(logs);
    if (!contiguous)
      return;
    RemoteEditLog prev = null;
    for (RemoteEditLog log : logs) {
      if (prev != null) {
        if (log.getStartTxId() <= prev.getEndTxId()) {
          throw new IllegalStateException("Invalid log manifest:" + this);
        }
      }
      
      prev = log;
    }
  }
78980
protected void fireStateChange() {
		if (this.listeners != null) {
			final ProgressionEvent event = new ProgressionEvent(this, isRootModel());
			for (final ProgressionListener listener : this.listeners.getListeners(ProgressionListener.class)) {
				listener.onProgressionStateChanged(event);
			}
		}
	}
180589
private void checkStatePlaying()
    {
        if (!reverse)
        {
            if (repeat)
            {
                state = AnimState.PLAYING;
                current = first;
            }
            else
            {
                state = AnimState.FINISHED;
            }
        }
        else
        {
            state = AnimState.REVERSING;
        }
    }
1267152
def check(self):
        
        if self.needs_check():
            if self.has_state_changed():
                LOG.debug("state changed, syncing...")
                self.sync()
            elif self.needs_sync():
                LOG.debug("forcing sync after %s seconds",
                          self.forceipchangedetection_sleep)
                self.lastforce = time.time()
                self.sync()
            else:
                # nothing to be done
                pass
1233445
public function cleanUp()
    {
        $this->status = self::STATUS_CLEANINGUP;
        if ($this->process->isRunning()) {
            $this->sendTERMSignal();
        } else {
            $this->status = self::STATUS_CLEANEDUP;
        }

    }
553235
protected function ensureEvents()
	{
		if ($this->_events === null) {
			$this->_events = [];
			if (method_exists($this, 'events')) {
			    if ($events = $this->events()) foreach ($events as $name => $handler) {
					$this->on($name, $handler);
				}
			}
		}
	}
606795
def check_dirty(self):
        '''
        
        '''
        if self._dirty_size is None:
            if self._dirty_render:
                self.render()
                self._dirty_render = False
            if self._dirty_draw:
                self.draw()
                self._dirty_draw = False
            return True
        width, height = self._dirty_size
        self._dirty_size = None
        self.reset_canvas(width, height)
        self._dirty_render = True
        self._dirty_draw = True
        return True
245456
protected function checkProcessStatus(): void
    {
        $this->logProcessStandardStreams();

        $process = $this->process;

        if (!empty($process->getErrorOutput())) {
            if (IdleTimeoutException::exceptionApplies($process)) {
                throw new IdleTimeoutException(
                    $this->options['idle_timeout'],
                    new NodeFatalException($process, $this->options['debug'])
                );
            } else if (NodeFatalException::exceptionApplies($process)) {
                throw new NodeFatalException($process, $this->options['debug']);
            } elseif ($process->isTerminated() && !$process->isSuccessful()) {
                throw new ProcessFailedException($process);
            }
        }

        if ($process->isTerminated()) {
            throw new Exceptions\ProcessUnexpectedlyTerminatedException($process);
        }
    }
1181206
function() {
            var aLength = this._panels.length;
            var bAllClosed = true;
            for(var i=0;i<aLength;i++) {
                if(YUD.hasClass(this._panels[i].firstChild, this.CLASSES.ACTIVE)) {
                    this._panels[i].firstChild.tabIndex = 0;
                    bAllClosed = false;
                }
                else {
                    this._panels[i].firstChild.tabIndex = -1;
                }
            }
            if(bAllClosed) {
                this._panels[0].firstChild.tabIndex = 0;
            }
            // now everything is done so we can fire the stateChanged event
            this.fireEvent(stateChangedEvent);
        }
1025426
def dirty(name,
          target,
          user=None,
          username=None,
          password=None,
          ignore_unversioned=False):
    '''
    
    '''
    ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
    return _fail(ret, 'This function is not implemented yet.')
1243442
@Override
  public void onFailure(Throwable cause) {
    checkState();
    for (Callback<T> cb : callbacks) {
      cb.onFailure(cause);
    }
    callbacks = null; // note that we've fired
  }
1022180
private boolean checkEventsControllers(EventModel event) {
        List<CompletableFuture<Boolean>> collect = eventsControllers.stream()
                .map(controller -> submit(() -> controller.controlEventDispatcher(event)).thenApply(result -> {
                    if (!result)
                        debug("Event: " + event + " is canceled by " + controller.getID());
                    return result;
                }))
                .collect(Collectors.toList());
        try {
            collect = timeOut(collect, 1000);
        } catch (InterruptedException e) {
            debug("interrupted");
        }
        return collect.stream()
                .map(future -> {
                    try {
                        return future.get();
                    } catch (InterruptedException | ExecutionException e) {
                        return null;
                    }
                })
                .filter(Objects::nonNull)
                .noneMatch(bool -> !bool);
    }
153681
def clean(self, force=False):
        """"""

        if self.is_finalized and not force:
            self.warn("Can't clean; bundle is finalized")
            return False

        self.log('---- Cleaning ----')
        self.state = self.STATES.CLEANING
        self.dstate = self.STATES.BUILDING

        self.commit()

        self.clean_sources()
        self.clean_tables()
        self.clean_partitions()
        self.clean_build()
        self.clean_files()
        self.clean_ingested()
        self.clean_build_state()
        self.clean_progress()

        self.state = self.STATES.CLEANED

        self.commit()

        return True