code: def test_pickling_subgraph():
      f1 = io.BytesIO()
      f2 = io.BytesIO()
      g = dgl.rand_graph(10000, 100000)
      g.ndata["x"] = F.randn((10000, 4))
      g.edata["x"] = F.randn((100000, 5))
      pickle.dump(g, f1)
      sg = g.subgraph([0, 1])
      sgx = sg.ndata["x"]  # materialize
      pickle.dump(sg, f2)
      # TODO(BarclayII): How should I test that the size of the subgraph pickle file should not
      # be as large as the size of the original pickle file?
      assert f1.tell() > f2.tell() * 50
  
      f2.seek(0)
      f2.truncate()
      sgx = sg.edata["x"]  # materialize
      pickle.dump(sg, f2)
      assert f1.tell() > f2.tell() * 50
  
      f2.seek(0)
      f2.truncate()
      sg = g.edge_subgraph([0])
      sgx = sg.edata["x"]  # materialize
      pickle.dump(sg, f2)
      assert f1.tell() > f2.tell() * 50
  
      f2.seek(0)
      f2.truncate()
      sgx = sg.ndata["x"]  # materialize
      pickle.dump(sg, f2)
      assert f1.tell() > f2.tell() * 50
  
      f1.close()
      f2.close()
  
imports: import io
  import pickle
  import unittest
  import backend
  import dgl
  import dgl.function
  import networkx
  import pytest
  import scipy.sparse
  from dgl.graph_index import create_graph_index
  from dgl.utils import toindex
  from utils import assert_is_identical, assert_is_identical_hetero, check_graph_equal, get_cases, parametrize_idtype
label_desc: Use image node_id 11 for calling a global function with example usage: test_pickling_subgraph() without return types