code: def _to_onehot(seq, num_states):
      oh = np.zeros((len(seq), num_states))
      oh[range(len(seq)), seq] = 1
      return oh
  
file_path: madmom/tests/test_ml_crf.py
imports: from __future__ import absolute_import, division, print_function
  import unittest
  from madmom.ml.crf import *
label_desc: Use image node_id 1 for calling a global function with example usage: _to_onehot(seq, num_states) and returns: oh