Staging
v0.5.1
https://github.com/python/cpython
Revision b2744c1be73f5af0d2dc4b952389efc90c8de94e authored by Lisa Roach on 21 November 2019, 18:14:32 UTC, committed by Andrew Svetlov on 21 November 2019, 18:14:32 UTC
(cherry picked from commit 046442d02bcc6e848e71e93e47f6cde9e279e993)

Co-authored-by: Jason Fried <fried@fb.com>
1 parent 9458c5c
Raw File
Tip revision: b2744c1be73f5af0d2dc4b952389efc90c8de94e authored by Lisa Roach on 21 November 2019, 18:14:32 UTC
[3.8] bpo-38857: AsyncMock fix for awaitable values and StopIteration fix [3.8] (GH-17269) (#17304)
Tip revision: b2744c1
antigravity.py

import webbrowser
import hashlib

webbrowser.open("https://xkcd.com/353/")

def geohash(latitude, longitude, datedow):
    '''Compute geohash() using the Munroe algorithm.

    >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68')
    37.857713 -122.544543

    '''
    # https://xkcd.com/426/
    h = hashlib.md5(datedow).hexdigest()
    p, q = [('%f' % float.fromhex('0.' + x)) for x in (h[:16], h[16:32])]
    print('%d%s %d%s' % (latitude, p[1:], longitude, q[1:]))
back to top