895187880fb16d41133942aae7a935698c6f0a8c,niftynet/utilities/get_niftynet_version.py,,get_niftynet_version,#,2

Before Change


    try:
        from subprocess import check_output, CalledProcessError
        // Describe the version relative to last tag
        command_git = ["git", "describe", "--match", "v[0-9]*"]
        version_string = check_output(command_git).decode().rstrip()

        // Exclude the "v" for PEP440 conformity, see
        // https://www.python.org/dev/peps/pep-0440///public-version-identifiers

After Change


        version_string = None

    // If we cannot get a git version, attempt to get a package version
    if not version_string:
        try:
            import pkg_resources
            version_string = pkg_resources.get_distribution("niftynet").version
        except:
            version_string = None

    if not version_string:
        version_string = "unknown"

    return "NiftyNet version " + version_string
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: NifTK/NiftyNet
Commit Name: 895187880fb16d41133942aae7a935698c6f0a8c
Time: 2017-08-18
Author: t.doel@ucl.ac.uk
File Name: niftynet/utilities/get_niftynet_version.py
Class Name:
Method Name: get_niftynet_version


Project Name: ray-project/ray
Commit Name: 82f9c7014e2d0acd3e3869066f5dc3142ec9e7a7
Time: 2020-12-17
Author: 62982571+Gekho457@users.noreply.github.com
File Name: python/ray/autoscaler/_private/command_runner.py
Class Name: KubernetesCommandRunner
Method Name: _home


Project Name: OpenNMT/OpenNMT-py
Commit Name: d7d1272229c35ccc0a799901fb1483207b01afbd
Time: 2017-10-12
Author: nasa4836@gmail.com
File Name: onmt/modules/SRU.py
Class Name:
Method Name: check_sru_requirement