

def get_root():
    root = os.path.realpath(os.path.abspath(os.getcwd()))
    setup_py = os.path.join(root, 'setup.py')
    versioneer_py = os.path.join(root, 'versioneer.py')
    if (not (os.path.exists(setup_py) or os.path.exists(versioneer_py))):
        root = os.path.dirname(os.path.realpath(os.path.abspath(sys.argv[0])))
        setup_py = os.path.join(root, 'setup.py')
        versioneer_py = os.path.join(root, 'versioneer.py')
    if (not (os.path.exists(setup_py) or os.path.exists(versioneer_py))):
        err = "Versioneer was unable to run the project root directory. Versioneer requires setup.py to be executed from its immediate directory (like 'python setup.py COMMAND'), or in a way that lets it use sys.argv[0] to find the root (like 'python path/to/setup.py COMMAND')."
        raise VersioneerBadRootError(err)
    try:
        me = os.path.realpath(os.path.abspath(__file__))
        if (os.path.splitext(me)[0] != os.path.splitext(versioneer_py)[0]):
            print(('Warning: build in %s is using versioneer.py from %s' % (os.path.dirname(me), err)))
    except NameError:
        pass
    return root

dataset/ETHPy150Open Anaconda-Platform/chalmers/versioneer.py get_root/VarMisuse@243/429 `versioneer_py`->`err`