docstr: Get socket address for every process
docstr_tok: ["Get","socket","address","for","every","process"]
code: def get_external_addresses(
      cls, address: str, n_process: int = None, ports: List[int] = None
  ):
      """Get socket address for every process"""
      if ":" in address:
          host, port = address.split(":", 1)
          port = int(port)
          if ports:
              if len(ports) != n_process:
                  raise ValueError(
                      f"`ports` specified, but its count "
                      f"is not equal to `n_process`, "
                      f"number of ports: {len(ports)}, "
                      f"n_process: {n_process}"
                  )
              sub_ports = ports
          else:
              sub_ports = [0] * n_process
      else:
          host = address
          if ports and len(ports) != n_process + 1:
              # ports specified, the first of which should be main port
              raise ValueError(
                  f"`ports` specified, but its count "
                  f"is not equal to `n_process` + 1, "
                  f"number of ports: {len(ports)}, "
                  f"n_process + 1: {n_process + 1}"
              )
          elif not ports:
              ports = [0] * (n_process + 1)
          port = ports[0]
          sub_ports = ports[1:]
      return [f"{host}:{port}" for port in [port] + sub_ports]
  
imports: import asyncio
  import concurrent.futures
  import contextlib
  import logging.config
  import multiprocessing
  import os
  import random
  import signal
  import sys
  import threading
  import uuid
  from dataclasses import dataclass
  from types import TracebackType
  from typing import List
  from ....utils import dataslots, ensure_coverage, reset_id_random_seed
  from ..config import ActorPoolConfig
  from ..message import CreateActorMessage
  from ..pool import MainActorPoolBase, SubActorPoolBase, _register_message_handler
label_desc: Use image node_id 1 for calling the MainActorPool obj's underlying member method code with example usage: obj.get_external_addresses(cls, address, n_process, ports) and returns: unknown