code: def test_jsonsetexistentialmodifiersshouldsucceed(client):
      obj = {"foo": "bar"}
      assert client.json().set("obj", Path.root_path(), obj)
  
      # Test that flags prevent updates when conditions are unmet
      assert (
          client.json().set("obj", Path("foo"), "baz", nx=True) is None
      )
      assert (
          client.json().set("obj", Path("qaz"), "baz", xx=True) is None
      )
  
      # Test that flags allow updates when conditions are met
      assert client.json().set("obj", Path("foo"), "baz", xx=True)
      assert client.json().set("obj", Path("qaz"), "baz", nx=True)
  
      # Test that flags are mutually exlusive
      with pytest.raises(Exception):
          client.json().set("obj", Path("foo"), "baz", nx=True, xx=True)
  
imports: import pytest
  import redis
  from redis import Redis, exceptions
  from redis.commands.json.decoders import decode_list, unstring
  from redis.commands.json.path import Path
  from .conftest import _get_client, assert_resp_response, skip_ifmodversion_lt
label_desc: Use image node_id 8 for calling a global function with example usage: test_jsonsetexistentialmodifiersshouldsucceed(client) without return types