code: def modellibrary_fixture(
      # arguments passed directly to ModelLibrary
      settings=None,
      assetsmanager_settings=None,
      configuration=None,
      models=None,
      required_models=None,
      #  fixture name
      fixture_name="testing_model_library",
      necessary_fixtures=None,
      fixture_scope="session",
  ):
      import pytest
  
      #  create a named fixture with the ModelLibrary
      @pytest.fixture(name=fixture_name, scope=fixture_scope)
      def fixture_function(request):
          if necessary_fixtures:
              for fixture_name in necessary_fixtures:
                  request.getfixturevalue(fixture_name)
          return ModelLibrary(
              settings=settings,
              assetsmanager_settings=assetsmanager_settings,
              configuration=configuration,
              models=models,
              required_models=required_models,
          )
  
      # in order for the above functions to be collected by pytest, add them
      # to the caller's local variables under their desired names
      frame = inspect.currentframe().f_back
      frame.f_locals[fixture_name] = fixture_function
  
file_path: modelkit/modelkit/testing/fixtures.py
imports: import dataclasses
  import inspect
  import os
  import pydantic
  import pydantic.generics
  from modelkit.core.library import ModelLibrary
  from modelkit.core.model import Model
  from modelkit.core.model_configuration import configure
  from modelkit.testing.reference import ReferenceJson
label_desc: Use image node_id 2 for calling a global function with example usage: modellibrary_fixture(settings, assetsmanager_settings, configuration, models, required_models, fixture_name, necessary_fixtures, fixture_scope) and returns: ModelLibrary