code: def test_download_code_writes_output_to_file(
      mock_bindings: mock.MagicMock,
      make_expref: Callable[[int], experiment.Experiment],
      tmp_path: os.PathLike,
  ) -> None:
      expref = make_expref(1)
      # Encode sample response to base64, decode bytes to string.
      sample_tgz_content = base64.b64encode(b"b64TgzResponse").decode()
      mock_bindings.return_value = bindings.v1GetModelDefResponse(
          b64Tgz=sample_tgz_content
      )
  
      output_file = expref.download_code(output_dir=str(tmp_path))
  
      with open(output_file, "rb") as f:
          file_content = f.read()
          assert file_content == b"b64TgzResponse"
  
imports: import base64
  import math
  import os
  from typing import Callable
  from unittest import mock
  import pytest
  import requests
  import responses
  from determined.common import api
  from determined.common.api import bindings
  from determined.common.experimental import checkpoint, determined, experiment
  from tests.fixtures import api_responses
label_desc: Use image node_id 14 for calling a global function with example usage: test_download_code_writes_output_to_file(mock_bindings, make_expref, tmp_path) without return types