fa6dffdaf7a65afc85577153a2e151096fbc1634,catalyst/utils/distributed.py,,is_apex_available,#,34

Before Change


    try:
        import apex  // noqa: F401
        from apex import amp  // noqa: F401
        return True
    except ImportError:
        return False

After Change




def is_apex_available() -> bool:
    env_apex = os.getenv("USE_APEX", "1") == "1"
    try:
        import apex  // noqa: F401
        from apex import amp  // noqa: F401
        return True and env_apex
    except ImportError:
        return False and env_apex

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: catalyst-team/catalyst
Commit Name: fa6dffdaf7a65afc85577153a2e151096fbc1634
Time: 2020-02-15
Author: scitator@gmail.com
File Name: catalyst/utils/distributed.py
Class Name:
Method Name: is_apex_available


Project Name: cesium-ml/cesium
Commit Name: 9df6c7659dc2a4c51367ffcf5dabb898ca87cd2c
Time: 2015-09-10
Author: a.crellinquick@gmail.com
File Name: mltsp/custom_feature_tools.py
Class Name:
Method Name: verify_new_script