code: def _select_ops(
      operator_names,
      filters=("_contrib", "_"),
      merge_op_forward_backward=True,
  ):
      """From a given list of operators, filter out all operator names starting with given filters and prepares
      a dictionary of operator with attributes - 'has_backward' and 'nd_op_handle = mxnet.ndarray.op'
  
      By default, merge forward and backward operators for a given op into one operator and sets the attribute
      'has_backward' for the operator.
  
      By default, filter out all Contrib operators that starts with '_contrib' and internal operators that
      starts with '_'.
  
      Note - All deprecated operators are filtered out as well.
  
      Parameters
      ----------
      operator_names: List[str]
          List of operator names.
      filters: Tuple(str)
          Tuple of filters to apply on operator names.
      merge_op_forward_backward: Boolean, Default - True
          Merge forward and backward operators for a given op in to one op.
  
      Returns
      -------
      {"operator_name": {"has_backward", "nd_op_handle"}}
      """
      mx_operators = {}
      operators_with_backward = []
  
      # Filter out deprecated operators
      filters += (
          "normal",
          "uniform",
          "Flatten",
          "contrib_CTCLoss",
          "Pad",
          "Cast",
          "Pooling_v1",
          "Concat",
          "Reshape",
          "Convolution_v1",
          "SliceChannel",
          "Crop",
          "crop",
          "onehot_encode",
          "batch_take",
      )
  
      if merge_op_forward_backward:
          filters += ("_backward",)
  
      for cur_op_name in operator_names:
          if not cur_op_name.startswith(filters):
              mx_operators[cur_op_name] = {
                  "has_backward": False,
                  "nd_op_handle": getattr(MX_OP_MODULE, cur_op_name),
              }
  
          if cur_op_name.startswith("_backward_"):
              operators_with_backward.append(cur_op_name)
  
      if merge_op_forward_backward:
          # Identify all operators that can run backward.
          for op_with_backward in operators_with_backward:
              op_name = op_with_backward.split("_backward_")[1]
              if op_name in mx_operators:
                  mx_operators[op_name]["has_backward"] = True
  
      return mx_operators
  
imports: from operator import itemgetter
  from mxnet import runtime
  import mxnet
  from benchmark.opperf.rules.default_params import DEFAULTS_INPUTS, DEFAULTS_INPUTS_LARGE_TENSOR, MX_OP_MODULE
label_desc: Use image node_id 1 for calling a global function with example usage: _select_ops(operator_names, filters, merge_op_forward_backward) and returns: mx_operators