code: def parse_method_name(method_name: str) -> tuple[MethodName, bool]:
      """
      Infers the grpc service and method name from the handler_call_details.
      e.g. /package.ServiceName/MethodName
      """
      method = method_name.split("/", maxsplit=2)
      # sanity check for method.
      if len(method) != 3:
          return MethodName(), False
      _, package_service, method = method
      *packages, service = package_service.rsplit(".", maxsplit=1)
      package = packages[0] if packages else ""
      return MethodName(package, service, method), True
  
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 7 for calling a global function with example usage: parse_method_name(method_name) and returns: MethodName,  True, MethodName,  False