code: def test_one_hot():
      """Test the one hot encoding."""
      y = np.array([0, 0, 1, 0, 1, 1, 0])
      y_hot = to_one_hot(y)
      expected = np.array(
          [[1, 0], [1, 0], [0, 1], [1, 0], [0, 1], [0, 1], [1, 0]]
      )
      yp = from_one_hot(y_hot)
      assert np.array_equal(expected, y_hot)
      assert np.array_equal(y, yp)
  
imports: import numpy
  import deepchem
  from deepchem.metrics import to_one_hot
  from deepchem.metrics import from_one_hot
  from deepchem.metrics import threshold_predictions
  from deepchem.metrics import handle_classification_mode
  from deepchem.metrics import normalize_prediction_shape
  from deepchem.metrics import normalize_weight_shape
label_desc: Use image node_id 1 for calling a global function with example usage: test_one_hot() without return types