code: def _one_hot(indices, depth, axis=-1, dtype=np.float32):  # type: ignore
      values = np.asarray(indices)
      rank = len(values.shape)
      depth_range = np.arange(depth)
      if axis < 0:
          axis += rank + 1
      ls = values.shape[0:axis]
      rs = values.shape[axis:rank]
      new_shape = (1,) * len(ls) + depth_range.shape + (1,) * len(rs)
      targets = np.reshape(depth_range, new_shape)
      values = np.reshape(np.mod(values, depth), (*ls, 1, *rs))
      return np.asarray(targets == values, dtype=dtype)
  
imports: import numpy
  from onnx.reference.op_run import OpRun
label_desc: Use image node_id 1 for calling a global function with example usage: _one_hot(indices, depth, axis, dtype) and returns: np