code: def test_second_model_needs_pipeline_input():
      # First model takes one parameter
      p1 = Program()
      func_inputs = {"x1": mb.placeholder(shape=(2,))}
      with Function(func_inputs) as ssa_fun:
          x1 = ssa_fun.inputs["x1"]
          y1 = mb.add(x=x1, y=[0.0, 1.0], name="y1")
          ssa_fun.set_outputs([y1])
          p1.add_function("main", ssa_fun)
      m1 = ct.convert(p1)
  
      # Second model takes two parameters. One will be from previous model in pipeline.
      # The other as pipeline input.
      p2 = Program()
      func_inputs = {
          "y1": mb.placeholder(shape=(2,)),
          "x2": mb.placeholder(shape=(2,)),
      }
      with Function(func_inputs) as ssa_fun:
          x2, y1 = ssa_fun.inputs["x2"], ssa_fun.inputs["y1"]
          y2 = mb.add(x=x2, y=y1, name="y2")
          ssa_fun.set_outputs([y2])
          p2.add_function("main", ssa_fun)
      m2 = ct.convert(p2)
  
      # Get predictions without a pipeline
      x1 = [1.0, 2.0]
      y1 = m1.predict({"x1": x1})["y1"]
      x2 = [4.0, 9.0]
      y2 = m2.predict({"x2": x2, "y1": y1})["y2"]
  
      # Make a pipeline and get predictions from it
      pipeline = ct.utils.make_pipeline(m1, m2)
      y_pipeline = pipeline.predict({"x1": x1, "x2": x2})
      assert len(y_pipeline) == 1
  
      np.testing.assert_allclose(y2, y_pipeline["y2"])
  
imports: import itertools
  import tempfile
  import unittest
  import numpy
  import pytest
  import coremltools
  from coremltools._deps import _HAS_LIBSVM, _HAS_SKLEARN
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Function, Program
  from coremltools.models.pipeline import PipelineClassifier, PipelineRegressor
  from coremltools.models.utils import _is_macos
label_desc: Use image node_id 4 for calling the TestMakePipeline obj's underlying member method code with example usage: obj.test_second_model_needs_pipeline_input() without return types