code: def test_toggle(client):
      client.json().set("bool", Path.root_path(), False)
      assert client.json().toggle("bool", Path.root_path())
      assert client.json().toggle("bool", Path.root_path()) is False
      # check non-boolean value
      client.json().set("num", Path.root_path(), 1)
      with pytest.raises(redis.exceptions.ResponseError):
          client.json().toggle("num", Path.root_path())
  
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 15 for calling a global function with example usage: test_toggle(client) without return types