code: def test_arrlen_dollar(client):
      client.json().set(
          "doc1",
          "$",
          {
              "a": ["foo"],
              "nested1": {"a": ["hello", None, "world"]},
              "nested2": {"a": 31},
          },
      )
  
      # Test multi
      assert client.json().arrlen("doc1", "$..a") == [1, 3, None]
      assert client.json().arrappend(
          "doc1", "$..a", "non", "abba", "stanza"
      ) == [
          4,
          6,
          None,
      ]
  
      client.json().clear("doc1", "$.a")
      assert client.json().arrlen("doc1", "$..a") == [0, 6, None]
      # Test single
      assert client.json().arrlen("doc1", "$.nested1.a") == [6]
  
      # Test missing key
      with pytest.raises(exceptions.ResponseError):
          client.json().arrappend("non_existing_doc", "$..a")
  
      client.json().set(
          "doc1",
          "$",
          {
              "a": ["foo"],
              "nested1": {"a": ["hello", None, "world"]},
              "nested2": {"a": 31},
          },
      )
      # Test multi (return result of last path)
      assert client.json().arrlen("doc1", "$..a") == [1, 3, None]
      assert (
          client.json().arrappend(
              "doc1", "..a", "non", "abba", "stanza"
          )
          == 6
      )
  
      # Test single
      assert client.json().arrlen("doc1", ".nested1.a") == 6
  
      # Test missing key
      assert client.json().arrlen("non_existing_doc", "..a") is None
  
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 36 for calling a global function with example usage: test_arrlen_dollar(client) without return types