code: def get_ipaddr(self):
          '''
          Return the best IP address for this device.
          Returns the first matching IP:
              - Lowest Loopback interface
              - Lowest SVI address/known IP
          '''
          # Loopbacks - first interface
          if (len(self.loopbacks)):
              ips = self.loopbacks[0].ips
              if (len(ips)):
                  ips.sort()
                  return util.strip_slash_masklen(ips[0])
  
          # SVIs + all known - lowest address
          ips = []
          for svi in self.svis:
              ips.extend(svi.ip)
          ips.extend(self.ip)
          if (len(ips)):
              ips.sort()
              return util.strip_slash_masklen(ips[0])
  
          return 'f get_ipaddr(self):
          '''
          Return the best IP address for this device.
          Returns the first matching IP:
              - Lowest Loopback interface
              - Lowest SVI address/known IP
          '''
          # Loopbacks - first interface
          if (len(self.loopbacks)):
              ips = self.loopbacks[0].ips
              if (len(ips)):
                  ips.sort()
                  return util.strip_slash_masklen(ips[0])
  
          # SVIs + all known - lowest address
          ips = []
          for svi in self.svis:
              ips.extend(svi.ip)
          ips.extend(self.ip)
          if (len(ips)):
              ips.sort()
              return util.strip_slash_masklen(ips[0])
  
          return ''
docs: Return the best IP address for this device.
          Returns the first matching IP:
              - Lowest Loopback interface
              - Lowest SVI address/known IP