code: def pad_nested_sequences(sequences, dtype="int32"):
      """Pads nested sequences to the same length.
  
      This function transforms a list of list sequences
      into a 3D Numpy array of shape `(num_samples, max_sent_len, max_word_len)`.
  
      Args:
          sequences: List of lists of lists.
          dtype: Type of the output sequences.
  
      # Returns
          x: Numpy array.
      """
      max_sent_len = 0
      max_word_len = 0
      for sent in sequences:
          max_sent_len = max(len(sent), max_sent_len)
          for word in sent:
              max_word_len = max(len(word), max_word_len)
  
      x = np.zeros((len(sequences), max_sent_len, max_word_len)).astype(
          dtype
      )
      for i, sent in enumerate(sequences):
          for j, word in enumerate(sent):
              x[i, j, : len(word)] = word
  
      return x
  
imports: from ....None import utils
  from ....imports import *
  from .utils import Vocabulary
label_desc: Use image node_id 2 for calling a global function with example usage: pad_nested_sequences(sequences, dtype) and returns: x