def parse(url, decoded=True, lazy=False):
    """Automatically turn text into a structured URL object.

    Args:

       decoded (bool): Whether or not to return a :class:`DecodedURL`,
          which automatically handles all
          encoding/decoding/quoting/unquoting for all the various
          accessors of parts of the URL, or an :class:`EncodedURL`,
          which has the same API, but requires handling of special
          characters for different parts of the URL.

       lazy (bool): In the case of `decoded=True`, this controls
          whether the URL is decoded immediately or as accessed. The
          default, `lazy=False`, checks all encoded parts of the URL
          for decodability.
    """
    enc_url = EncodedURL.from_text(url)
    if not decoded:
        return enc_url
    dec_url = DecodedURL(enc_url, lazy=lazy)
    return dec_url
Automatically turn text into a structured URL object.

    Args:

       decoded (bool): Whether or not to return a :class:`DecodedURL`,
          which automatically handles all
          encoding/decoding/quoting/unquoting for all the various
          accessors of parts of the URL, or an :class:`EncodedURL`,
          which has the same API, but requires handling of special
          characters for different parts of the URL.

       lazy (bool): In the case of `decoded=True`, this controls
          whether the URL is decoded immediately or as accessed. The
          default, `lazy=False`, checks all encoded parts of the URL
          for decodability.
    
stackoverflow/venv/lib/python3.6/site-packages/hyperlink/_url.py