code: def applies_to(self, url_data):
          
          return url_data.valid and url_data.scheme == 'https' and \
            not url_data.extern[0] and url_data.url_connection is not None
docs: Check validity, scheme, extern and url_connection.