code: def get_ip_addresses(self, machine, *, boot_only=False, discovered=False):
          
          boot_ips = [
              link.ip_address
              for link in machine.boot_interface.links
              if link.ip_address
          ]
          if boot_only:
              if boot_ips:
                  return boot_ips
              elif discovered:
                  return [
                      link.ip_address
                      for link in machine.boot_interface.discovered
                      if link.ip_address
                  ]
              else:
                  return []
          else:
              other_ips = [
                  link.ip_address
                  for interface in machine.interfaces
                  for link in interface.links
                  if (interface.id != machine.boot_interface.id and
                      link.ip_address)
              ]
              ips = boot_ips + other_ips
              if ips:
                  return ips
              elif discovered:
                  return [
                      link.ip_address
                      for link in machine.boot_interface.discovered
                      if link.ip_address
                  ] + [
                      link.ip_address
                      for interface in machine.interfaces
                      for link in interface.discovered
                      if (interface.id != machine.boot_interface.id and
                          link.ip_address)
                  ]
              else:
                  return []
docs: Return all IP address for `machine`.
  
          IP address from `boot_interface` come first.