code: def test_local_manager_with_versions(
      v00, v01, v11, v10, versioning, working_dir, monkeypatch
  ):
      if versioning:
          monkeypatch.setenv(
              "MODELKIT_ASSETS_VERSIONING_SYSTEM", versioning
          )
  
      os.makedirs(os.path.join(working_dir, "something", v00))
      open(
          os.path.join(working_dir, "something", v00, ".SUCCESS"), "w"
      ).close()
  
      os.makedirs(os.path.join(working_dir, "something", v01))
      open(
          os.path.join(working_dir, "something", v01, ".SUCCESS"), "w"
      ).close()
  
      os.makedirs(
          os.path.join(working_dir, "something", v11, "subpart")
      )
      with open(
          os.path.join(
              working_dir, "something", v11, "subpart", "deep.txt"
          ),
          "w",
      ) as f:
          f.write("OK")
      open(
          os.path.join(working_dir, "something", v11, ".SUCCESS"), "w"
      ).close()
  
      manager = AssetsManager(assets_dir=working_dir)
      res = manager.fetch_asset(
          f"something:{v11}[subpart/deep.txt]", return_info=True
      )
      assert res["path"] == os.path.join(
          working_dir, "something", v11, "subpart", "deep.txt"
      )
  
      manager = AssetsManager(assets_dir=working_dir)
      res = manager.fetch_asset(
          f"something/{v11}/subpart/deep.txt", return_info=True
      )
      assert res["path"] == os.path.join(
          working_dir, "something", v11, "subpart", "deep.txt"
      )
  
      manager = AssetsManager(assets_dir=working_dir)
      res = manager.fetch_asset(f"something:{v00}", return_info=True)
      assert res["path"] == os.path.join(working_dir, "something", v00)
  
      manager = AssetsManager(assets_dir=working_dir)
      res = manager.fetch_asset("something", return_info=True)
      assert res["path"] == os.path.join(working_dir, "something", v11)
  
      if versioning in (None, "major_minor"):
          manager = AssetsManager(assets_dir=working_dir)
          res = manager.fetch_asset("something:0", return_info=True)
          assert res["path"] == os.path.join(
              working_dir, "something", v01
          )
  
      try:
          manager = AssetsManager()
          local_dir = os.path.join("tmp-local-asset", v10, "subpart")
          os.makedirs(local_dir)
          open(
              os.path.join("tmp-local-asset", v10, ".SUCCESS"), "w"
          ).close()
  
          shutil.copy("README.md", local_dir)
  
          res = manager.fetch_asset(
              f"tmp-local-asset:{v10}[subpart/README.md]",
              return_info=True,
          )
          assert res["path"] == os.path.abspath(
              os.path.join(local_dir, "README.md")
          )
  
          res = manager.fetch_asset("tmp-local-asset", return_info=True)
          assert res["path"] == os.path.abspath(
              os.path.join(local_dir, "..")
          )
  
          abs_path_to_readme = os.path.join(
              os.path.abspath(local_dir), "README.md"
          )
          res = manager.fetch_asset(
              abs_path_to_readme, return_info=True
          )
          assert res["path"] == abs_path_to_readme
      finally:
          shutil.rmtree("tmp-local-asset")
  
file_path: modelkit/tests/assets/test_local_manager.py
imports: import os
  import shutil
  import stat
  import pytest
  from modelkit.assets import errors
  from modelkit.assets.manager import AssetsManager, _fetch_local_version
  from modelkit.assets.remote import StorageProvider
  from modelkit.assets.settings import AssetSpec
  from tests import TEST_DIR
  from tests.assets.test_versioning import test_versioning
label_desc: Use image node_id 2 for calling a global function with example usage: test_local_manager_with_versions(v00, v01, v11, v10, versioning, working_dir, monkeypatch) without return types