code: def test_add_metadata_doesnt_update_local_on_rest_failure(
      sample_model: model.Model,
  ) -> None:
      sample_model.metadata = {}
  
      responses.patch(
          re.compile(f"{_MASTER}/api/v1/models/{sample_model.name}.*"),
          status=400,
      )
  
      try:
          sample_model.add_metadata({"test": "test"})
          raise AssertionError("Server's 400 should raise an exception")
      except api.errors.APIException:
          assert "test" not in sample_model.metadata
  
file_path: determined/harness/tests/determined/common/experimental/test_model.py
imports: import re
  import pytest
  import responses
  from determined.common import api
  from determined.common.experimental import model
  from tests.fixtures import api_responses
label_desc: Use image node_id 7 for calling a global function with example usage: test_add_metadata_doesnt_update_local_on_rest_failure(sample_model) without return types