code: def test_profiler():
      iter_num = 5
      begin_profiling_iter = 2
      end_profiling_iter = 4
  
      enable_profiler("test_profiler.json", False, False)
  
      A = mx.sym.Variable("A")
      B = mx.sym.Variable("B")
      C = mx.symbol.dot(A, B)
  
      executor = C._simple_bind(
          mx.cpu(1), "write", A=(4096, 4096), B=(4096, 4096)
      )
  
      a = mx.random.uniform(-1.0, 1.0, shape=(4096, 4096))
      b = mx.random.uniform(-1.0, 1.0, shape=(4096, 4096))
  
      a.copyto(executor.arg_dict["A"])
      b.copyto(executor.arg_dict["B"])
  
      for i in range(iter_num):
          if i == begin_profiling_iter:
              t0 = time.process_time()
              profiler.set_state("run")
          if i == end_profiling_iter:
              t1 = time.process_time()
              profiler.set_state("stop")
          executor.forward()
          c = executor.outputs[0]
          c.wait_to_read()
  
      duration = t1 - t0
      profiler.dump(True)
      profiler.set_state("stop")
  
imports: from __future__ import print_function
  import time
  import os
  import csv
  import json
  import numpy
  from collections import OrderedDict
  import mxnet
  from mxnet import profiler
  from mxnet.gluon import nn
  from mxnet.test_utils import is_cd_run
  from common import run_in_spawned_process
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: test_profiler() without return types