code: def test_reverse_shared_frames(idtype):
      g = dgl.graph([])
      g = g.astype(idtype).to(F.ctx())
      g.add_nodes(3)
      g.add_edges([0, 1, 2], [1, 2, 1])
      g.ndata["h"] = F.tensor([[0.0], [1.0], [2.0]])
      g.edata["h"] = F.tensor([[3.0], [4.0], [5.0]])
  
      rg = g.reverse(copy_ndata=True, copy_edata=True)
      assert F.allclose(g.ndata["h"], rg.ndata["h"])
      assert F.allclose(g.edata["h"], rg.edata["h"])
      assert F.allclose(
          g.edges[[0, 2], [1, 1]].data["h"],
          rg.edges[[1, 1], [0, 2]].data["h"],
      )
  
imports: import math
  import os
  import unittest
  import backend
  import dgl
  import dgl.function
  import dgl.partition
  import networkx
  import numpy
  import pytest
  from scipy import sparse
  from utils import parametrize_idtype
  from utils.graph_cases import get_cases
label_desc: Use image node_id 8 for calling a global function with example usage: test_reverse_shared_frames(idtype) without return types