code: def test_multi_reverse_range(client):
      client.ts().create(1, labels={"Test": "This", "team": "ny"})
      client.ts().create(
          2, labels={"Test": "This", "Taste": "That", "team": "sf"}
      )
      for i in range(100):
          client.ts().add(1, i, i % 7)
          client.ts().add(2, i, i % 11)
  
      res = client.ts().mrange(0, 200, filters=["Test=This"])
      assert 2 == len(res)
      if is_resp2_connection(client):
          assert 100 == len(res[0]["1"][1])
      else:
          assert 100 == len(res["1"][2])
  
      res = client.ts().mrange(0, 200, filters=["Test=This"], count=10)
      if is_resp2_connection(client):
          assert 10 == len(res[0]["1"][1])
      else:
          assert 10 == len(res["1"][2])
  
      for i in range(100):
          client.ts().add(1, i + 200, i % 7)
      res = client.ts().mrevrange(
          0,
          500,
          filters=["Test=This"],
          aggregation_type="avg",
          bucket_size_msec=10,
      )
      assert 2 == len(res)
      if is_resp2_connection(client):
          assert 20 == len(res[0]["1"][1])
          assert {} == res[0]["1"][0]
      else:
          assert 20 == len(res["1"][2])
          assert {} == res["1"][0]
  
      # test withlabels
      res = client.ts().mrevrange(
          0, 200, filters=["Test=This"], with_labels=True
      )
      if is_resp2_connection(client):
          assert {"Test": "This", "team": "ny"} == res[0]["1"][0]
      else:
          assert {"Test": "This", "team": "ny"} == res["1"][0]
  
      # test with selected labels
      res = client.ts().mrevrange(
          0, 200, filters=["Test=This"], select_labels=["team"]
      )
      if is_resp2_connection(client):
          assert {"team": "ny"} == res[0]["1"][0]
          assert {"team": "sf"} == res[1]["2"][0]
      else:
          assert {"team": "ny"} == res["1"][0]
          assert {"team": "sf"} == res["2"][0]
  
      # test filterby
      res = client.ts().mrevrange(
          0,
          200,
          filters=["Test=This"],
          filter_by_ts=[i for i in range(10, 20)],
          filter_by_min_value=1,
          filter_by_max_value=2,
      )
      if is_resp2_connection(client):
          assert [(16, 2.0), (15, 1.0)] == res[0]["1"][1]
      else:
          assert [[16, 2.0], [15, 1.0]] == res["1"][2]
  
      # test groupby
      res = client.ts().mrevrange(
          0, 3, filters=["Test=This"], groupby="Test", reduce="sum"
      )
      if is_resp2_connection(client):
          assert [(3, 6.0), (2, 4.0), (1, 2.0), (0, 0.0)] == res[0][
              "Test=This"
          ][1]
      else:
          assert [[3, 6.0], [2, 4.0], [1, 2.0], [0, 0.0]] == res[
              "Test=This"
          ][3]
      res = client.ts().mrevrange(
          0, 3, filters=["Test=This"], groupby="Test", reduce="max"
      )
      if is_resp2_connection(client):
          assert [(3, 3.0), (2, 2.0), (1, 1.0), (0, 0.0)] == res[0][
              "Test=This"
          ][1]
      else:
          assert [[3, 3.0], [2, 2.0], [1, 1.0], [0, 0.0]] == res[
              "Test=This"
          ][3]
      res = client.ts().mrevrange(
          0, 3, filters=["Test=This"], groupby="team", reduce="min"
      )
      assert 2 == len(res)
      if is_resp2_connection(client):
          assert [(3, 3.0), (2, 2.0), (1, 1.0), (0, 0.0)] == res[0][
              "team=ny"
          ][1]
          assert [(3, 3.0), (2, 2.0), (1, 1.0), (0, 0.0)] == res[1][
              "team=sf"
          ][1]
      else:
          assert [[3, 3.0], [2, 2.0], [1, 1.0], [0, 0.0]] == res[
              "team=ny"
          ][3]
          assert [[3, 3.0], [2, 2.0], [1, 1.0], [0, 0.0]] == res[
              "team=sf"
          ][3]
  
      # test align
      res = client.ts().mrevrange(
          0,
          10,
          filters=["team=ny"],
          aggregation_type="count",
          bucket_size_msec=10,
          align="-",
      )
      if is_resp2_connection(client):
          assert [(10, 1.0), (0, 10.0)] == res[0]["1"][1]
      else:
          assert [[10, 1.0], [0, 10.0]] == res["1"][2]
      res = client.ts().mrevrange(
          0,
          10,
          filters=["team=ny"],
          aggregation_type="count",
          bucket_size_msec=10,
          align=1,
      )
      if is_resp2_connection(client):
          assert [(1, 10.0), (0, 1.0)] == res[0]["1"][1]
      else:
          assert [[1, 10.0], [0, 1.0]] == res["1"][2]
  
imports: import math
  import time
  from time import sleep
  import pytest
  import redis
  from .conftest import assert_resp_response, is_resp2_connection, skip_ifmodversion_lt
label_desc: Use image node_id 24 for calling a global function with example usage: test_multi_reverse_range(client) without return types