def get_revision():
    package_dir = os.path.dirname(__file__)
    checkout_dir = os.path.normpath(os.path.join(package_dir, os.pardir))
    path = os.path.join(checkout_dir, '.git')
    if os.path.exists(path):
        return _get_git_revision(path)
    return None
Like getattr(), but can go down a hierarchy like 'attr.subattr'
dataset/ETHPy150Open getsentry/freight/freight/__init__.py/get_revision--crossover with--dataset/ETHPy150Open adieu/djangotoolbox/djangotoolbox/utils.py/getattr_by_path