code: def assign_textual_node_features(ndata, textset, ntype):
      """
      Assigns numericalized tokens from a torchtext dataset to given block.
  
      The numericalized tokens would be stored in the block as node features
      with the same name as ``field_name``.
  
      The length would be stored as another node feature with name
      ``field_name + '__len'``.
  
      block : DGLGraph
          First element of the compacted blocks, with "dgl.NID" as the
          corresponding node ID in the original graph, hence the index to the
          text dataset.
  
          The numericalized tokens (and lengths if available) would be stored
          onto the blocks as new node features.
      textset : torchtext.data.Dataset
          A torchtext dataset whose number of examples is the same as that
          of nodes in the original graph.
      """
      node_ids = ndata[dgl.NID].numpy()
  
      for field_name, field in textset.fields.items():
          examples = [getattr(textset[i], field_name) for i in node_ids]
  
          tokens, lengths = field.process(examples)
  
          if not field.batch_first:
              tokens = tokens.t()
  
          ndata[field_name] = tokens
          ndata[field_name + "__len"] = lengths
  
imports: import argparse
  import pickle
  import time
  import dgl
  import dgl.function
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.utils.data import DataLoader, IterableDataset
  from ..None import utils
label_desc: Use image node_id 4 for calling a global function with example usage: assign_textual_node_features(ndata, textset, ntype) without return types