Return the scenario's version.

        If this is not present, we default to version 1.

        :raises InvalidScenarioVersion:
            if the supplied version is not present in :var:`SUPPORTED_SCENARIO_VERSIONS`.
557660
def version(self) -> int:
        
        version = self._config.get('version', 1)

        if version not in SUPPORTED_SCENARIO_VERSIONS:
            raise InvalidScenarioVersion(f'Unexpected scenario version {version}')
        return version
724199
def get_lipd_version(L):
    
    version = 1.0
    _keys = ["LipdVersion", "LiPDVersion", "lipdVersion", "liPDVersion"]
    for _key in _keys:
        if _key in L:
            version = L[_key]
            # Cast the version number to a float
            try:
                version = float(version)
            except AttributeError:
                # If the casting failed, then something is wrong with the key so assume version is 1.0
                version = 1.0
            L.pop(_key)
    return L, version
477211
def within(self, version):
        
        if not isinstance(version, Version):
            version = type(self._min_ver)(self._req, version)
        return version >= self
1343776
def determine_version(self, request, api_version=None):
        """"""
        if api_version is False:
            api_version = None
            for version in self.versions:
                if version and "v{0}".format(version) in request.path:
                    api_version = version
                    break

        request_version = set()
        if api_version is not None:
            request_version.add(api_version)

        version_header = request.get_header("X-API-VERSION")
        if version_header:
            request_version.add(version_header)

        version_param = request.get_param('api_version')
        if version_param is not None:
            request_version.add(version_param)

        if len(request_version) > 1:
            raise ValueError('You are requesting conflicting versions')

        return next(iter(request_version or (None, )))
1111006
def version(self) -> str:
        ''''''
        output, _ = self._execute('version')
        return output.splitlines()[0].split()[-1]
1041124
def get_pypi_version():
    
    try:
        response = requests.get(PYPI_URL, timeout=HALF_SECOND_TIMEOUT)
        response.raise_for_status()
        data = response.json()
        version_str = data["info"]["version"]
        return _parse_version_str(version_str)
    except requests.exceptions.ConnectionError:
        raise VersionException(UNABLE_TO_ACCESS_PYPI + " Failed to connect.")
    except requests.exceptions.Timeout:
        raise VersionException(UNABLE_TO_ACCESS_PYPI + " Timeout")
948217
def get_version():
    
    contents = read(os.path.join(PATH_BASE, 'srptools', '__init__.py'))
    version = re.search('VERSION = \(([^)]+)\)', contents)
    version = version.group(1).replace(', ', '.').strip()
    return version
337673
def check_version(version):
    

    if isinstance(version, string_types):
        version = tuple(map(int, version.split(".")))

    if version > version_info:
        str_version = ".".join(map(str, version))
        raise ValueError("pgi version '%s' requested, '%s' available" %
                         (str_version, __version__))
142689
def parse_version(version: str) -> tuple:
    
    if not version:
        return None
    parts = version.split('.')
    missing = 3 - len(parts)
    return tuple(int(i) for i in parts + ([0] * missing))
522524
def get_version(version=None):
    
    if version is None:
        from modeltranslation import VERSION as version
    else:
        assert len(version) == 5
        assert version[3] in ('alpha', 'beta', 'rc', 'final')

    # Now build the two parts of the version number:
    # main = X.Y[.Z]
    # sub = .devN - for pre-alpha releases
    #     | {a|b|c}N - for alpha, beta and rc releases

    parts = 2 if version[2] == 0 else 3
    main = '.'.join(str(x) for x in version[:parts])

    sub = ''
    if version[3] == 'alpha' and version[4] == 0:
        git_changeset = get_git_changeset()
        if git_changeset:
            sub = '.dev%s' % git_changeset

    elif version[3] != 'final':
        mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'rc'}
        sub = mapping[version[3]] + str(version[4])

    return str(main + sub)
753989
def versions_available(self):
        

        if self.version:
            spec = "%s==%s" % (self.project_name, self.version)
        else:
            spec = self.project_name

        if self.all_versions and self.version in self.all_versions:
            print_pkg_versions(self.project_name, [self.version])
        elif not self.version and self.all_versions:
            print_pkg_versions(self.project_name, self.all_versions)
        else:
            if self.version:
                self.logger.error("No pacakge found for version %s" \
                        % self.version)
            else:
                self.logger.error("No pacakge found for %s" % self.project_name)
            return 1
        return 0
645294
def splunk_version(self):
        
        if self._splunk_version is None:
            self._splunk_version = tuple([int(p) for p in self.info['version'].split('.')])
        return self._splunk_version
453260
def check_version(expected_version):
    

    with open(os.path.join(root_folder, 'VERSION'), 'r') as version_file:
        version = version_file.read().strip()

    if version != expected_version:
        raise EnvironmentError("Version mismatch during release, expected={}, found={}"
                               .format(expected_version, version))
998921
public org.tensorflow.framework.VersionDef getVersion() {
    return version_ == null ? org.tensorflow.framework.VersionDef.getDefaultInstance() : version_;
  }
911226
def version
      SelectVersionsQuery.new.fetch_first || Version.new('0')
    rescue Cassandra::Errors::InvalidError
      raise uninitialized_error
    end
1251981
def get_version(self, state=None, date=None):
        

        version_model = self._meta._version_model
        q = version_model.objects.filter(object_id=self.pk)
        if state:
            q = version_model.normal.filter(object_id=self.pk, state=state)

        if date:
            q = q.filter(date_published__lte=date)

        q = q.order_by('-date_published')

        results = q[:1]
        if results:
            return results[0]
        return None
1320091
def get_version(self):
        
        if not self.node.version:
            return None
        try:
            version = smart_str('%s' % self.node.version.resolve(self.context))
        except template.VariableDoesNotExist:
            raise template.TemplateSyntaxError('"%s" tag got an unknown variable: %r' %
                                               (self.node.nodename, self.node.version.var))

        return '%s' % version