def download(target: Path, version: str='latest') -> None:
    _assert_has_write_permissions(target.parent)
    if (version == 'latest'):
        version = get_latest_version()
    credentials = config.staging_credentials()
    url = BRAINFRAME_DOCKER_COMPOSE_URL.format(subdomain=('staging.' if config.is_staging.value else ''), version=version)
    response = requests.get(url, auth=credentials, stream=True)
    if (not response.ok):
        print_utils.fail_translate('general.error-downloading-docker-compose', status_code=response.status_code, error_message=response.text)
    target.write_text(response.text)
    if os_utils.is_root():
        os_utils.give_brainframe_group_rw_access([target])
def download(target: Path, version: str='latest') -> None:
    _assert_has_write_permissions(target.parent)
    if (version == 'latest'):
        version = get_latest_version()
    credentials = config.staging_credentials()
    url = BRAINFRAME_DOCKER_COMPOSE_URL.format(subdomain=('staging.' if config.is_staging.value else ), version=version)
    response = requests.get(url, auth=credentials, stream=True)
    if (not response.ok):
        print_utils.fail_translate('general.error-downloading-docker-compose', status_code=response.status_code, error_message=response.text)
    target.write_text(response.text)
    if os_utils.is_root():
        os_utils.give_brainframe_group_rw_access([target])