code: def test_confusion_matrix_with_valid_inputs_with_labels_and_with_weights():
      # Given
      input_solution = ["cat", "ant", "cat", "cat", "ant", "bird"]
      input_prediction = ["ant", "ant", "cat", "cat", "ant", "cat"]
      labels = ["ant", "bird", "cat"]
      weights = [0.1, 0.3, 1.0, 0.8, 0.2, 2.0]
      expected_output = np.array(
          [[0.5, 0.0, 0.0], [0.0, 0.0, 2.0], [0.1, 0.0, 1.8]]
      )
  
      # When
      observed_output = confusion_matrix(
          input_solution,
          input_prediction,
          labels=labels,
          weights=weights,
      )
  
      # Then
      assert np.array_equal(expected_output, observed_output)
  
imports: import numpy
  import pytest
  import sklearn
  from autogluon.core.metrics import confusion_matrix, log_loss, quadratic_kappa, roc_auc
  from autogluon.core.metrics.softclass_metrics import soft_log_loss
label_desc: Use image node_id 3 for calling a global function with example usage: test_confusion_matrix_with_valid_inputs_with_labels_and_with_weights() without return types