code: def get_symblock_from_args_scenario(op_name, args_scenario):
      args_scenario = args_scenario.copy()
      args_scenario.pop(CFG_RTOL_ATOL, None)  # not used here
      subgraph_cfg = args_scenario.pop(CFG_SUBGRAPH, None)
      if subgraph_cfg is None:
          op_sym_fn = get_op_sym_fn(op_name)
      else:
          op_sym_fn = get_op_sym_fn(subgraph_cfg.base_op)
  
      # split binded args
      binded_args = [
          (k, v) for k, v in args_scenario.items() if "," in k
      ]
      for arg_names, arg_cfgs in binded_args:
          args_scenario.pop(arg_names)
          arg_names = arg_names.replace(" ", "").split(",")
          assert isinstance(arg_cfgs, tuple) and len(arg_cfgs) == len(
              arg_names
          )
          for arg_name, arg_cfg in zip(arg_names, arg_cfgs):
              assert arg_name not in args_scenario
              args_scenario[arg_name] = arg_cfg
  
      # generate cfg based args
      for arg_name, arg_cfg in args_scenario.items():
          if isinstance(arg_cfg, CfgBasedArg):
              args_scenario[arg_name] = arg_cfg.gen_arg(args_scenario)
  
      kw_args = {}
      pos_args = {}
      for arg_name, arg_cfg in args_scenario.items():
          if isinstance(
              arg_cfg, (TensorArg, mx.nd.NDArray, mx.np.ndarray)
          ):
              arg_cfg = mx.sym.var(arg_name)
              if _is_np_op(op_name):
                  arg_cfg = arg_cfg.as_np_ndarray()
          if arg_name.isdigit():
              pos_args[int(arg_name)] = arg_cfg
          else:
              kw_args[arg_name] = arg_cfg
      pos_args = [pos_args[k] for k in sorted(pos_args.keys())]
  
      sym = op_sym_fn(*pos_args, **kw_args)
      if subgraph_cfg is not None:
          if len(sym.list_outputs()) > 1:
              sym = sym[0]
          # add additional op (+1), so the graph pass can convert the tested op
          sym = mx.sym.relu(sym).optimize_for(subgraph_cfg.backend)
      assert op_name in sym.tojson()
  
      args_with_shape, args_with_dtype = {}, {}
      for arg_name, arg_cfg in args_scenario.items():
          if isinstance(arg_cfg, (mx.nd.NDArray, mx.np.ndarray)):
              args_with_shape[arg_name] = arg_cfg.shape
              args_with_dtype[arg_name] = arg_cfg.dtype
  
      infered_shapes_args, _, infered_shapes_auxs = sym.infer_shape(
          **args_with_shape
      )
      infered_shapes_args = dict(
          zip(sym.list_arguments(), infered_shapes_args)
      )
      infered_shapes_auxs = dict(
          zip(sym.list_auxiliary_states(), infered_shapes_auxs)
      )
  
      infered_dtypes_args, _, infered_dtypes_auxs = sym.infer_type(
          **args_with_dtype
      )
      infered_dtypes_args = dict(
          zip(sym.list_arguments(), infered_dtypes_args)
      )
      infered_dtypes_auxs = dict(
          zip(sym.list_auxiliary_states(), infered_dtypes_auxs)
      )
  
      symblock_input_data = {}
      for arg_name in [
          *sym.list_arguments(),
          *sym.list_auxiliary_states(),
      ]:
          tensor_cfg = args_scenario[arg_name]
          if isinstance(tensor_cfg, TensorArg):
              shape = infered_shapes_args.get(
                  arg_name, infered_shapes_auxs.get(arg_name, None)
              )
              dtype = infered_dtypes_args.get(
                  arg_name, infered_dtypes_auxs.get(arg_name, None)
              )
              tensor = tensor_cfg.gen_tensor(shape, dtype)
          else:
              tensor = tensor_cfg
          symblock_input_data[arg_name] = tensor
  
      symblock_input_syms = [
          mx.sym.var(name) for name in symblock_input_data.keys()
      ]
      if _is_np_op(op_name):
          symblock_input_syms = [
              var.as_np_ndarray() for var in symblock_input_syms
          ]
      symblock = mx.gluon.SymbolBlock(sym, symblock_input_syms)
      symblock.initialize()
      assert len(symblock.collect_params()) == 0
  
      return symblock, list(symblock_input_data.values())
  
file_path: mxnet/tests/python/dnnl/op_cfg.py
imports: from collections import namedtuple
  from itertools import product
  from functools import partial
  import mxnet
  from mxnet.base import _is_np_op, _NP_OP_PREFIX, _NP_EXT_OP_PREFIX, _NP_INTERNAL_OP_PREFIX, _OP_NAME_PREFIX_LIST
label_desc: Use image node_id 9 for calling a global function with example usage: get_symblock_from_args_scenario(op_name, args_scenario) and returns: symblock,  list