code: def _test_NodeEdgeGraphData():
      from dgl.data.csv_dataset_base import (
          EdgeData,
          GraphData,
          NodeData,
      )
  
      # NodeData basics
      num_nodes = 100
      node_ids = np.arange(num_nodes, dtype=float)
      ndata = NodeData(node_ids, {})
      assert np.array_equal(ndata.id, node_ids)
      assert len(ndata.data) == 0
      assert ndata.type == "_V"
      assert np.array_equal(ndata.graph_id, np.full(num_nodes, 0))
      # NodeData more
      data = {"feat": np.random.rand(num_nodes, 3)}
      graph_id = np.arange(num_nodes)
      ndata = NodeData(node_ids, data, type="user", graph_id=graph_id)
      assert ndata.type == "user"
      assert np.array_equal(ndata.graph_id, graph_id)
      assert len(ndata.data) == len(data)
      for k, v in data.items():
          assert k in ndata.data
          assert np.array_equal(ndata.data[k], v)
      # NodeData except
      expect_except = False
      try:
          NodeData(
              np.arange(num_nodes),
              {"feat": np.random.rand(num_nodes + 1, 3)},
              graph_id=np.arange(num_nodes - 1),
          )
      except:
          expect_except = True
      assert expect_except
  
      # EdgeData basics
      num_nodes = 100
      num_edges = 1000
      src_ids = np.random.randint(num_nodes, size=num_edges)
      dst_ids = np.random.randint(num_nodes, size=num_edges)
      edata = EdgeData(src_ids, dst_ids, {})
      assert np.array_equal(edata.src, src_ids)
      assert np.array_equal(edata.dst, dst_ids)
      assert edata.type == ("_V", "_E", "_V")
      assert len(edata.data) == 0
      assert np.array_equal(edata.graph_id, np.full(num_edges, 0))
      # EdageData more
      src_ids = np.random.randint(num_nodes, size=num_edges).astype(
          float
      )
      dst_ids = np.random.randint(num_nodes, size=num_edges).astype(
          float
      )
      data = {"feat": np.random.rand(num_edges, 3)}
      etype = ("user", "like", "item")
      graph_ids = np.arange(num_edges)
      edata = EdgeData(
          src_ids, dst_ids, data, type=etype, graph_id=graph_ids
      )
      assert np.array_equal(edata.src, src_ids)
      assert np.array_equal(edata.dst, dst_ids)
      assert edata.type == etype
      assert len(edata.data) == len(data)
      for k, v in data.items():
          assert k in edata.data
          assert np.array_equal(edata.data[k], v)
      assert np.array_equal(edata.graph_id, graph_ids)
      # EdgeData except
      expect_except = False
      try:
          EdgeData(
              np.arange(num_edges),
              np.arange(num_edges + 1),
              {"feat": np.random.rand(num_edges - 1, 3)},
              graph_id=np.arange(num_edges + 2),
          )
      except:
          expect_except = True
      assert expect_except
  
      # GraphData basics
      num_graphs = 10
      graph_ids = np.arange(num_graphs)
      gdata = GraphData(graph_ids, {})
      assert np.array_equal(gdata.graph_id, graph_ids)
      assert len(gdata.data) == 0
      # GraphData more
      graph_ids = np.arange(num_graphs).astype(float)
      data = {"feat": np.random.rand(num_graphs, 3)}
      gdata = GraphData(graph_ids, data)
      assert np.array_equal(gdata.graph_id, graph_ids)
      assert len(gdata.data) == len(data)
      for k, v in data.items():
          assert k in gdata.data
          assert np.array_equal(gdata.data[k], v)
  
imports: import gzip
  import io
  import os
  import tarfile
  import tempfile
  import unittest
  import warnings
  import backend
  import dgl
  import dgl.data
  import numpy
  import pandas
  import pytest
  import yaml
  from dgl import DGLError
label_desc: Use image node_id 29 for calling a global function with example usage: _test_NodeEdgeGraphData() without return types