code: def track_time(batch_size, feat_size, readout_op, type):
      device = utils.get_bench_device()
      ds = dgl.data.QM7bDataset()
      # prepare graph
      graphs = ds[0:batch_size][0]
  
      g = dgl.batch(graphs).to(device)
      if type == "node":
          g.ndata["h"] = torch.randn(
              (g.num_nodes(), feat_size), device=device
          )
          for i in range(10):
              out = dgl.readout_nodes(g, "h", op=readout_op)
          with utils.Timer() as t:
              for i in range(50):
                  out = dgl.readout_nodes(g, "h", op=readout_op)
      elif type == "edge":
          g.edata["h"] = torch.randn(
              (g.num_edges(), feat_size), device=device
          )
          for i in range(10):
              out = dgl.readout_edges(g, "h", op=readout_op)
          with utils.Timer() as t:
              for i in range(50):
                  out = dgl.readout_edges(g, "h", op=readout_op)
      else:
          raise Exception("Unknown type")
  
      return t.elapsed_secs / 50
  
imports: import time
  import dgl
  import torch
  from ..None import utils
label_desc: Use image node_id 1 for calling a global function with example usage: track_time(batch_size, feat_size, readout_op, type) and returns: unknown