code: def test_metric_series():
      assert recall(s_true, s_pred) == 9 / 12
      assert isnan(recall(s0, s_pred))
      assert precision(s_true, s_pred) == 9 / 15
      assert f1_score(s_true, s_pred) == pytest.approx(2 / 3)
      assert isnan(f1_score(s0, s_pred))
      assert isnan(f1_score(1 - s_pred, s_pred))
      assert iou(s_true, s_pred) == 9 / 17
      assert iou(s_pred, s_true) == 9 / 17
      assert isnan(iou(s0, s0))
  
file_path: adtk/tests/test_metric.py
imports: from math import isnan
  import pandas
  import pytest
  from pandas import Timestamp
  from adtk.metrics import f1_score, iou, precision, recall
label_desc: Use image node_id 1 for calling a global function with example usage: test_metric_series() without return types