code: def test_get_resource():
      with pytest.raises(bentoml.exceptions.BentoMLConfigException):
          get_resource({}, "bad_resource")
  
      with pytest.raises(ValueError):
          get_resource({"dummy": "bad"}, "dummy")
  
      assert get_resource({}, "dummy") is None
      assert (
          get_resource({"dummy": "testval"}, "dummy") == "testvaldummy"
      )
      assert (
          get_resource({"dummy": "system"}, "dummy")
          == "dummy_fromsystem"
      )
  
file_path: BentoML/tests/unit/_internal/test_resource.py
imports: import math
  import pytest
  import bentoml
  import bentoml.exceptions
  from bentoml._internal.resource import CpuResource
  from bentoml._internal.resource import NvidiaGpuResource
  from bentoml._internal.resource import Resource
  from bentoml._internal.resource import get_resource
  from bentoml._internal.resource import system_resources
  from bentoml.exceptions import BentoMLConfigException
label_desc: Use image node_id 2 for calling a global function with example usage: test_get_resource() without return types