Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
The input url is a handyurl instance

These doctests are from DefaultIAURLCanonicalizerTest.java:

>>> from handyurl import handyurl
>>> canonicalize(handyurl.parse("http://www.alexa.com/")).getURLString()
'http://alexa.com/'
>>> canonicalize(handyurl.parse("http://archive.org/index.html")).getURLString()
'http://archive.org/index.html'
>>> canonicalize(handyurl.parse("http://archive.org/index.html?")).getURLString()(more...)

        def canonicalize(url):
    """The input url is a handyurl instance

    These doctests are from DefaultIAURLCanonicalizerTest.java:

    >>> from handyurl import handyurl
    >>> canonicalize(handyurl.parse("http://www.alexa.com/")).getURLString()
    'http://alexa.com/'
    >>> canonicalize(handyurl.parse("http://archive.org/index.html")).getURLString()
    'http://archive.org/index.html'
    >>> canonicalize(handyurl.parse("http://archive.org/index.html?")).getURLString()
    'http://archive.org/index.html'
    >>> canonicalize(handyurl.parse("http://archive.org/index.html?a=b")).getURLString()
    'http://archive.org/index.html?a=b'
    >>> canonicalize(handyurl.parse("http://archive.org/index.html?b=b&a=b")).getURLString()
    'http://archive.org/index.html?a=b&b=b'
    >>> canonicalize(handyurl.parse("http://archive.org/index.html?b=a&b=b&a=b")).getURLString()
    'http://archive.org/index.html?a=b&b=a&b=b'
    >>> canonicalize(handyurl.parse("http://www34.archive.org/index.html?b=a&b=b&a=b")).getURLString()
    'http://archive.org/index.html?a=b&b=a&b=b'
    """

    url = GoogleURLCanonicalizer.canonicalize(url)
    url = IAURLCanonicalizer.canonicalize(url)

    return url
        


src/s/u/surt-0.2/surt/surt.py   surt(Download)
from handyurl import handyurl
from URLRegexTransformer import hostToSURT
from DefaultIAURLCanonicalizer import canonicalize
 
# surt()
        return url
 
    hurl = canonicalize(handyurl.parse(url))
    key  = hurl.getURLString(surt=True)