docs: def get_address_in_network(network, fallback=None, fatal=False):
      """Get an IPv4 or IPv6 address within the network from the host.
  
      :param network (str): CIDR presentation format. For example,
          '192.168.1.0/24'. Supports multiple networks as a space-delimited list.
      :param fallback (str): If no address is found, return fallback.
      :param fatal (boolean): If no address is found, fallback is not
          set and fatal is True then exit(1).
      """
      if network is None:
          if fallback is not None:
              return fallback
  
          if fatal:
              no_ip_found_error_out(network)
          else:
              return None
  
      networks = network.split() or [network]
      for network in networks:
          _validate_cidr(network)
          network = netaddr.IPNetwork(network)
          for iface in netifaces.interfaces():
              try:
                  addresses = netifaces.ifaddresses(iface)
              except ValueError:
                  # If an instance was deleted between
                  # netifaces.interfaces() run and now, its interfaces are gone
                  continue
              if network.version == 4 and netifaces.AF_INET in addresses:
                  for addr in addresses[netifaces.AF_INET]:
                      cidr = netaddr.IPNetwork("%s/%s" % (addr['addr'],
                                                          addr['netmask']))
                      if cidr in network:
                          return str(cidr.ip)
  
              if network.version == 6 and netifaces.AF_INET6 in addresses:
                  for addr in addresses[netifaces.AF_INET6]:
                      cidr = _get_ipv6_network_from_address(addr)
                      if cidr and cidr in network:
                          return str(cidr.ip)
  
      if fallback is not None:
          return fallback
  
      if fatal:
          no_ip_found_error_out(network)
  
      return None