docs: def _discover_uri_type(uri):
      """Given a ``uri``, determine if it is internal or external."""
      parsed_uri = urlparse(uri)
      if not parsed_uri.netloc:
          if parsed_uri.scheme == 'data':
              type_ = INLINE_REFERENCE_TYPE
          else:
              type_ = INTERNAL_REFERENCE_TYPE
      else:
          type_ = EXTERNAL_REFERENCE_TYPE
      return type_