code: def is_blocked(self, ip):
          
          blocked = True
  
          if ip in self.allowed_admin_ips:
              blocked = False
  
          for allowed_range in self.allowed_admin_ip_ranges:
              if ipaddress.ip_address(ip) in ipaddress.ip_network(allowed_range):
                  blocked = False
  
          return blocked
docs: Determine if an IP address should be considered blocked.