Returns pending migrations.

@return a sorted set of pending migrations
420805
public List<Migration> getPendingMigrations() {
        List<String> appliedMigrations = getAppliedMigrationVersions();

        List<Migration> allMigrations = migrationResolver.resolve();
        List<Migration> pendingMigrations = new ArrayList<Migration>();
        for (Migration migration : allMigrations) {
            if(!appliedMigrations.contains(migration.getVersion())){
                pendingMigrations.add(migration);
            }
        }
        return pendingMigrations;
    }
52534
public List<ChangesContainer> getSortedList()
   {
      List<ChangesContainer> changesContainers = new ArrayList<ChangesContainer>(changes);
      Collections.sort(changesContainers);
      return changesContainers;
   }
133293
public function getLast() {
		$list = array_reverse($this->getList());
		foreach($list as $migration=>$params) {
			if(isset($params['migrated']))
				return $migration;
		}
	}
36552
public function getMigrations()
    {
        if (count($this->_migrations) <= 0 && $this->_config !== null) {
            $versions = [];
            $paths = $this->_config->getMigrationPaths();
            foreach ($paths as $path) {
                $files = glob($path . '/*.php');
                foreach ($files as $file) {
                    $fileName = basename($file);
                    if (Util::isValidMigrationFileName($fileName)) {
                        $version = Util::getVersionFromFileName($fileName);
                        if (Arr::key($version, $versions)) {
                            throw new \InvalidArgumentException(
                                __d(
                                    'extensions',
                                    'Duplicate migration - "%s" has the same version as "%s"',
                                    $file,
                                    $versions[$version]->getVersion()
                                )
                            );
                        }

                        //  Convert the filename to a class name.
                        $class = Util::mapFileNameToClassName($fileName);

                        /** @noinspection PhpIncludeInspection */
                        require_once $file;
                        if (!class_exists($class)) {
                            throw new \InvalidArgumentException(
                                __d('extensions', 'Could not find class "%s" in file "%s"', $class, $file)
                            );
                        }

                        //  Instantiate migration class.
                        $migration = new $class($version);
                        if (!($migration instanceof AbstractMigration)) {
                            throw new \InvalidArgumentException(
                                __d(
                                    'extensions',
                                    'The class "%s" in file "%s" must extend \Phinx\Migration\AbstractMigration',
                                    $class,
                                    $file
                                )
                            );
                        }

                        $versions[$version] = $migration;
                    }
                }
            }

            ksort($versions);
            $this->_migrations = $versions;
        }

        return $this->_migrations;
    }
128882
public function getVersions()
    {
        $this->createIfNotExists();
        $sql = 'SELECT version FROM schema_migration ORDER BY version DESC';
        $versions = array();
        foreach ($this->connection->query($sql) as $row) {
            $versions[] = $row['version'];
        }

        return $versions;
    }
403538
public Set<RosterEntry> getEntries() {
        Set<RosterEntry> allEntries;
        synchronized (rosterListenersAndEntriesLock) {
            allEntries = new HashSet<>(entries.size());
            for (RosterEntry entry : entries.values()) {
                allEntries.add(entry);
            }
        }
        return allEntries;
    }
1049084
def pendingResultsFor( self, ps ):
        """"""
        k = self._parametersAsIndex(ps)
        if k in self._results.keys():
            # filter out pending job ids, which can be anything except dicts
            return [ j for j in self._results[k] if not isinstance(j, dict) ]
        else:
            return []
386192
protected function alreadyExistingMigrations()
    {
        $matchingFiles = glob($this->getMigrationPath('*'));

        return array_map(function ($path) {
            return basename($path);
        }, $matchingFiles);
    }
431540
private function loadMigrations()
    {
        // Load the migrations already performed

        $migrated = [];
        $rows = $this->db->table('_migrations')->select('name')->all();
        foreach ($rows as $row) {
            $migrated[] = $row['name'];
        }

        // Load the outstanding migrations

        $migrations = [];

        // read migrations from folder
        $files = [];
        list_files($files, $this->migrationPath, ['php']);
        foreach ($files as $file) {
            $name = basename($file, '.php');
            $migrations[$name] = $file;
        }

        // read migrations included by plugins
        $migrations = array_merge($migrations, $this->pluginMigrations());

        // remove migrations already performed
        foreach ($migrations as $name => $file) {
            if (in_array($name, $migrated)) {
                unset($migrations[$name]);
            }
        }

        return $migrations;
    }
769772
protected function pendingMigrations($files, $ran)
    {
        return Collection::make($files)
                ->reject(function ($file) use ($ran) {
                    return in_array($this->getMigrationName($file), $ran);
                })->values()->all();
    }
1214467
private List<MigrationInfo> failed(MigrationInfo[] migrationInfos) {
        if (migrationInfos.length == 0)
            throw new NotFoundException();
        List<MigrationInfo> failedMigrations = Lists.newArrayList();
        for (MigrationInfo migrationInfo : migrationInfos) {
            if (migrationInfo.getState().isFailed()) {
                failedMigrations.add(migrationInfo);
            }
        }

        return failedMigrations;
    }
1002777
public List<T> getSortedKeys() {
    List<T> l = Lists.newArrayList(counts.keySet());
    Collections.sort(l, Ordering.natural().reverse().onResultOf(Functions.forMap(counts.getBaseMap())));
    return l;
  }
671423
public List<T> keySetSorted() {
        List<T> result = new ArrayList<>();

        PriorityQueue<Pair<T, Double>> pq = asPriorityQueue();
        while (!pq.isEmpty()) {
            result.add(pq.poll().getFirst());
        }

        return result;
    }
874559
public function getNext() {
		$list = $this->getList();
		foreach($list as $migration=>$params) {
			if(!isset($params['migrated']))
				return $migration;
		}
	}
1183903
protected function alreadyExecutedMigrations()
    {
        $results = $this->db->query(
            'SELECT * FROM `app_migrations`',
            DbAdapter::QUERY_MODE_EXECUTE
        );

        return (array) iterator_to_array($results, true);
    }
128960
public Set<String> getTypesWithActiveSchemaFormatters() {

        Set<String> result = Sets.newHashSet(getTypesWithModifiableFormatters());
        for (CmsFormatterChangeSet changeSet : getFormatterChangeSets()) {
            changeSet.applyToTypes(result);
        }
        return result;
    }
1251084
def available_migrations():
    '''
    
    '''
    migrations = []
    for filename in resource_listdir('udata', 'migrations'):
        if filename.endswith('.js'):
            migrations.append(('udata', 'udata', filename))

    plugins = entrypoints.get_enabled('udata.models', current_app)
    for plugin, module in plugins.items():
        if resource_isdir(module.__name__, 'migrations'):
            for filename in resource_listdir(module.__name__, 'migrations'):
                if filename.endswith('.js'):
                    migrations.append((plugin, module.__name__, filename))
    return sorted(migrations, key=lambda r: r[2])