code: def url_for(endpoint, default=DEFAULT_ENDPOINT, **values):
      
  
      try:
          return router.url_for(endpoint, force_external=True, values=values)
      except Exception:
          logger.warn("Could not build API URL for endpoint '%s'. "
                      "No route provider registered?" % endpoint)
          # build generic API URL
          return router.url_for(default, force_external=True, values=values)
docs: Looks up the API URL for the given endpoint
  
      :param endpoint: The name of the registered route (aka endpoint)
      :type endpoint: string
      :returns: External URL for this endpoint
      :rtype: string/None