class_docstr: Base class for P2P RPC servicers (e.g. DHT, averager, MoE server). The interface mimics gRPC servicers.
  
  - ``add_p2p_handlers(self, p2p)`` registers all rpc_* methods of the derived class as P2P handlers, allowing
    other peers to call them. It uses type annotations for the ``request`` parameter and the return value
    to infer protobufs the methods operate with.
  
  - ``get_stub(self, p2p, peer)`` creates a stub with all rpc_* methods. Calls to the stub methods are translated
    to calls to the remote peer.
class_docstr_tok: ["Base","class","for","P2P","RPC","servicers","(","e.g",".","DHT",",","averager",",","MoE","server",")",".","The","interface","mimics","gRPC","servicers",".","-","``","add_p2p_handlers","(","self",",","p2p",")","``","registers","all","rpc_","*","methods","of","the","derived","class","as","P2P","handlers",",","allowing","other","peers","to","call","them",".","It","uses","type","annotations","for","the","``","request","``","parameter","and","the","return","value","to","infer","protobufs","the","methods","operate","with",".","-","``","get_stub","(","self",",","p2p",",","peer",")","``","creates","a","stub","with","all","rpc_","*","methods",".","Calls","to","the","stub","methods","are","translated","to","calls","to","the","remote","peer","."]
code: def _get_handle_name(
      cls, namespace: Optional[str], method_name: str
  ) -> str:
      handle_name = f"{cls.__name__}.{method_name}"
      if namespace is not None:
          handle_name = f"{namespace}::{handle_name}"
      return handle_name
  
file_path: hivemind/hivemind/p2p/servicer.py
imports: import asyncio
  import inspect
  from dataclasses import dataclass
  from typing import Any, AsyncIterator, List, Optional, Tuple, Type, get_type_hints
  from hivemind.p2p.p2p_daemon import P2P
  from hivemind.p2p.p2p_daemon_bindings.datastructures import PeerID
label_desc: Use image node_id 4 for calling the ServicerBase obj's underlying member method code with example usage: obj._get_handle_name(cls, namespace, method_name) and returns: handle_name