

def GetApplicationPath(file=None):
    import re, os, platform
    if (not hasattr(GetApplicationPath, 'dir')):
        if hasattr(sys, 'frozen'):
            dir = os.path.dirname(sys.executable)
        elif ('__file__' in globals()):
            dir = os.path.dirname(os.path.realpath(__file__))
        else:
            dir = os.getcwd()
        GetApplicationPath.dir = dir
    if (file is None):
        file = ''
    if ((not file.startswith('/')) and (not file.startswith('\\')) and (not re.search('^[\\w-]+:', file))):
        path = ((GetApplicationPath.dir + os.sep) + file)
        if (platform.system() == 'Windows'):
            path = re.sub('[/\\\\]+', re.escape(os.sep), path)
        path = re.sub('[/\\\\]+$', '', path)
        return path
    return str(file)

dataset/ETHPy150Open cztomczak/cefpython/cefpython/cef3/linux/binaries_32bit/pyqt.py GetApplicationPath/original