code: def test_model(
      X_test_path: components.InputPath("np_array"),  # noqa: F821,N803
      y_test_path: components.InputPath("np_array"),  # noqa: F821
      model_path: components.InputPath("sklearn_model"),  # noqa: F821
      mlpipeline_ui_metadata_path: components.OutputPath(),
  ) -> NamedTuple(
      "Output",
      [("accuracy", float), ("precision", float), ("recall", float)],
  ):
      import json
      from collections import namedtuple
  
      import joblib
      import numpy as np
      import wandb
      from sklearn.ensemble import RandomForestClassifier  # noqa: F401
      from sklearn.metrics import (
          accuracy_score,
          precision_score,
          recall_score,
      )
  
      def add_wandb_visualization(run, mlpipeline_ui_metadata_path):
          """NOTE: To use this, you must modify your component to have an output called `mlpipeline_ui_metadata_path` AND call `wandb.init` yourself inside that component.
  
          Example usage:
  
          def my_component(..., mlpipeline_ui_metadata_path: OutputPath()):
              import wandb
              from wandb.integration.kfp.helpers import add_wandb_visualization
  
              with wandb.init() as run:
                  add_wandb_visualization(run, mlpipeline_ui_metadata_path)
  
                  ... # the rest of your code here
          """
  
          def get_iframe_html(run):
              return f'<iframe src="{run.url}?kfp=true" style="border:none;width:100%;height:100%;min-width:900px;min-height:600px;"></iframe>'
  
          iframe_html = get_iframe_html(run)
          metadata = {
              "outputs": [
                  {
                      "type": "markdown",
                      "storage": "inline",
                      "source": iframe_html,
                  }
              ]
          }
  
          with open(mlpipeline_ui_metadata_path, "w") as metadata_file:
              json.dump(metadata, metadata_file)
  
      with wandb.init() as run:
          add_wandb_visualization(run, mlpipeline_ui_metadata_path)
  
      with open(X_test_path, "rb") as f:
          X_test = np.load(f)  # noqa: N806
  
      with open(y_test_path, "rb") as f:
          y_test = np.load(f)
  
      model = joblib.load(model_path)
      preds = model.predict(X_test)
  
      accuracy = accuracy_score(y_test, preds)
      precision = precision_score(y_test, preds, average="micro")
      recall = recall_score(y_test, preds, average="micro")
  
      output = namedtuple("Output", ["accuracy", "precision", "recall"])
      return output(accuracy, precision, recall)
  
file_path: wandb/tests/functional_tests/t0_main/kfp/kfp-pipeline-helper.py
imports: import os
  import random
  from typing import NamedTuple
  import kfp
  import kfp.dsl
  from kfp import components
  from kubernetes.client.models import V1EnvVar
  from wandb_probe import wandb_probe_package
label_desc: Use image node_id 4 for calling a global function with example usage: test_model(X_test_path, y_test_path, model_path, mlpipeline_ui_metadata_path) and returns: output, str, run, str