code: def test_bento_info(tmpdir: Path):
      start = datetime.now(timezone.utc)
      bentoinfo_a = BentoInfo(tag=Tag("tag"), service="service")
      end = datetime.now(timezone.utc)
  
      assert bentoinfo_a.bentoml_version == BENTOML_VERSION
      assert start <= bentoinfo_a.creation_time <= end
      # validate should fail
  
      tag = Tag("test", "version")
      service = "testservice"
      labels = {"label": "stringvalue"}
      model_creation_time = datetime.now(timezone.utc)
      model_a = BentoModelInfo(
          tag=Tag("model_a", "v1"),
          module="model_a_module",
          creation_time=model_creation_time,
      )
      model_b = BentoModelInfo(
          tag=Tag("model_b", "v3"),
          module="model_b_module",
          creation_time=model_creation_time,
          alias="model_b_alias",
      )
      models = [model_a, model_b]
      runner_a = BentoRunnerInfo(
          name="runner_a",
          runnable_type="test_runnable_a",
          models=["runner_a_model"],
          resource_config={"cpu": 2},
      )
      runners = [runner_a]
      api_predict = BentoApiInfo(
          name="predict",
          input_type="NumpyNdarray",
          output_type="NumpyNdarray",
      )
      apis = [api_predict]
  
      bentoinfo_b = BentoInfo(
          tag=tag,
          service=service,
          labels=labels,
          runners=runners,
          models=models,
          apis=apis,
      )
  
      bento_yaml_b_filename = os.path.join(tmpdir, "b_dump.yml")
      with open(
          bento_yaml_b_filename, "w", encoding="utf-8"
      ) as bento_yaml_b:
          bentoinfo_b.dump(bento_yaml_b)
  
      expected_yaml = """\
  service: testservice
  name: test
  version: version
  bentoml_version: {bentoml_version}
  creation_time: '{creation_time}'
  labels:
    label: stringvalue
  models:
  - tag: model_a:v1
    module: model_a_module
    creation_time: '{model_creation_time}'
  - tag: model_b:v3
    module: model_b_module
    creation_time: '{model_creation_time}'
    alias: model_b_alias
  runners:
  - name: runner_a
    runnable_type: test_runnable_a
    embedded: false
    models:
    - runner_a_model
    resource_config:
      cpu: 2
  apis:
  - name: predict
    input_type: NumpyNdarray
    output_type: NumpyNdarray
  docker:
    distro: debian
    python_version: '{python_version}'
    cuda_version: null
    env: null
    system_packages: null
    setup_script: null
    base_image: null
    dockerfile_template: null
  python:
    requirements_txt: null
    packages: null
    lock_packages: true
    index_url: null
    no_index: null
    trusted_host: null
    find_links: null
    extra_index_url: null
    pip_args: null
    wheels: null
  conda:
    environment_yml: null
    channels: null
    dependencies: null
    pip: null
  """
  
      with open(
          bento_yaml_b_filename, encoding="utf-8"
      ) as bento_yaml_b:
          assert bento_yaml_b.read() == expected_yaml.format(
              bentoml_version=BENTOML_VERSION,
              creation_time=bentoinfo_b.creation_time.isoformat(),
              model_creation_time=model_creation_time.isoformat(),
              python_version=f"{version_info.major}.{version_info.minor}",
          )
  
      with open(
          bento_yaml_b_filename, encoding="utf-8"
      ) as bento_yaml_b:
          bentoinfo_b_from_yaml = BentoInfo.from_yaml_file(bento_yaml_b)
  
          assert bentoinfo_b_from_yaml == bentoinfo_b
  
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 fs
  import pytest
  from bentoml import Tag
  from bentoml import bentos
  from bentoml._internal.bento import Bento
  from bentoml._internal.bento.bento import BentoApiInfo
  from bentoml._internal.bento.bento import BentoInfo
  from bentoml._internal.bento.bento import BentoModelInfo
  from bentoml._internal.bento.bento import BentoRunnerInfo
  from bentoml._internal.bento.build_config import BentoBuildConfig
  from bentoml._internal.configuration import BENTOML_VERSION
  from bentoml._internal.models import ModelStore
label_desc: Use image node_id 1 for calling a global function with example usage: test_bento_info(tmpdir) without return types