code: def test_range(client):
      for i in range(100):
          client.ts().add(1, i, i % 7)
      assert 100 == len(client.ts().range(1, 0, 200))
      for i in range(100):
          client.ts().add(1, i + 200, i % 7)
      assert 200 == len(client.ts().range(1, 0, 500))
      # last sample isn't returned
      assert 20 == len(
          client.ts().range(
              1, 0, 500, aggregation_type="avg", bucket_size_msec=10
          )
      )
      assert 10 == len(client.ts().range(1, 0, 500, count=10))
  
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 12 for calling a global function with example usage: test_range(client) without return types