2a56674d4419b8b334b938bdc5fd6649a1165c76,pytext/utils/path.py,,get_absolute_path,#Any#,28

Before Change




def get_absolute_path(file_path):
    return (
        file_path
        if os.path.isabs(file_path)
        else os.path.realpath(os.path.join(PYTEXT_HOME, file_path))
    )

After Change


def get_absolute_path(file_path: str) -> str:
    if os.path.isabs(file_path):
        return file_path
    absolute_path = os.path.realpath(os.path.join(PYTEXT_HOME, file_path))
    if os.path.exists(absolute_path):
        return absolute_path
    return file_path
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: facebookresearch/pytext
Commit Name: 2a56674d4419b8b334b938bdc5fd6649a1165c76
Time: 2019-11-21
Author: stevenliu@fb.com
File Name: pytext/utils/path.py
Class Name:
Method Name: get_absolute_path


Project Name: pantsbuild/pants
Commit Name: 8a8673e91e2d04d2beedf5067eeff23a499603f4
Time: 2014-01-22
Author: benjy@foursquare.com
File Name: src/python/twitter/pants/goal/context.py
Class Name: Context
Method Name: java_home


Project Name: pantsbuild/pants
Commit Name: a80ff56349e39e0503f2cb71d5bece0ae9adb8c9
Time: 2014-01-21
Author: benjy@foursquare.com
File Name: src/python/twitter/pants/goal/context.py
Class Name: Context
Method Name: java_home