code: def one_hot(indices, depth, axis=-1, dtype=np.float32):  # type: ignore
      """Compute one hot from indices at a specific axis"""
      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]
      targets = np.reshape(
          depth_range,
          (1,) * len(ls) + depth_range.shape + (1,) * len(rs),
      )
      values = np.reshape(np.mod(values, depth), (*ls, 1, *rs))
      return np.asarray(targets == values, dtype=dtype)
  
file_path: onnx/onnx/backend/test/case/node/onehot.py
imports: import numpy
  import onnx
  from onnx.backend.test.case.base import Base
  from onnx.backend.test.case.node import expect
label_desc: Use image node_id 1 for calling a global function with example usage: one_hot(indices, depth, axis, dtype) and returns: np