code: def local_ip4_addr_list():
      """Return a set of IPv4 address
  
      You can use
      `logging.getLogger("dgl-distributed-socket").setLevel(logging.WARNING+1)`
      to disable the warning here
      """
      assert os.name != "nt", "Do not support Windows rpc yet."
      nic = set()
      logger = logging.getLogger("dgl-distributed-socket")
      for if_nidx in socket.if_nameindex():
          name = if_nidx[1]
          sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
          try:
              ip_of_ni = fcntl.ioctl(
                  sock.fileno(),
                  0x8915,  # SIOCGIFADDR
                  struct.pack("256s", name[:15].encode("UTF-8")),
              )
          except OSError as e:
              if e.errno == 99:  # EADDRNOTAVAIL
                  logger.warning(
                      "Warning! Interface: %s \n"
                      "IP address not available for interface.",
                      name,
                  )
                  continue
              raise e
  
          ip_addr = socket.inet_ntoa(ip_of_ni[20:24])
          nic.add(ip_addr)
      return nic
  
file_path: dgl/python/dgl/distributed/rpc_client.py
imports: import atexit
  import logging
  import os
  import socket
  import time
  from .None import rpc
  from .constants import MAX_QUEUE_SIZE
label_desc: Use image node_id 1 for calling a global function with example usage: local_ip4_addr_list() and returns: nic