code: def grpc_status_code(err: BentoMLException) -> grpc.StatusCode:
      """
      Convert BentoMLException.error_code to grpc.StatusCode.
      """
      return http_status_to_grpc_status_map().get(
          err.error_code, grpc.StatusCode.UNKNOWN
      )
  
imports: from __future__ import annotations
  import logging
  import typing
  from dataclasses import dataclass
  from functools import lru_cache
  from http import HTTPStatus
  from typing import TYPE_CHECKING
  from ..._internal.utils import resolve_user_filepath
  from ...exceptions import InvalidArgument
  from ._import_hook import LATEST_PROTOCOL_VERSION
  from ._import_hook import import_generated_stubs
  from ._import_hook import import_grpc
label_desc: Use image node_id 5 for calling a global function with example usage: grpc_status_code(err) and returns: http_status_to_grpc_status_map