code: def _nested_encode(x, encoding):
      """Encode each string in a nested list with `encoding`."""
      if isinstance(x, list):
          return [_nested_encode(v, encoding) for v in x]
      else:
          return x.encode(encoding)
  
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 1 for calling a global function with example usage: _nested_encode(x, encoding) and returns: unknown, x