code: def make_descriptor_spec(
      spec: dict[str, t.Any] | None,
      pb: type[pb.ServiceMetadataResponse],
  ) -> pb.ServiceMetadataResponse.DescriptorMetadata:
      from .....io_descriptors.json import parse_dict_to_proto
  
      if spec is not None:
          descriptor_id = spec.pop("id")
          return pb.DescriptorMetadata(
              descriptor_id=descriptor_id,
              attributes=struct_pb2.Struct(
                  fields={
                      key: parse_dict_to_proto(
                          _tuple_converter(value), struct_pb2.Value()
                      )
                      for key, value in spec.items()
                  }
              ),
          )
      return pb.DescriptorMetadata()
  
file_path: BentoML/src/bentoml/_internal/server/grpc/servicer/v1/__init__.py
imports: from __future__ import annotations
  import logging
  import sys
  import typing
  from typing import TYPE_CHECKING
  import anyio
  from ......exceptions import BentoMLException
  from ......exceptions import InvalidArgument
  from ......grpc.utils import grpc_status_code
  from ......grpc.utils import import_generated_stubs
  from ......grpc.utils import import_grpc
  from ......grpc.utils import validate_proto_fields
  from .....utils import LazyLoader
  from .....utils import is_async_callable
label_desc: Use image node_id 4 for calling a global function with example usage: make_descriptor_spec(spec, pb) and returns: pb, pb