check whether the update has in fact been applied
550996
function checkTable(count) {
      // Make sure we don't go into an infinite loop
      if (++count > 1000) return cb(new Error('Wait limit exceeded'))

      self.describeTable(function(err, data) {
        if (err) return cb(err)
        if (data.TableStatus !== 'ACTIVE' || (data.GlobalSecondaryIndexes &&
            !data.GlobalSecondaryIndexes.every(function (idx) {return idx.IndexStatus === 'ACTIVE'}))) {
          return setTimeout(checkTable, 1000, count)
        }

        // If the table is ACTIVE then return
        cb(null, data)
      })
    }
385574
def updated_on(self):
    """"""
    s = self._info.get('updated', None)
    return dateutil.parser.parse(s) if s else None
414066
def is_changed():
    
    executed, changed_lines = execute_git('status --porcelain', output=False)
    merge_not_finished = mod_path.exists('.git/MERGE_HEAD')
    return changed_lines.strip() or merge_not_finished
512247
function check_for_update() {
		$update_data = get_transient( $this->product_key );

		if ( false === $update_data ) {
			$failed      = false;
			$update_data = $this->get_version_data();
			if ( empty( $update_data ) ) {
				$failed = true;
			}
			// If the response failed, try again in 30 minutes.
			if ( $failed ) {
				$data              = new \stdClass();
				$data->new_version = $this->product->get_version();
				set_transient( $this->product_key, $data, 30 * MINUTE_IN_SECONDS );

				return false;
			}
			$update_data->sections = maybe_unserialize( $update_data->sections );

			set_transient( $this->product_key, $update_data, 12 * HOUR_IN_SECONDS );
		}
		if ( ! isset( $update_data->new_version ) ) {
			return false;
		}
		if ( version_compare( $this->product->get_version(), $update_data->new_version, '>=' ) ) {
			return false;
		}

		return (array) $update_data;
	}
6781
async def check_update(dev: Device, internet: bool, update: bool):
    """"""
    if internet:
        print("Checking updates from network")
    else:
        print("Not checking updates from internet")
    update_info = await dev.get_update_info(from_network=internet)
    if not update_info.isUpdatable:
        click.echo("No updates available.")
        return
    if not update:
        click.echo("Update available: %s" % update_info)
        click.echo("Use --update to activate update!")
    else:
        click.echo("Activating update, please be seated.")
        res = await dev.activate_system_update()
        click.echo("Update result: %s" % res)
1328771
public static boolean isGroupUpdate(Update update) {
    if (MESSAGE.test(update)) {
      return update.getMessage().isGroupMessage();
    } else if (CALLBACK_QUERY.test(update)) {
      return update.getCallbackQuery().getMessage().isGroupMessage();
    } else if (CHANNEL_POST.test(update)) {
      return update.getChannelPost().isGroupMessage();
    } else if (EDITED_CHANNEL_POST.test(update)) {
      return update.getEditedChannelPost().isGroupMessage();
    } else if (EDITED_MESSAGE.test(update)) {
      return update.getEditedMessage().isGroupMessage();
    } else {
      return false;
    }
  }
989050
def _update(self):
        """"""
        update = False

        with self._lock:
            for fname in ['pending.data', 'completed.data']:
                data_file = join(self._data_location, fname)
                if exists(data_file):
                    mtime = getmtime(data_file)
                    if mtime > self._mtime:
                        self._mtime = mtime
                        update = True

            if update:
                self._tasks = {}
                tasklist = loads(run(['task', 'rc.verbose=nothing', 'rc.hooks=off', 'rc.data.location={self._data_location}'.format(**locals()), 'export'], stdout=PIPE).stdout.decode('utf-8'))
                for task in tasklist:
                    project = task['project'] if 'project' in task else 'unaffiliated'
                    if project not in self._tasks:
                        self._tasks[project] = {}
                    self._tasks[project][task['uuid']] = task
497281
function () {
        function checkUpdate() {
            var current = module.exports.current();
            if (current !== last) {
                last = current;
                events.trigger('update', current);
            }
        }

        // Do not run unless breakpoints are available.
        if (!running && breakpoints.length) {
            running = true;
            global.addEventListener('resize', function () {
                if (!working) {
                    working = true;
                    global.requestAnimationFrame(function () {
                        checkUpdate();
                        working = false;
                    });
                }
            });
        }
        checkUpdate();
    }
658349
public static function checkPackageUpdates()
    {
        $em = \ORM::entityManager();
        $items = self::getAvailableMarketplaceItems(false);
        foreach ($items as $i) {
            $p = Package::getByHandle($i->getHandle());
            if (is_object($p)) {
                /**
                 * @var $p \Concrete\Core\Entity\Package
                 */
                $p->setPackageAvailableVersion($i->getVersion());
                $em->persist($p);
            }
        }
        $em->flush();
    }
829422
def _check_if_all_updated(self):
        """"""
        for g in self.toc.toc:
            if g not in self.values:
                return False
            for n in self.toc.toc[g]:
                if n not in self.values[g]:
                    return False

        return True
813124
public function hasOnUpdate()
    {
        $database = $this->getTable()->getDatabase();
        if($database instanceof Database &&
               $this->onUpdate === $database->getPlatform()->getDefaultFKOnUpdateBehavior()) {
          return false;
        }

        return ($this->onUpdate !== self::NONE);
    }
28002
protected function checkUpdates()
    {
        // Avoid checking more than once in this process.
        if (self::$checkedUpdates) {
            return;
        }
        self::$checkedUpdates = true;

        // Check that the Phar extension is available.
        if (!extension_loaded('Phar')) {
            return;
        }

        // Get the filename of the Phar, or stop if this instance of the CLI is
        // not a Phar.
        $pharFilename = \Phar::running(false);
        if (!$pharFilename) {
            return;
        }

        // Check if the file is writable.
        if (!is_writable($pharFilename)) {
            return;
        }

        // Check if updates are configured.
        $config = $this->config();
        if (!$config->get('updates.check')) {
            return;
        }

        // Determine an embargo time, after which updates can be checked.
        $timestamp = time();
        $embargoTime = $timestamp - $config->get('updates.check_interval');

        // Stop if updates were last checked after the embargo time.
        /** @var \Platformsh\Cli\Service\State $state */
        $state = $this->getService('state');
        if ($state->get('updates.last_checked') > $embargoTime) {
            return;
        }

        // Stop if the Phar was updated after the embargo time.
        if (filemtime($pharFilename) > $embargoTime) {
            return;
        }

        // Ensure classes are auto-loaded if they may be needed after the
        // update.
        /** @var \Platformsh\Cli\Service\Shell $shell */
        $shell = $this->getService('shell');
        /** @var \Platformsh\Cli\Service\QuestionHelper $questionHelper */
        $questionHelper = $this->getService('question_helper');
        $currentVersion = $this->config()->get('application.version');

        /** @var \Platformsh\Cli\Service\SelfUpdater $cliUpdater */
        $cliUpdater = $this->getService('self_updater');
        $cliUpdater->setAllowMajor(true);
        $cliUpdater->setTimeout(5);

        try {
            $newVersion = $cliUpdater->update(null, $currentVersion);
        } catch (\RuntimeException $e) {
            if (strpos($e->getMessage(), 'Failed to download') !== false) {
                $this->stdErr->writeln('<error>' . $e->getMessage() . '</error>');
                $newVersion = false;
            } else {
                throw $e;
            }
        }

        $state->set('updates.last_checked', $timestamp);

        // If the update was successful, and it's not a major version change,
        // then prompt the user to continue after updating.
        if ($newVersion !== false) {
            $exitCode = 0;
            list($currentMajorVersion,) = explode('.', $currentVersion, 2);
            list($newMajorVersion,) = explode('.', $newVersion, 2);
            if ($newMajorVersion === $currentMajorVersion
                && isset($this->input)
                && $this->input instanceof ArgvInput
                && is_executable($pharFilename)) {
                $originalCommand = $this->input->__toString();
                $questionText = "\n"
                    . 'Original command: <info>' . $originalCommand . '</info>'
                    . "\n\n" . 'Continue?';
                if ($questionHelper->confirm($questionText)) {
                    $this->stdErr->writeln('');
                    $exitCode = $shell->executeSimple(escapeshellarg($pharFilename) . ' ' . $originalCommand);
                }
            }
            exit($exitCode);
        }

        $this->stdErr->writeln('');
    }
180253
function check() {
    module.hot.check(function(err, updatedModules) {
      if (err) return handleError(err);

      if (!updatedModules) {
        logger.warn('Cannot find update any update.');
        return;
      }

      apply(updatedModules);
    });
  }
1113891
def applied():
    """"""
    upgrader = InvenioUpgrader()
    logger = upgrader.get_logger()

    try:
        upgrades = upgrader.get_history()

        if not upgrades:
            logger.info("No upgrades have been applied.")
            return

        logger.info("Following upgrade(s) have been applied:")

        for u_id, applied in upgrades:
            logger.info(" * %s (%s)" % (u_id, applied))
    except RuntimeError as e:
        for msg in e.args:
            logger.error(unicode(msg))
        raise
603657
def _need_update(self):
        ''
        if self.currval >= self.next_update or self.finished: return True

        delta = time.time() - self.last_update_time
        return self._time_sensitive and delta > self.poll
207038
def check():
    """"""
    upgrader = InvenioUpgrader()
    logger = upgrader.get_logger()

    try:
        # Run upgrade pre-checks
        upgrades = upgrader.get_upgrades()

        # Check if there's anything to upgrade
        if not upgrades:
            logger.info("All upgrades have been applied.")
            return

        logger.info("Following upgrade(s) have not been applied yet:")
        for u in upgrades:
            logger.info(
                " * {0} {1}".format(u.name, u.info))

        logger.info("Running pre-upgrade checks...")
        upgrader.pre_upgrade_checks(upgrades)
        logger.info("Upgrade check successful - estimated time for upgrading"
                    " Invenio is %s..." % upgrader.human_estimate(upgrades))
    except RuntimeError as e:
        for msg in e.args:
            logger.error(unicode(msg))
        logger.error("Upgrade check failed. Aborting.")
        raise
528456
public function checkUpdate()
    {
        $url = 'https://repo.packagist.org/p/ironphp/ironphp.json';
        $packagistJson = @file_get_contents($url);
        if($packagistJson === true) {
            $packagistArray = json_decode($packagistJson,true);
            $packagistData = $packagistArray['packages']['ironphp/ironphp']['dev-master'];
            $time = $packagistData['time'];
            $version = $packagistData['version']; //dev-master
            $branchAlias = $packagistData['extra']['branch-alias']['dev-master']; // 0.0.1-dev
            date_default_timezone_set('Asia/Kolkata');
            $parsedTime = date_parse($time);
            $timeStamp = mktime($parsedTime['hour'], $parsedTime['minute'], $parsedTime['second'], $parsedTime['month'], $parsedTime['day'], $parsedTime['year']);
        }
        $installData = $this->app->getIntallTime();

        if($packagistJson === true) {
            echo Colors::WHITE." ".str_replace('T', ' ', substr(date(DATE_ATOM, $timeStamp), 0, 19));
            echo Colors::GREEN."\nChecking updates... ".Colors::WHITE;
            if($timeStamp > $installData->time) {
                if($branchAlias != $this->app->version()) {
                    print "Package have an update ".$branchAlias;
                }
                else {
                    print "Package have an update ".$version;
                }
            }
            else {
                print "There is no update.";
            }
        }
        else {
            echo Colors::GREEN."\nChecking updates... ".Colors::WHITE." No internet!";
        }
    }