e821d856697ca29141b94a8feaa6435cae2e02e1,tensorlayer/__init__.py,,,#,7

Before Change


installed_packages = [d for d in pkg_resources.working_set]

TF_is_installed = False
TL_is_installed = False

for package in installed_packages:
    if "tensorflow" in package.project_name:
        TF_is_installed = True
    if "tensorlayer" in package.project_name and "site-packages" in package.location:
        TL_is_installed = True

if TF_is_installed:  // The tensorlayer package is installed
    import tensorflow

    from . import activation
    from . import cost
    from . import files
    from . import iterate
    from . import layers
    from . import models
    from . import utils
    from . import visualize
    from . import prepro
    from . import nlp
    from . import rein
    from . import distributed

    // alias
    act = activation
    vis = visualize

    global_flag = {}
    global_dict = {}

elif TL_is_installed:
    install_instr = "Please make sure you install a recent enough version of TensorFlow."
    raise ImportError("__init__.py : Could not import TensorFlow. {}".format(install_instr))

// Use the following formating: (major, minor, patch, prerelease)
VERSION = (1, 8, 5, "rc2")
__shortversion__ = ".".join(map(str, VERSION[:3]))
__version__ = ".".join(map(str, VERSION[:3])) + "".join(VERSION[3:])

After Change


    import pkg_resources
    installed_packages = [d for d in pkg_resources.working_set]

    for package in installed_packages:
        if "tensorlayer" in package.project_name and "site-packages" in package.location:
            raise ImportError("__init__.py : Could not import TensorLayer.\nError: {}".format(e))

// Use the following formating: (major, minor, patch, prerelease)
VERSION = (1, 8, 5, "rc2")
__shortversion__ = ".".join(map(str, VERSION[:3]))
__version__ = ".".join(map(str, VERSION[:3])) + "".join(VERSION[3:])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: tensorlayer/tensorlayer
Commit Name: e821d856697ca29141b94a8feaa6435cae2e02e1
Time: 2018-05-06
Author: github-bot@pyup.io
File Name: tensorlayer/__init__.py
Class Name:
Method Name:


Project Name: tensorlayer/tensorlayer
Commit Name: e821d856697ca29141b94a8feaa6435cae2e02e1
Time: 2018-05-06
Author: github-bot@pyup.io
File Name: tensorlayer/__init__.py
Class Name:
Method Name:


Project Name: matthewwithanm/django-imagekit
Commit Name: a9895f335a5323b4bee7d6cbcffffbe826645c03
Time: 2011-09-08
Author: matthew@exanimo.com
File Name: imagekit/models.py
Class Name: ImageModelBase
Method Name: __init__


Project Name: nilearn/nilearn
Commit Name: 3d53143678cf70ed79772f1b6e384fa33abb55cf
Time: 2014-07-16
Author: loic.esteve@ymail.com
File Name: nilearn/__init__.py
Class Name:
Method Name: _check_dependencies