code: def _create_homogeneous_dgl_block_from_tensor_d(
      tensor_d,
      renumber_map,
      seednodes_range=None,
  ):
      rs = tensor_d["sources"]
      rd = tensor_d["destinations"]
      max_src_nodes = tensor_d["sources_range"]
      max_dst_nodes = tensor_d["destinations_range"]
      if seednodes_range is not None:
          # If we have  vertices without outgoing edges, then
          # sources can be missing from seednodes
          # so we add them
          # to ensure all the blocks are
          # lined up correctly
          max_dst_nodes = max(max_dst_nodes, seednodes_range)
  
      data_dict = {("_N", "_E", "_N"): (rs, rd)}
      num_src_nodes = {"_N": max_src_nodes + 1}
      num_dst_nodes = {"_N": max_dst_nodes + 1}
  
      block = dgl.create_block(
          data_dict=data_dict,
          num_src_nodes=num_src_nodes,
          num_dst_nodes=num_dst_nodes,
      )
      if "edge_id" in tensor_d:
          block.edata[dgl.EID] = tensor_d["edge_id"]
      # Below adds run time overhead
      block.srcdata[dgl.NID] = renumber_map[0 : max_src_nodes + 1]
      block.dstdata[dgl.NID] = renumber_map[0 : max_dst_nodes + 1]
      return block
  
imports: from __future__ import annotations
  from typing import List, Tuple, Dict, Optional
  from collections import defaultdict
  import cudf
  from cugraph.utilities.utils import import_optional
  from cugraph_dgl.nn import SparseGraph
label_desc: Use image node_id 9 for calling a global function with example usage: _create_homogeneous_dgl_block_from_tensor_d(tensor_d, renumber_map, seednodes_range) and returns: block