Set behavior if one matches name, versionLine.value.
975068
def setBehaviorFromVersionLine(self, versionLine):
        
        v = getBehavior(self.name, versionLine.value)
        if v:
            self.setBehavior(v)
585864
def version(*args, **attrs):
    """"""
    if hasattr(sys, "_getframe"):
        package = attrs.pop("package", sys._getframe(1).f_globals.get("__package__"))
        if package:
            attrs.setdefault("version", get_version(package))
    return click.version_option(*args, **attrs)
355528
public static void validateVersion(String name) throws InvalidNameException {
        if (StringUtils.isEmpty(name)) {
            throw ExceptionFactory.invalidVersionException(Messages.i18n.format("FieldValidator.EmptyVersionError")); //$NON-NLS-1$
        }
    }
935742
def match_value_by_name(expected_type, actual_value):
        
        if expected_type == None:
            return True
        if actual_value == None:
            raise Exception("Actual value cannot be null")

        return TypeMatcher.match_type_by_name(expected_type, type(actual_value))
446710
def set_version(old_version, new_version):
        
        try:
            if APISettings.DEBUG:
                Shell.debug('* ' + old_version + ' --> ' + new_version)
                return True

            for line in fileinput.input(os.path.abspath(APISettings.VERSION_FILE), inplace=True):
                print(line.replace(old_version, new_version), end='')
            Shell.success('* ' + old_version + ' --> ' + new_version)
        except FileNotFoundError:
            Shell.warn('File not found!')
289684
def _set_name(self, version=AUTO):
        """"""

        name = 'python'

        if version:
            if version is AUTO:
                version = sys.version_info[0]

                if version == 2:
                    version = ''

            name = '%s%s' % (name, version)

        self.name = name
1358888
private void gitSetConfig(final String name, String value)
            throws MojoFailureException, CommandLineException {
        if (value == null || value.isEmpty()) {
            value = "\"\"";
        }

        // ignore error exit codes
        executeGitCommandExitCode("config", name, value);
    }
1068687
def set(self, path, value, version):
        
        if self.in_transaction:
            self.client_context.set_data(path, value, version=version)
        else:
            self.client_context.set(path, value, version=version)
538836
def check_version(version: str):
    
    code_version = parse_version(__version__)
    given_version = parse_version(version)
    check_condition(code_version[0] == given_version[0],
                    "Given release version (%s) does not match release code version (%s)" % (version, __version__))
    check_condition(code_version[1] == given_version[1],
                    "Given major version (%s) does not match major code version (%s)" % (version, __version__))
1070842
def set_version(self, version='0.0.0', save=True):
        """"""
        self.set(self.DEFAULT_SECTION_NAME, 'version', version, save=save)
1011491
def check_specifier(dist, attr, value):
    """"""
    try:
        packaging.specifiers.SpecifierSet(value)
    except packaging.specifiers.InvalidSpecifier as error:
        tmpl = (
            "{attr!r} must be a string "
            "containing valid version specifiers; {error}"
        )
        raise DistutilsSetupError(tmpl.format(attr=attr, error=error))
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, )))
304752
def check_version(self, check, timeout=None, metadata=None,
                      credentials=None):
        """"""
        return self.stub.CheckVersion(check, timeout=timeout,
                                      metadata=metadata,
                                      credentials=credentials)
1071229
def registerBehavior(behavior, name=None, default=False, id=None):
    
    if not name:
        name = behavior.name.upper()
    if id is None:
        id = behavior.versionString
    if name in __behaviorRegistry:
        if default:
            __behaviorRegistry[name].insert(0, (id, behavior))
        else:
            __behaviorRegistry[name].append((id, behavior))
    else:
        __behaviorRegistry[name] = [(id, behavior)]
913408
def set(self, name, value):
        """"""
        old_val = self.values.get(name)
        if old_val != value:
            self.values[name] = value
            return True
        else:
            return False
959152
def sdk_version(self, value):
        
        if value == self._defaults['ai.internal.sdkVersion'] and 'ai.internal.sdkVersion' in self._values:
            del self._values['ai.internal.sdkVersion']
        else:
            self._values['ai.internal.sdkVersion'] = value
1093733
public void setVersion(String version)
    {
        if (_state!=__MSG_EDITABLE)
            throw new IllegalStateException("Not EDITABLE");
        if (version.equalsIgnoreCase(__HTTP_1_1))
        {
            _dotVersion=1;
            _version=__HTTP_1_1;
        }
        else if (version.equalsIgnoreCase(__HTTP_1_0))
        {
            _dotVersion=0;
            _version=__HTTP_1_0;
        }
        else if (version.equalsIgnoreCase(__HTTP_0_9))
        {
            _dotVersion=-1;
            _version=__HTTP_0_9;
        }
        else
            throw new IllegalArgumentException("Unknown version");
    }