code: def test_open_rev_raises_error_on_wrong_mode(tmp_dir, dvc):
      tmp_dir.dvc_gen("foo", "foo-text")
  
      with pytest.raises(
          ValueError, match="Only reading `mode` is supported."
      ):
          with api.open("foo", mode="w"):
              pass
  
label_desc: Use image node_id 2 for calling a global function with example usage: test_open_rev_raises_error_on_wrong_mode(tmp_dir, dvc) without return types