This allows to easily display a version snippet in Jupyter.
186981
def _repr_html_():
    """"""
    from bonobo.commands.version import get_versions

    return (
        '<div style="padding: 8px;">'
        '  <div style="float: left; width: 20px; height: 20px;">{}</div>'
        '  <pre style="white-space: nowrap; padding-left: 8px">{}</pre>'
        "</div>"
    ).format(__logo__, "<br/>".join(get_versions(all=True)))
1252199
def pyVersionStr(self):
        
        from sys import version_info

        return "Python Interpreter Version: {}.{}.{}".format(version_info.major,
                                                             version_info.minor,
                                                             version_info.micro)
990566
def prt_ver(self, prt):
        """"""
        if self.ver_list is not None:
            prt.write("# Versions:\n#    {VER}\n\n".format(VER="\n#    ".join(self.ver_list)))
250307
def _process_version_lines(self):
        """"""
        if len(self._lines_seen["version"]) > 1:
            self._add_error(_("Multiple version lines appeared."))
        elif self._lines_seen["version"][0] != 1:
            self._add_error(_("The version must be on the first line."))
44668
def _parse_version(version):
        
        parsed_version = parse_version(version)
        return tuple(
            int(dot_version)
            for dot_version in parsed_version.base_version.split('.')
        ) + (parsed_version.is_prerelease,)
1373935
def version(self, calver: bool = False, pre_release: bool = False) -> str:
        
        # TODO: Optimize
        version = '{}.{}.{}'
        major, minor, patch = self.random.randints(3, 0, 10)

        if calver:
            if minor == 0:
                minor += 1

            if patch == 0:
                patch += 1
            major = self.random.randint(2016, 2018)
            return version.format(major, minor, patch)

        version = '{}.{}.{}'.format(major, minor, patch)

        if pre_release:
            suffixes = ('alpha', 'beta', 'rc')
            suffix = self.random.choice(suffixes)
            number = self.random.randint(1, 11)
            return '{}-{}.{}'.format(version, suffix, number)

        return version
598001
def print_version(self):
        

        if not self._version:
            return self

        if not self._title:
            print('  %s %s' % (self._name, self._version))
            return self

        print('  %s (%s %s)' % (self._title, self._name, self._version))
        return self
61109
def version(verbose):
    """"""
    print(Fore.BLUE + '-=' * 15)
    print(Fore.YELLOW + 'Superset ' + Fore.CYAN + '{version}'.format(
        version=config.get('VERSION_STRING')))
    print(Fore.BLUE + '-=' * 15)
    if verbose:
        print('[DB] : ' + '{}'.format(db.engine))
    print(Style.RESET_ALL)
1111006
def version(self) -> str:
        ''''''
        output, _ = self._execute('version')
        return output.splitlines()[0].split()[-1]
1372623
def _version_view(self):
        
        version_json = self._version_callback(self.version_path)
        if version_json is None:
            return 'version.json not found', 404
        else:
            return jsonify(version_json)
936589
def node_version():
    """"""
    version = check_output(('node', '--version'))
    return tuple(int(x) for x in version.strip()[1:].split(b'.'))
1252562
def get_version():
    
    with open('sj.py') as source:
        for node in ast.walk(ast.parse(source.read(), 'sj.py')):
            if node.__class__.__name__ == 'Assign' and \
               node.targets[0].__class__.__name__ == 'Name' and \
               node.targets[0].id == '__version__':
                return node.value.s
1185253
function() {
        if (!version) return;
        if (note) version.notes.push(note);

        version.rawNote = normText(
            _.chain(version.notes)
            .map(function(note) {
                return '* '+note.trim();
            })
            .value()
            .join('\n')
        );
        version.notes = _.map(version.notes, normText);
        changelog.versions.push(version);

        note = "";
        version = null;
    }
482330
def read_version():
    ""
    version_file = local_file('source', 'added_value', 'version.py')
    local_vars = {}
    with open(version_file) as handle:
        exec(handle.read(), {}, local_vars)  # pylint: disable=exec-used
    return local_vars['__version__']
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
1257303
def bump_minor_version():
    """"""
    version = load_version_as_list()
    print('current version: {}'.format(format_version_string(version)))
    version[-1] += 1
    print('new version: {}'.format(format_version_string(version)))

    contents = "__version__ = '{}'\n".format(format_version_string(version))

    with open(VERSION_PATH, 'w') as wfile:
        wfile.write(contents)
534686
def versioned_url(self):
        ''''''
        if self.url is None:
            return None
        return self.url.format(version=self.version)