code: def test_concordance_index():
      """Test concordance index."""
  
      metric = dc.metrics.Metric(dc.metrics.concordance_index)
  
      y_true = np.array([1, 3, 5, 4, 2])
      y_pred = np.array([3, 1, 5, 4, 2])
      assert metric.compute_singletask_metric(y_true, y_pred) == 0.7
  
      # best case
      y_true = np.array([1, 3, 5, 4, 2])
      y_pred = np.array([1, 3, 5, 4, 2])
      assert metric.compute_singletask_metric(y_true, y_pred) == 1.0
  
      # duplicate prediction value
      y_true = np.array([1, 3, 5, 4, 2])
      y_pred = np.array([1, 3, 4, 4, 2])
      assert metric.compute_singletask_metric(y_true, y_pred) == 0.95
  
file_path: deepchem/deepchem/metrics/tests/test_metrics.py
imports: import numpy
  import deepchem
label_desc: Use image node_id 6 for calling a global function with example usage: test_concordance_index() without return types