code: def test_merge_models_with_base():
      model_base = vowpalwabbit.Workspace(quiet=True)
      model_base.learn("1 | foobar")
      model_base.learn("1 | foobar")
      model_base.learn("1 | foobar")
      model_base.save("test_merge_models_with_base.model")
  
      model1 = vowpalwabbit.Workspace(
          quiet=True,
          preserve_performance_counters=True,
          initial_regressor="test_merge_models_with_base.model",
      )
      model1.learn("1 | foo")
      model1.learn("1 | foo")
      model2 = vowpalwabbit.Workspace(
          quiet=True,
          preserve_performance_counters=True,
          initial_regressor="test_merge_models_with_base.model",
      )
      model2.learn("1 | bar")
      model2.learn("1 | bar")
      model2.learn("1 | bar")
  
      merged_model = vowpalwabbit.merge_models(
          model_base, [model1, model2]
      )
      assert merged_model.get_weighted_examples() == (
          model_base.get_weighted_examples()
          + (
              model1.get_weighted_examples()
              - model_base.get_weighted_examples()
          )
          + (
              model2.get_weighted_examples()
              - model_base.get_weighted_examples()
          )
      )
  
      assert model_base.get_weight_from_name("foobar") != 0
      assert model1.get_weight_from_name("foobar") != 0
      assert model2.get_weight_from_name("foobar") != 0
      assert merged_model.get_weight_from_name("foobar") != 0
  
      assert model1.get_weight_from_name("foo") != 0
      assert model1.get_weight_from_name("bar") == 0
      assert merged_model.get_weight_from_name("foo") != 0
      assert model2.get_weight_from_name("foo") == 0
      assert model2.get_weight_from_name("bar") != 0
      assert merged_model.get_weight_from_name("bar") != 0
  
imports: import os
  from pathlib import Path
  import vowpalwabbit
  from vowpalwabbit import Workspace
  import pytest
  import warnings
  import filecmp
label_desc: Use image node_id 51 for calling a global function with example usage: test_merge_models_with_base() without return types