def METHOD_NAME(skip_os=True, ls=False):
    cwd = os.getcwd()
    d = os.path.dirname(__file__)
    d = d if d else '.'
    os.chdir(d)
    try:
        # take version from git
        try:
            desc = run('git describe --long --tags --always --dirty', stderr=STDOUT, shell=True).decode("utf-8")
            info = {
                'message': run('git show -s --format=%s', stderr=STDOUT, shell=True).strip().decode('utf8'),
                'commit': run('git show -s --format=%H', stderr=STDOUT, shell=True).strip().decode('utf8'),
                'date': run('git log -1 --format="%cd" --date="format:%Y/%m/%d %H:%M:%S"', stderr=STDOUT, shell=True).strip().decode('utf8'),
                'branch': BRANCH_OVERRIDE if BRANCH_OVERRIDE else run("git branch --sort=committerdate -r --contains | grep -m 1 -v HEAD | cut -d'/' -f2-", stderr=STDOUT, shell=True).strip().decode('utf8')
            }
        except CalledProcessError:
            os.chdir(cwd)
            return _read_py(ls=True)
        # create package version
        version = desc.lstrip('v').rstrip().replace('-', '+', 1).replace('-', '.')
        # take OS name
        if not skip_os:
            keys = ('ID=', 'VERSION_ID=', 'RELEASE=')
            with open('/etc/os-release') as f:
                os_version = ''.join(str(s).split("=", 1)[1].rstrip().strip('"').replace('.', '')
                                     for s in f if str(s).startswith(keys))
                version += '.' + os_version
        info['version'] = VERSION_OVERRIDE if VERSION_OVERRIDE else version
        _write_py(info)
        return info
    except Exception as e:
        raise e
    finally:
        os.chdir(cwd)  # back current dir