code: def test_threshold_predictions_binary():
      """Test thresholding of binary predictions."""
      # Get a random prediction matrix
      y = np.random.rand(10, 2)
      y = y / np.sum(y, axis=1)[:, np.newaxis]
      y_thresh = threshold_predictions(y, 0.5)
      assert y_thresh.shape == (10,)
      assert (y_thresh == np.argmax(y, axis=1)).all()
  
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 6 for calling a global function with example usage: test_threshold_predictions_binary() without return types