code: def test_load_bad_model(tmpdir: "Path"):
      with pytest.raises(BentoMLException):
          Model.from_fs(
              fs.open_fs(
                  os.path.join(tmpdir, "nonexistent"), create=True
              )
          )
  
      bad_path = os.path.join(tmpdir, "badmodel")
      os.makedirs(bad_path)
      with open(
          os.path.join(bad_path, "model.yaml"),
          "w",
          encoding="utf-8",
          newline="",
      ) as model_yaml:
          model_yaml.write("bad yaml")
      with pytest.raises(BentoMLException):
          Model.from_fs(fs.open_fs(bad_path))
  
imports: from __future__ import annotations
  import os
  from datetime import datetime
  from datetime import timezone
  from sys import version_info
  from typing import TYPE_CHECKING
  import attr
  import fs
  import fs.errors
  import numpy
  import pytest
  from bentoml import Tag
  from bentoml._internal.configuration import BENTOML_VERSION
  from bentoml._internal.models import ModelOptions
  from bentoml._internal.models.model import Model
  from bentoml._internal.models.model import ModelInfo
  from bentoml._internal.models.model import ModelStore
  from bentoml.exceptions import BentoMLException
  from bentoml.testing.pytest import TEST_MODEL_CONTEXT
label_desc: Use image node_id 7 for calling a global function with example usage: test_load_bad_model(tmpdir) without return types