code: def test_strict_convert_map_output(ray_start_regular_shared):
      ds = (
          ray.data.range(1)
          .map_batches(lambda x: {"id": [0, 1, 2, 3]})
          .materialize()
      )
      assert ds.take_batch()["id"].tolist() == [0, 1, 2, 3]
  
      with pytest.raises(ValueError):
          # Strings not converted into array.
          ray.data.range(1).map_batches(
              lambda x: {"id": "string"}, max_retries=0
          ).materialize()
  
      class UserObj:
          def __eq__(self, other):
              return isinstance(other, UserObj)
  
      ds = (
          ray.data.range(1)
          .map_batches(lambda x: {"id": [0, 1, 2, UserObj()]})
          .materialize()
      )
      assert ds.take_batch()["id"].tolist() == [0, 1, 2, UserObj()]
  
file_path: ray/python/ray/data/tests/test_strict_mode.py
imports: from collections import UserDict
  import numpy
  import pytest
  import ray
  from ray.data.tests.conftest import *
  from ray.tests.conftest import *
label_desc: Use image node_id 3 for calling a global function with example usage: test_strict_convert_map_output(ray_start_regular_shared) and returns: isinstance