Verify we have at least one template that matches maj.minor version.
428591
def CheckTemplates(self, base_dir, version):
    """"""
    major_minor = ".".join(version.split(".")[0:2])
    templates = glob.glob(
        os.path.join(base_dir, "templates/*%s*.zip" % major_minor))
    required_templates = set(
        [x.replace("maj.minor", major_minor) for x in self.REQUIRED_TEMPLATES])

    # Client templates have an extra version digit, e.g. 3.1.0.0
    templates_present = set([
        re.sub(r"_%s[^_]+_" % major_minor, "_%s_" % major_minor,
               os.path.basename(x)) for x in templates
    ])

    difference = required_templates - templates_present
    if difference:
      raise RuntimeError("Missing templates %s" % difference)
820831
def _fulfills_version_spec(version, version_spec):
    '''
    
    '''
    for oper, spec in version_spec:
        if oper is None:
            continue
        if not salt.utils.versions.compare(ver1=version, oper=oper, ver2=spec, cmp_func=_pep440_version_cmp):
            return False
    return True
1199691
function validateMeteor(architecture) {
  var release;
  var packages; // Ensure Meteor CLI is installed

  _winston.default.debug('check Meteor is installed');

  if (_commandExists.default.sync('meteor') === false) {
    throw new Error('Meteor is not installed');
  } // Determine current release/packages from '.meteor' directory


  try {
    release = _fs.default.readFileSync('.meteor/release', 'utf8');
    packages = _fs.default.readFileSync('.meteor/packages', 'utf8');
  } catch (error) {
    /* Abort the program if files are not found, this is a strong
       indication we may not be in the root project directory */
    throw new Error('You must be in a Meteor project directory');
  } // Determine major/minor version numbers by stripping non-numeric characters from release


  var versionNumbers = release.replace(/[^0-9]/g, '');
  var majorVersion = Number.parseInt(versionNumbers.charAt(0), 10);
  var minorVersion = Number.parseInt(versionNumbers.charAt(1), 10); // Ensure project does not use 'force-ssl' package

  _winston.default.debug('check for incompatible \'force-ssl\' package');

  if (packages.includes('force-ssl')) {
    throw new Error('The "force-ssl" package is not supported. Please read the docs to configure an HTTPS redirect in your web config.');
  } // Ensure current Meteor release is >= 1.4


  _winston.default.debug('check current Meteor release >= 1.4');

  if (majorVersion < 1 || minorVersion < 4) {
    throw new Error('Meteor version must be >= 1.4');
  } // Ensure current Meteor release >= 1.6 for 64-bit architecture


  if (architecture === '64') {
    _winston.default.debug('check current Meteor release >= 1.6 for 64-bit Node');

    if (majorVersion < 1 || minorVersion < 6) {
      throw new Error('Meteor version must be >= 1.6 for 64-bit Node');
    }
  }
}
567915
def template_exists(form, field):
    """"""
    try:
        current_app.jinja_env.get_template(field.data)
    except TemplateNotFound:
        raise ValidationError(_("Template selected does not exist"))
67760
def match(self, projectpath, parameters):
        """"""
        parameters = sanitizeparameters(parameters)

        mandatory_absent = [] #list of input templates that are missing but mandatory
        optional_absent = [] #list of absent but optional input templates

        #check if profile matches inputdata (if there are no inputtemplate, this always matches intentionally!)
        for inputtemplate in self.input:
            if not inputtemplate.matchingfiles(projectpath):
                if inputtemplate.optional:
                    optional_absent.append(inputtemplate)
                else:
                    mandatory_absent.append(inputtemplate)

        if mandatory_absent:
            return False, mandatory_absent

        #check if output is produced
        if not self.output: return False, mandatory_absent
        for outputtemplate in self.output:
            if isinstance(outputtemplate, ParameterCondition):
                outputtemplate = outputtemplate.evaluate(parameters)
            if not outputtemplate:
                continue
            assert isinstance(outputtemplate, OutputTemplate)
            if outputtemplate.parent:
                if outputtemplate.getparent(self) not in optional_absent: #pylint: disable=protected-access
                    return True, optional_absent
            else:
                return True, optional_absent

        return False, optional_absent
751601
function validVersion(version, spec) {
  // Normalize route versions
  var test = spec.versions || [spec.version]

  // Check for direct version match
  if (~test.indexOf(version)) {
    return true
  }

  // Use semver and attempt to match on supplied version
  return !!test.filter(function(v) {
    return semver.satisfies(v, version)
  }).length
}
94921
def is_registered(ext):
    '''  '''
    return Lean.template_mappings.has_key(ext.lower()) and len(Lean.template_mappings[ext])
1148924
function checkDefaultTemplate () {
        const pkg = requireFresh(path.join(project, 'package.json'));
        expect(pkg.author).toEqual('Apache Cordova Team');

        const configXml = new ConfigParser(path.join(project, 'config.xml'));
        expect(configXml.author()).toEqual('Apache Cordova Team');
    }
388677
def check_arguments(cls, passed):
        """"""
        defaults = list(cls.default_arguments().keys())
        template = ("Pass arg {argument:!r} in {cname:!r}, can be a typo? "
                    "Supported key arguments: {defaults}")
        fails = []
        for arg in passed:
            if arg not in defaults:
                warn(template.format(argument=arg,
                                     cname=cls.__name__,
                                     defaults=defaults))
                fails.append(arg)

        return any(fails)
243385
def _check_node_list(path, sample, template, start_enumerate=0):
    """"""
    if len(sample) != len(template):
        raise ASTNodeListMismatch(path, sample, template)

    for i, (sample_node, template_node) in enumerate(zip(sample, template), start=start_enumerate):
        if callable(template_node):
            # Checker function inside a list
            template_node(sample_node, path+[i])
        else:
            assert_ast_like(sample_node, template_node, path+[i])
1137978
def validate_version(self):
        """"""
        installed = get_installed_version()
        if not versions_compatible(*self.dbt_version):
            msg = IMPOSSIBLE_VERSION_ERROR.format(
                package=self.project_name,
                version_spec=[
                    x.to_version_string() for x in self.dbt_version
                ]
            )
            raise DbtProjectError(msg)

        if not versions_compatible(installed, *self.dbt_version):
            msg = INVALID_VERSION_ERROR.format(
                package=self.project_name,
                installed=installed.to_version_string(),
                version_spec=[
                    x.to_version_string() for x in self.dbt_version
                ]
            )
            raise DbtProjectError(msg)
485084
def exact_or_minor_exe_version_match(executable_name,
                                     exe_version_tuples,
                                     version):
    
    exe = exact_exe_version_match(executable_name,
                                  exe_version_tuples,
                                  version)

    if not exe:
        exe = minor_exe_version_match(executable_name,
                                      exe_version_tuples,
                                      version)
    return exe
329053
def is_template(self, filename):
        
        if self.is_partial(filename):
            return False

        if self.is_ignored(filename):
            return False

        if self.is_static(filename):
            return False

        return True
427578
def template_exists(template_name):
    '''
    
    '''
    try:
        template.loader.get_template(template_name)
        return True
    except template.TemplateDoesNotExist:
        return False
1134216
function checkOlderIE() {
  const ua = navigator.userAgent;
  const isIE = ua.indexOf('MSIE') !== -1 || ua.indexOf('Trident') !== -1;
  if (!isIE) {
    return false;
  }
  const version = ua.match(/(MSIE\s|Trident.*rv:)([\w.]+)/)[2];
  const versionNumber = parseFloat(version);
  if (versionNumber < 10) {
    return true;
  }
  return false;
}
1003199
function quickTemplate (pTemplate, pValues)
		{
			return pTemplate.replace(templateRegex, function(i, pMatch) {
				return pValues[pMatch];
			});
		}
1340990
def EnsurePythonVersion(self, major, minor):
        """"""
        if sys.version_info < (major, minor):
            v = sys.version.split()[0]
            print("Python %d.%d or greater required, but you have Python %s" %(major,minor,v))
            sys.exit(2)