code: def validate(cls, val: str):
      if val == "baddummy":
          raise ValueError
  
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 the DummyResource obj's underlying member method code with example usage: obj.validate(cls, val) without return types