Ensure that the appropriate versionlock plugin is present
501871
def _check_versionlock():
    '''
    
    '''
    if _yum() == 'dnf':
        if int(__grains__.get('osmajorrelease')) >= 26:
            if six.PY3:
                vl_plugin = 'python3-dnf-plugin-versionlock'
            else:
                vl_plugin = 'python2-dnf-plugin-versionlock'
        else:
            if six.PY3:
                vl_plugin = 'python3-dnf-plugins-extras-versionlock'
            else:
                vl_plugin = 'python-dnf-plugins-extras-versionlock'
    else:
        vl_plugin = 'yum-versionlock' \
            if __grains__.get('osmajorrelease') == '5' \
            else 'yum-plugin-versionlock'

    if vl_plugin not in list_pkgs():
        raise SaltInvocationError(
            'Cannot proceed, {0} is not installed.'.format(vl_plugin)
        )
523419
def _ensure_systemd(version):
    '''
    
    '''
    try:
        version = int(version)
    except ValueError:
        raise CommandExecutionError('Invalid version \'{0}\''.format(version))

    try:
        installed = _sd_version()
        log.debug('nspawn: detected systemd %s', installed)
    except (IndexError, ValueError):
        raise CommandExecutionError('nspawn: Unable to get systemd version')

    if installed < version:
        raise CommandExecutionError(
            'This function requires systemd >= {0} '
            '(Detected version: {1}).'.format(version, installed)
        )
304752
def check_version(self, check, timeout=None, metadata=None,
                      credentials=None):
        """"""
        return self.stub.CheckVersion(check, timeout=timeout,
                                      metadata=metadata,
                                      credentials=credentials)
61861
def _is_plugin_ok(self, instance):
        ''' 

        '''
        try:
            verifyObject(IPlugin, instance)
        except BrokenImplementation:
            logger.warning(
                "Plugin '%(name)s' doesn't provide the plugin interface",
                {'name': self._full_class_name(instance)}
            )
            return False

        # Check if the plugin is already registered
        reg = self.plugins.get(instance.name)
        if reg:
            logger.warning(
                "Plugin '%(name)s' by '%(instance)s' is already provided by '%(reg)s'", {
                    'name': instance.name, 'instance': self._full_class_name(instance),
                    'reg': self._full_class_name(reg)
                }
            )
            return False

        for tag in instance.tags:
            if tag not in PLUGIN_TAGS:
                logger.warning(
                    "Invalid tag '%(tag)s' in '%(instance)s'",
                    {'tag': tag, 'instance': self._full_class_name(instance)}
                )
                return False

        return True
715780
public static String getBuildPluginVersion(AbstractWisdomMojo mojo, String plugin) {
        List<Plugin> plugins = mojo.project.getBuildPlugins();
        for (Plugin plug : plugins) {
            if (plug.getArtifactId().equals(plugin)) {
                return plug.getVersion();
            }
        }
        // Not found.
        return null;
    }
355723
def lock_version(self, service_id, version_number):
		""""""
		content = self._fetch("/service/%s/version/%d/lock" % (service_id, version_number))
		return self._status(content)
75614
def check_version(cls):
        """"""
        super(SimpleCpnrDriver, cls).check_version()
        model.configure_pnr()
        cls.recover_networks()
        ver = model.get_version()
        if ver < cls.MIN_VERSION:
            LOG.warning("CPNR version does not meet minimum requirements, "
                        "expected: %(ever)f, actual: %(rver)f",
                        {'ever': cls.MIN_VERSION, 'rver': ver})
        return ver
239944
def call_env_check_consistency(cls, kb_app, builder: StandaloneHTMLBuilder,
                                   sphinx_env: BuildEnvironment):
        

        for callback in EventAction.get_callbacks(kb_app,
                                                  SphinxEvent.ECC):
            callback(kb_app, builder, sphinx_env)
1200296
def backwards_compatibilize
      config = clone
      # Provide backwards-compatibility
      check_auto(config)
      check_server(config)

      renamed_key "server_port", "port", config
      renamed_key "plugins", "plugins_dir", config
      renamed_key "layouts", "layouts_dir", config
      renamed_key "data_source", "data_dir", config

      check_pygments(config)
      check_include_exclude(config)
      check_coderay(config)
      check_maruku(config)

      config
    end
441178
function ensureLock(client, path) {
  var lock = client.lock;
  if(!(lock && !('unlocked' in lock))) {
    // Create an error so we get a stack, too.
    var err = new Error('Attempted sync step without lock.');
    log.error({client: client, err: err}, 'Client should own lock but does not for ' + path);
    return false;
  }
  return true;
}
1194629
private void ensureGroovyComparability(final ClassLoader classLoader) throws MojoExecutionException {
    Version groovyVersion = groovyVersionHelper.detectVersion(classLoader);
    if (groovyVersion == null) {
      // complain and continue
      log.error("Unable to determine Groovy version");
    }
    else {
      log.debug("Detected Groovy version: {}", groovyVersion);
      if (versionHelper.before(2).containsVersion(groovyVersion)) {
        throw new MojoExecutionException("Unsupported Groovy version: " + groovyVersion);
      }
    }
  }
216299
private static void checkSurefireVersion(Object mojo) throws Exception {
        try {
            // Check version specific methods/fields.
            // mojo.getClass().getMethod(GET_RUN_ORDER);
            getField(SKIP_TESTS_FIELD, mojo);
            getField(FORK_MODE_FIELD, mojo);

            // We will always require the following.
            getField(ARGLINE_FIELD, mojo);
            getField(EXCLUDES_FIELD, mojo);
        } catch (NoSuchMethodException ex) {
            throwMojoExecutionException(mojo, "Unsupported surefire version.  An alternative is to use select/restore goals.", ex);
        }
    }
926808
def check_version(ctx, param, value):
    """"""
    if ctx.resilient_parsing:
        return

    if not value and ctx.invoked_subcommand != 'run':
        ctx.call_on_close(_check_version)
474948
def on_ok(self):
        
        self.parentApp.repo_value['versions'] = {}
        self.parentApp.repo_value['build'] = {}
        for branch in self.branch_cb:
            if self.branch_cb[branch].value:
                # process checkboxes
                self.parentApp.repo_value['versions'][branch] = self.commit_tc[branch].values[self.commit_tc[branch].value]
                self.parentApp.repo_value['build'][branch] = True
        if self.error:
            self.quit()
        self.parentApp.addForm('CHOOSETOOLS',
                               ChooseToolsForm,
                               name='Choose tools to add for new plugin'
                               '\t\t\t\t\t\t^Q to quit',
                               color='CONTROL')
        self.parentApp.change_form('CHOOSETOOLS')
143751
def is_canonical(version, loosedev=False):  # type: (str, bool) -> bool
    
    if loosedev:
        return loose440re.match(version) is not None
    return pep440re.match(version) is not None
922945
function ensureDockerVersion() {
    if (opts.generate) {
        return P.resolve(true);
    }
    return promisedSpawn(['docker', 'version', '--format', '{{.Server.Version}}'], {
        capture: true
    })
    .then((dockerVersion) => {
        if (!dockerVersion) {
            console.error('Docker is not found.');
            process.exit(1);
        }

        const minimumDockerVersion = os.type() === 'Darwin' ? '1.12.0' : '1.8.0';
        dockerVersion = dockerVersion.replace(/\.0+(0|[1-9]+)/g, '.$1');
        if (semver.lt(dockerVersion, minimumDockerVersion)) {
            console.error(`Building the deploy repo on ${os.type()} supported only with docker ${minimumDockerVersion}+`);
            process.exit(1);
        }
    });
}
382470
def get_lock_behaviour(triggers, all_data, lock):
    """"""
    updates = {}
    lock_key = config._forward_aliases.get(Constants.VERSION_LOCK_FIELD)
    # if we are explicitly setting or locking the version, then set the lock field True anyway
    if lock:
        updates[Constants.VERSION_LOCK_FIELD] = config.VERSION_LOCK_VALUE
    elif (
        triggers
        and lock_key
        and str(all_data.get(lock_key)) == str(config.VERSION_LOCK_VALUE)
    ):
        triggers.clear()
        updates[Constants.VERSION_LOCK_FIELD] = config.VERSION_UNLOCK_VALUE
    return updates