code: def test_pearsonr():
      """Test the Pearson correlation coefficient is correct."""
      metric = dc.metrics.Metric(dc.metrics.pearsonr)
      r = metric.compute_metric(
          np.array([1.0, 2.0, 3.0]), np.array([2.0, 3.0, 4.0])
      )
      np.testing.assert_almost_equal(1.0, r)
      r = metric.compute_metric(
          np.array([1.0, 2.0, 3.0]), np.array([-2.0, -3.0, -4.0])
      )
      np.testing.assert_almost_equal(-1.0, r)
      r = metric.compute_metric(
          np.array([1.0, 2.0, 3.0, 4.0]), np.array([1.0, 2.0, 2.0, 1.0])
      )
      np.testing.assert_almost_equal(0.0, r)
  
file_path: deepchem/deepchem/metrics/tests/test_metrics.py
imports: import numpy
  import deepchem
label_desc: Use image node_id 3 for calling a global function with example usage: test_pearsonr() without return types