code: def test_metric_kwargs():
      y_true = np.array([1, 1, 1, 0, 0, 0])
      y_pred = np.array([0, 1, 1, 0, 1, 1])
      score = f1(y_true, y_pred)
  
      score_pos_label_1 = f1(y_true, y_pred, pos_label=1)
      score_pos_label_0 = f1(y_true, y_pred, pos_label=0)
  
      assert score == score_pos_label_1
      assert score > score_pos_label_0
      assert score_pos_label_0 == 0.4
  
      error = f1.error(y_true, y_pred)
      error_pos_label_1 = f1.error(y_true, y_pred, pos_label=1)
      error_pos_label_0 = f1.error(y_true, y_pred, pos_label=0)
  
      assert f1.optimum == 1
      assert error == (f1.optimum - score)
      assert error_pos_label_1 == (f1.optimum - score_pos_label_1)
      assert error_pos_label_0 == (f1.optimum - score_pos_label_0)
      assert error_pos_label_0 == 0.6
  
imports: import numpy
  import sklearn.metrics
  from autogluon.core.metrics import f1, make_scorer
label_desc: Use image node_id 1 for calling a global function with example usage: test_metric_kwargs() without return types