def _assert_has_write_permissions(path: Path) -> None:
    'Fails if the user does not have write access to the given path.'
    if os.access(path, os.W_OK):
        return
    error_message = i18n.t('general.file-bad-write-permissions', path=path)
    error_message += '\n'
    if (path.stat().st_gid == os_utils.BRAINFRAME_GROUP_ID):
        error_message += (' ' + _group_recommendation_message('brainframe'))
    else:
        error_message += (' ' + i18n.t('general.unexpected-group-for-file', path=path, group='brainframe'))
    print_utils.fail(error_message)
Fails if the user does not have write access to the given path.
def _assert_has_write_permissions(path: Path) -> None:
    
    if os.access(path, os.W_OK):
        return
    error_message = i18n.t('general.file-bad-write-permissions', path=path)
    error_message += '\n'
    if (path.stat().st_gid == os_utils.BRAINFRAME_GROUP_ID):
        error_message += (' ' + _group_recommendation_message('brainframe'))
    else:
        error_message += (' ' + i18n.t('general.unexpected-group-for-file', path=path, group='brainframe'))
    print_utils.fail(error_message)