ยปCore Development>Code coverage>Lib/antigravity.py

Python code coverage for Lib/antigravity.py

#countcontent
1n/a
2n/aimport webbrowser
3n/aimport hashlib
4n/a
5n/awebbrowser.open("https://xkcd.com/353/")
6n/a
7n/adef geohash(latitude, longitude, datedow):
8n/a '''Compute geohash() using the Munroe algorithm.
9n/a
10n/a >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68')
11n/a 37.857713 -122.544543
12n/a
13n/a '''
14n/a # http://xkcd.com/426/
15n/a h = hashlib.md5(datedow).hexdigest()
16n/a p, q = [('%f' % float.fromhex('0.' + x)) for x in (h[:16], h[16:32])]
17n/a print('%d%s %d%s' % (latitude, p[1:], longitude, q[1:]))