:py:class:Returns `str` -- Returns :attr:`_version_` if set,
        otherwise falls back to module `__version__` or None
484005
def version(cls):  # noqa: N805  # pylint: disable=no-self-argument
        
        return cls._version_ or getattr(sys.modules.get(cls.__module__, None),
                                        '__version__', None)
467441
def get_version(package):
    
    init_py = readfile(os.path.join(package, '__init__.py'))
    return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
641369
def get_version(self):
        # type: () -> str
        
        # Get the version value
        version = getattr(self.__module, "__version__", None)
        if version:
            return version

        # Convert the __version_info__ entry
        info = getattr(self.__module, "__version_info__", None)
        if info:
            return ".".join(str(part) for part in __version_info__)

        # No version
        return "0.0.0"
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)
189340
def get_version(i):
    

    import copy

    s=''

    x=copy.deepcopy(cfg['version'])

    for q in x:
        if s!='': s+='.'
        s+=str(q)

    return {'return':0, 'version':x, 'version_str':s}
1187700
def version(i):
    

    o=i.get('out','')

    r=get_version({})
    if r['return']>0: return r
    version_str=r['version_str']

    if o=='con':
       out('V'+version_str)

    return r
246922
def get_library_version(module_name):
    
    try:
        module = importlib.import_module('luma.' + module_name)
        if hasattr(module, '__version__'):
            return module.__version__
        else:
            return None
    except ImportError:
        return None
582354
def version(self):
		
		lines = iter(self._invoke('version').splitlines())
		version = next(lines).strip()
		return self._parse_version(version)
678888
def get_version_from_module(module):
    """"""
    if module is not None:
        # Setup.py will not pass in a module, but creating __version__ from
        # __init__ will.
        module = str(module).split('.', 1)[0]
        try:
            package = pkg_resources.get_distribution(module)
            return package.version
        except pkg_resources.DistributionNotFound:
            # So there you have it the module is not installed.
            pass
402860
def version_tuple(self):
    """"""
    try:
      return tuple([int(digit, 10) for digit in self.version.split('.')])
    except (AttributeError, TypeError, ValueError):
      return None
285633
def determine_version(self, request, *args, **kwargs):
        
        if self.versioning_class is None:
            return (None, None)
        scheme = self.versioning_class()
        return (scheme.determine_version(request, *args, **kwargs), scheme)
972543
def version(self):
        
        git_rev = len(os.popen('git rev-list HEAD').readlines())
        if git_rev != 0:
            self.version_list[-1] = '%d' % git_rev
        version = '.'.join(self.version_list)
        return version
548584
def get_info(cls):
        
        mod = try_import(cls.mod_name)
        if not mod:
            return None
        version = getattr(mod, '__version__', None) or getattr(mod, 'version',
                                                               None)
        return BackendInfo(version or 'deprecated', '')
483862
def get_package_version(module_obj, value):
    
    for key in ['version', '__version__']:
        if hasattr(module_obj, key):
            return getattr(module_obj, key)
    parts = value.split('.')
    for index, part in enumerate(parts):
        try:
            return pkg_resources.get_distribution(
                '.'.join(parts[0:index + 1])).version
        except (pkg_resources.DistributionNotFound,
                pkg_resources.RequirementParseError):
            continue
923947
def python_version(i):
    

    import sys

    o=i.get('out','')

    v1=sys.version
    v2=sys.version_info

    if o=='con':
       out(v1)

    return {'return':0, 'version':v1, 'version_info':v2}
522484
def _get_version():
    
    with open('Lib/fontParts/__init__.py', 'r', encoding='utf-8') as f:
        for line in f:
            if line.startswith(u'__version__'):
                return ast.parse(line).body[0].value.s
        raise RuntimeError("No __version__ string found!")
1056623
def get_version():
    
    version = '.'.join((str(each) for each in VERSION[:3]))
    if len(VERSION) > 3:
        version += VERSION[3]
    return version