code: def _fill_ragged_attribute(ext: RaggedExtraction) -> None:
      """Recurse the nested_list from the given RaggedExtraction.
  
      Args:
        ext: RaggedExtraction tuple containing the input/outputs
  
      Returns:
        None, the function mutates instead `ext.nested_row_lengths` and
          `ext.flat_values` lists.
      """
      # Register the current sequence length.
      # Could be 0 in case of empty list or an np.empty(shape=(0, ...)).
      curr_sequence_length = len(ext.nested_list)
      ext.nested_row_lengths[ext.curr_ragged_rank].append(
          curr_sequence_length
      )
      # Sanity check if sequence is static, but should have been catched before
      # by `Sequence.encode_example`
      expected_sequence_length = ext.tensor_info.shape[
          ext.curr_ragged_rank
      ]
      if (
          expected_sequence_length is not None
          and expected_sequence_length != curr_sequence_length
      ):
          raise ValueError(
              "Received length {} do not match the expected one {} from {}.".format(
                  curr_sequence_length,
                  expected_sequence_length,
                  ext.tensor_info,
              )
          )
  
      if ext.curr_ragged_rank < ext.tensor_info.sequence_rank - 1:
          # If there are additional Sequence dimension, recurse 1 level deeper.
          for sub_list in ext.nested_list:
              _fill_ragged_attribute(
                  ext._replace(
                      nested_list=sub_list,
                      curr_ragged_rank=ext.curr_ragged_rank + 1,
                  )
              )
      else:
          # Otherwise, we reached the max level deep, so add the current items
          for item in ext.nested_list:
              item = _item_to_np_array(  # Normalize the item
                  item,
                  dtype=ext.tensor_info.np_dtype,
                  # We only check the non-ragged shape
                  shape=ext.tensor_info.shape[
                      ext.tensor_info.sequence_rank :
                  ],
              )
              ext.flat_values.append(item)
  
imports: from __future__ import annotations
  import abc
  import collections
  import dataclasses
  from typing import Any, Mapping, Union
  import numpy
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.features import feature
  from tensorflow_datasets.core.utils import dtype_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  from tensorflow_datasets.proto import tf_example_pb2
  from tensorflow_datasets.proto import tf_feature_pb2
label_desc: Use image node_id 8 for calling a global function with example usage: _fill_ragged_attribute(ext) without return types