code: def test_transform(ray_start_regular_shared):
      def f(it):
          for item in it:
              yield item * 2
  
      def g(it):
          for item in it:
              if item >= 2:
                  yield item
  
      it = from_range(4).transform(f)
      assert (
          repr(it)
          == "ParallelIterator[from_range[4, shards=2].transform()]"
      )
      assert list(it.gather_sync()) == [0, 4, 2, 6]
  
      it = from_range(4)
      assert list(it.gather_sync().transform(g)) == [2, 3]
  
imports: import sys
  import time
  import collections
  from collections import Counter
  import pytest
  import ray
  from ray.util.iter import from_items, from_iterators, from_range, from_actors, ParallelIteratorWorker, LocalIterator
  from ray._private.test_utils import Semaphore
label_desc: Use image node_id 2 for calling a global function with example usage: test_transform(ray_start_regular_shared) without return types