code: def test_safe_map(self):
      def unreachable(*args, **kwargs):
          raise RuntimeError("unreachable")
  
      self.assertEqual([], util.safe_map(unreachable, []))
      self.assertEqual([], util.safe_map(unreachable, (), []))
      self.assertEqual([], util.safe_map(unreachable, [], [], []))
      self.assertEqual(
          [], util.safe_map(unreachable, [], iter([]), [], [])
      )
  
      def double(x):
          return x * 2
  
      self.assertEqual([14], util.safe_map(double, (7,)))
      self.assertEqual([0, 2, 4, 6], util.safe_map(double, range(4)))
  
      def make_tuple(*args):
          return args
  
      self.assertEqual(
          [(0, 4), (1, 5), (2, 6), (3, 7)],
          util.safe_map(make_tuple, range(4), range(4, 8)),
      )
  
file_path: jax/tests/util_test.py
imports: import operator
  from absl.testing import absltest
  from jax._src import linear_util
  from jax._src import test_util
  from jax._src import util
  from jax import config
  from jax._src.util import weakref_lru_cache
label_desc: Use image node_id 1 for calling the SafeMapTest obj's underlying member method code with example usage: obj.test_safe_map() and returns: unknown, args