Check if `version` fits into our dependency specification.

        :param version: str
        :return: bool
179229
def check(self, version):  # Ignore PyDocStyleBear
        

        def _compare_spec(spec):
            if len(spec) == 1:
                spec = ("=", spec[0])

            token = Tokens.operators.index(spec[0])
            comparison = compare_version(version, spec[1])
            if token in [Tokens.EQ1, Tokens.EQ2]:
                return comparison == 0
            elif token == Tokens.GT:
                return comparison == 1
            elif token == Tokens.LT:
                return comparison == -1
            elif token == Tokens.GTE:
                return comparison >= 0
            elif token == Tokens.LTE:
                return comparison <= 0
            elif token == Tokens.NEQ:
                return comparison != 0
            else:
                raise ValueError("Invalid comparison token")

        results, intermediaries = False, False
        for spec in self.spec:
            if isinstance(spec, list):
                intermediary = True
                for sub in spec:
                    intermediary &= _compare_spec(sub)
                intermediaries |= intermediary
            elif isinstance(spec, tuple):
                results |= _compare_spec(spec)

        return results or intermediaries
1216750
def all_versions_equal(self, versions):  # type: (Dict[str,str]) -> bool
        
        if len(versions) <= 1:
            return True

        semver = None
        for key, version in versions.items():
            if semver is None:
                try:
                    semver, _, __ = version_object_and_next(version)
                except ValueError:
                    logger.error("Invalid version at:" + unicode((key, version)))
                    return False
                continue
            try:
                version_as_version, _, __ = version_object_and_next(version)
            except:
                return False
            if version_as_version != semver:
                return False
        return True
484005
def version(cls):  # noqa: N805  # pylint: disable=no-self-argument
        
        return cls._version_ or getattr(sys.modules.get(cls.__module__, None),
                                        '__version__', None)
477211
def within(self, version):
        
        if not isinstance(version, Version):
            version = type(self._min_ver)(self._req, version)
        return version >= self
929947
def is_compatible(self, model, version):
        
        if not model in self.models:
            return False
        if self.max_ykver:
            return (version >= self.min_ykver and
                    version <= self.max_ykver)
        else:
            return version >= self.min_ykver
85025
def _check_version(version):
    """"""
    if version != pyphi.__version__:
        raise pyphi.exceptions.JSONVersionError(
            'Cannot load JSON from a different version of PyPhi. '
            'JSON version = {0}, current version = {1}.'.format(
                version, pyphi.__version__))
225276
public boolean isModifiedOnVersion(String version) {
		if( this.modificationHistory.isModifiedOnVersion(version)
				|| this.outParameter.isModifiedOnVersion(version) ) {
			return true;
		}
		for(APIParameter inParameter : inParameters) {
			if(inParameter.isModifiedOnVersion(version)) {
				return true;
			}
		}
		return false;
	}
199128
def dependencies_are_newer(self, files, dependencies):
        
        dependency_mtimes = [
            os.path.getmtime(filename) for filename in dependencies]
        file_mtimes = [os.path.getmtime(filename) for filename in files]
        result = False
        for file_mtime in file_mtimes:
            for dependency_mtime in dependency_mtimes:
                if dependency_mtime > file_mtime:
                    result = True
        return result
669402
def is_version(value):
    """"""
    try:
        value = str(value)
        if not parse_ver('1.4') <= parse_ver(value):
            raise ValueError()
        return value
    except (AttributeError, TypeError, ValueError):
        raise vol.Invalid(
            '{} is not a valid version specifier'.format(value))
615575
def validate_current_versions(self):  # type: () -> bool
        
        versions = self.all_current_versions()
        for _, version in versions.items():
            if "Invalid Semantic Version" in version:
                logger.error(
                    "Invalid versions, can't compare them, can't determine if in sync"
                )
                return False

        if not versions:
            logger.warning("Found no versions, will use default 0.1.0")
            return True

        if not self.all_versions_equal(versions):
            if self.almost_the_same_version([x for x in versions.values()]):
                # TODO: disable with strict option
                logger.warning("Version very by a patch level, will use greater.")
                return True
            logger.error("Found various versions, how can we rationally pick?")
            logger.error(unicode(versions))
            return False

        for _ in versions:
            return True
        return False
63556
def version_str(version):
    
    if isinstance(version, str):
        return version
    elif isinstance(version, tuple):
        return '.'.join([str(int(x)) for x in version])
    else:
        raise ValueError("Invalid version: %s" % version)
327168
def version(self, v):
        
        if not isinstance(v, int) or v != 1:
            raise AttributeError
        self._version = v
1165576
def tag_exists(self, version):
        
        for tag in self.available_tags():
            if tag == version:
                return True
        return False
312142
boolean documentVersion(String version) {
    if (!lazyInitDocumentation()) {
      return true;
    }

    if (documentation.version != null) {
      return false;
    }

    documentation.version = version;
    return true;
  }
999605
def support(self, version):
        

        if not self._known_version(version):
            warn("unknown feature: %s"%version)
            return True
        else:
            if not self._get_featureset_support(version):
                warn("You are not supporting %s anymore "%str(version), UserWarning, self.level)
            if self._alone_version(version):
                warn("%s is the last supported feature of this group, you can simplifiy this logic. "%str(version), UserWarning,self.level)
                
            return self.predicates.get(version, True)




        if (not self.PY3_supported) or (not self.PY2_supported):
            warn("You are only supporting 1 version of Python", UserWarning, self.level)

        if version == PY3:
            return sys.version_info.major == 3
        elif version == PY2:
            return sys.version_info.major == 2
1226922
def _require_min_api_version(self, version):
    
    actual_version = self._get_resource_root().version
    version = max(version, self._api_version())
    if actual_version < version:
      raise Exception("API version %s is required but %s is in use."
          % (version, actual_version))
761752
def show_version_info(self, version):
        

        if version in self.versions:
            stdout = self.repo.show(version, '--summary').stdout
            logger.info(stdout)
        else:
            logger.info('Version {0} not found'.format(version))