Return the tuple (major, minor, patch) version extracted from the str.
348577
def _str_to_version(version_str, allow_wildcard=False):
  """"""
  reg = _VERSION_WILDCARD_REG if allow_wildcard else _VERSION_RESOLVED_REG
  res = reg.match(version_str)
  if not res:
    msg = "Invalid version '{}'. Format should be x.y.z".format(version_str)
    if allow_wildcard:
      msg += " with {x,y,z} being digits or wildcard."
    else:
      msg += " with {x,y,z} being digits."
    raise ValueError(msg)
  return tuple(
      v if v == "*" else int(v)
      for v in [res.group("major"), res.group("minor"), res.group("patch")])
64316
def parse_version(output):
    
    for x in output.splitlines():
        match = VERSION_PATTERN.match(x)
        if match:
            return match.group('version').strip()
    return None
279510
def get_version(self, as_tuple=False):
        
        if as_tuple:
            return uwsgi.version_info

        return decode(uwsgi.version)
1338307
def version(major, minor, patch):
        
        return lib.zsys_version(byref(c_int.from_param(major)), byref(c_int.from_param(minor)), byref(c_int.from_param(patch)))
1200153
def get_version():
        """"""
        cmd = [PostgresFinder.find_root() / 'pg_ctl', '--version']
        results = subprocess.check_output(cmd).decode('utf-8')
        match = re.search(r'(\d+\.\d+(\.\d+)?)', results)
        if match:
            ver_string = match.group(0)
            return tuple(int(x) for x in ver_string.split('.'))
397354
def get_version():
    
    major_value = ctypes.c_int(0)
    major = ctypes.pointer(major_value)
    minor_value = ctypes.c_int(0)
    minor = ctypes.pointer(minor_value)
    rev_value = ctypes.c_int(0)
    rev = ctypes.pointer(rev_value)
    _glfw.glfwGetVersion(major, minor, rev)
    return major_value.value, minor_value.value, rev_value.value
1033102
def next_version
      parse unless parsed?
      (major, minor, patch) = current_version.split(".").collect { |n| n.to_i }
      if !changes[:major].empty?
        major += 1
        patch = minor = 0
      elsif !changes[:minor].empty?
        minor += 1
        patch = 0
      else
        patch += 1
      end
      "%d.%d.%d" % [ major, minor, patch ]
    end
616629
def _get_major_minor_revision(self, version_string):
        """"""
        version = version_string.split(' ')[0].split('.')
        v_major = int(version[0])
        v_minor = int(re.match('\d+', version[1]).group())
        if len(version) >= 3:
            v_revision = int(re.match('\d+', version[2]).group())
        else:
            v_revision = 0
        return v_major, v_minor, v_revision
904140
def get_minor_version(module_ident, plpy):
    """"""
    # Make sure to always return the max minor version that is already in the
    # database, in case the given module_ident is not the latest version
    plan = plpy.prepare('''\
        WITH t AS (
            SELECT uuid, major_version
                FROM modules
                WHERE module_ident = $1
        )
        SELECT MAX(m.minor_version) AS minor_version
            FROM modules m, t
            WHERE m.uuid = t.uuid AND m.major_version = t.major_version
        ''', ('integer',))
    results = plpy.execute(plan, (module_ident,), 1)
    return results[0]['minor_version']
739859
def expand_python_version(version):
    
    if not re.match(r"^\d\.\d$", version):
        return [version]

    major, minor = version.split(".")
    patterns = [
        "{major}.{minor}",
        "cp{major}{minor}",
        "py{major}",
        "py{major}.{minor}",
        "py{major}{minor}",
        "source",
        "py2.py3",
    ]
    return set(pattern.format(major=major, minor=minor) for pattern in patterns)
490698
def get_bin_version(bin_path, version_flag='-v', kw={}):
    

    version_str = get_bin_version_str(bin_path, version_flag, kw)
    if version_str:
        return tuple(int(i) for i in version_str.split('.'))
1056623
def get_version():
    
    version = '.'.join((str(each) for each in VERSION[:3]))
    if len(VERSION) > 3:
        version += VERSION[3]
    return version
1014658
def get_version(string):
    
    flags = re.S
    pattern = r".*__version__ = '(.*?)'"
    match = re.match(pattern=pattern, string=string, flags=flags)

    if match:
        return match.group(1)

    raise RuntimeError('No version string could be matched')
652966
def version():
    '''
    
    '''
    ret = _client_wrapper('version')
    version_re = re.compile(VERSION_RE)
    if 'Version' in ret:
        match = version_re.match(six.text_type(ret['Version']))
        if match:
            ret['VersionInfo'] = tuple(
                [int(x) for x in match.group(1).split('.')]
            )
    if 'ApiVersion' in ret:
        match = version_re.match(six.text_type(ret['ApiVersion']))
        if match:
            ret['ApiVersionInfo'] = tuple(
                [int(x) for x in match.group(1).split('.')]
            )
    return ret
901150
def version_variants(version):
    """"""

    result = [version]

    # Add trailing ".0" as needed to ensure that we have at least
    # major.minor.patch
    parts = version.split(".")
    while len(parts) < 3:
        parts.append("0")
        result.append(".".join(parts))

    return result
1019741
def tokenize_version(version_string: str) -> Tuple[int, int, int]:
    
    before_dash = version_string.split('-')[0]
    major, minor, patch = before_dash.split('.')[:3]  # take only the first 3 in case there's an extension like -dev.0
    return int(major), int(minor), int(patch)
1111006
def version(self) -> str:
        ''''''
        output, _ = self._execute('version')
        return output.splitlines()[0].split()[-1]