code: def _nested_offsets(x, encoding):
      """Replace each string in a nested list with a list of start offsets."""
      if isinstance(x, list):
          return [_nested_offsets(v, encoding) for v in x]
      else:
          if not x:
              return []
          encoded_x = x.encode("utf-32-be")
          encoded_chars = [
              encoded_x[i : i + 4] for i in range(0, len(encoded_x), 4)
          ]
          char_lens = [
              len(c.decode("utf-32-be").encode(encoding))
              for c in encoded_chars
          ]
          return [0] + np.cumsum(char_lens).tolist()[:-1]
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_string_ops
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.ops.ragged import ragged_string_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 3 for calling a global function with example usage: _nested_offsets(x, encoding) and returns: unknown, unknown, list