code: def gen_rf_output_checker(
      expected_output: tuple[ext.NpNDArray, ext.NpNDArray]
  ) -> t.Callable[[t.Any], bool]:
      expected_output1, expected_output2 = expected_output
  
      def _check(
          out: tuple[ext.NpNDArray, list[dict[int, float]]]
      ) -> bool:
          out1, out2 = out
          flag1 = (out1 == expected_output1).all()
          out2_lst = [
              [d[idx] for idx in sorted(d.keys())] for d in out2
          ]
          flag2 = t.cast(
              bool,
              np.isclose(
                  np.array(out2_lst), expected_output2, rtol=1e-3
              ).all(),
          )
          return flag1 and flag2
  
      return _check
  
imports: from __future__ import annotations
  import os
  import tempfile
  import typing
  from typing import TYPE_CHECKING
  import numpy
  import onnx
  import onnxruntime
  import sklearn
  import torch
  import torch.nn
  from skl2onnx import convert_sklearn
  from skl2onnx.common.data_types import FloatTensorType
  from skl2onnx.common.data_types import Int64TensorType
  from skl2onnx.common.data_types import StringTensorType
  from sklearn.datasets import load_iris
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.model_selection import train_test_split
  from sklearn.preprocessing import LabelEncoder
  import bentoml
  from .None import FrameworkTestModel
  from .None import FrameworkTestModelConfiguration
  from .None import FrameworkTestModelInput
label_desc: Use image node_id 6 for calling a global function with example usage: gen_rf_output_checker(expected_output) and returns: _check, unknown