class_docstr: Router provides mapping from external address to internal address.
code: def __init__(
      self,
      external_addresses: List[str],
      local_address: Optional[str],
      mapping: Dict[str, str] = None,
  ):
      self._curr_external_addresses = external_addresses
      self._local_mapping = dict()
      for addr in self._curr_external_addresses:
          self._local_mapping[addr] = local_address
      if mapping is None:
          mapping = dict()
      self._mapping = mapping
      self._cache_local = threading.local()
  
file_path: mars/mars/oscar/backends/router.py
imports: import threading
  from typing import Dict, List, Tuple, Type, Any, Optional
  from .communication import get_client_type, Client
label_desc: Use image node_id 4 to create a new Router object  with example: obj = Router(external_addresses, local_address, mapping)