This source follows the same flow apt itself uses to check for a package's version, so it can be used to check for any APT repository (not necessarily Debian or Ubuntu).