') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); fix geopy Error by chapter09 · Pull Request #13 · awslabs/mxnet-lambda · GitHub
Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lambda_function.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,9 +19,9 @@
if os.environ.get('LAMBDA_TASK_ROOT') is None:
print "just exit, we are not in a lambda function",
import sys; sys.exit(0)
from geopy.geocoders import Nominatim
geolocator = Nominatim()

import geopy
geolocator = geopy.geocoders.GoogleV3()

# del all files in tmp directory - just in case
import os
Expand DownExpand Up@@ -222,4 +222,4 @@ def lambda_handler(event, context):
"body": '{"address": "%s", "latlng": "%s"}' % (loc[0], loc[1]),
"statusCode": 200
}
return out
return out
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.0
Name: numpy
Version: 1.13.3
Version: 1.13.0
Summary: NumPy: array processing for numbers, strings, records, and objects.
Home-page: http://www.numpy.org
Author: NumPy Developers
Expand Down
865 changes: 431 additions & 434 deletions src/numpy-1.13.3.dist-info/RECORD → src/numpy-1.13.0.dist-info/RECORD

Large diffs are not rendered by default.

Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
{"classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "Intended Audience :: Developers", "License :: OSI Approved", "Programming Language :: C", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development", "Topic :: Scientific/Engineering", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", "Operating System :: MacOS"], "download_url": "http://sourceforge.net/projects/numpy/files/NumPy/", "extensions": {"python.details": {"contacts": [{"email": "numpy-discussion@python.org", "name": "NumPy Developers", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "http://www.numpy.org"}}}, "generator": "bdist_wheel (0.29.0)", "license": "BSD", "metadata_version": "2.0", "name": "numpy", "platform": "Windows", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "summary": "NumPy: array processing for numbers, strings, records, and objects.", "version": "1.13.3"}
{"classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "Intended Audience :: Developers", "License :: OSI Approved", "Programming Language :: C", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development", "Topic :: Scientific/Engineering", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", "Operating System :: MacOS"], "download_url": "http://sourceforge.net/projects/numpy/files/NumPy/", "extensions": {"python.details": {"contacts": [{"email": "numpy-discussion@python.org", "name": "NumPy Developers", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "http://www.numpy.org"}}}, "generator": "bdist_wheel (0.29.0)", "license": "BSD", "metadata_version": "2.0", "name": "numpy", "platform": "Windows", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "summary": "NumPy: array processing for numbers, strings, records, and objects.", "version": "1.13.0"}
Binary file removedsrc/numpy/.libs/libgfortran-ed201abd.so.3.0.0
Binary file not shown.
Binary file removedsrc/numpy/.libs/libopenblasp-r0-39a31c03.2.18.so
Binary file not shown.
Binary file modifiedsrc/numpy/core/_dummy.so
100755 → 100644
Binary file not shown.
8 changes: 4 additions & 4 deletions src/numpy/core/function_base.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -292,13 +292,13 @@ def geomspace(start, stop, num=50, endpoint=True, dtype=None):

Negative, decreasing, and complex inputs are allowed:

>>> np.geomspace(1000, 1, num=4)
>>> geomspace(1000, 1, num=4)
array([ 1000., 100., 10., 1.])
>>> np.geomspace(-1000, -1, num=4)
>>> geomspace(-1000, -1, num=4)
array([-1000., -100., -10., -1.])
>>> np.geomspace(1j, 1000j, num=4) # Straight line
>>> geomspace(1j, 1000j, num=4) # Straight line
array([ 0. +1.j, 0. +10.j, 0. +100.j, 0.+1000.j])
>>> np.geomspace(-1+0j, 1+0j, num=5) # Circle
>>> geomspace(-1+0j, 1+0j, num=5) # Circle
array([-1.00000000+0.j , -0.70710678+0.70710678j,
0.00000000+1.j , 0.70710678+0.70710678j,
1.00000000+0.j ])
Expand Down
Binary file modifiedsrc/numpy/core/lib/libnpymath.a
Binary file not shown.
Binary file modifiedsrc/numpy/core/multiarray.so
100755 → 100644
Binary file not shown.
Binary file modifiedsrc/numpy/core/multiarray_tests.so
100755 → 100644
Binary file not shown.
2 changes: 1 addition & 1 deletion src/numpy/core/numeric.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -445,7 +445,7 @@ def count_nonzero(a, axis=None):
counts = np.apply_along_axis(multiarray.count_nonzero, axis[0], a)

if axis.size == 1:
return counts.astype(np.intp, copy=False)
return counts
else:
# for subsequent axis numbers, that number decreases
# by one in this new 'counts' array if it was larger
Expand Down
Binary file modifiedsrc/numpy/core/operand_flag_tests.so
100755 → 100644
Binary file not shown.
2 changes: 1 addition & 1 deletion src/numpy/core/records.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -704,7 +704,7 @@ def fromstring(datastring, dtype=None, shape=None, offset=0, formats=None,

itemsize = descr.itemsize
if (shape is None or shape == 0 or shape == -1):
shape = (len(datastring) - offset) // itemsize
shape = (len(datastring) - offset) / itemsize

_array = recarray(shape, descr, buf=datastring, offset=offset)
return _array
Expand Down
6 changes: 3 additions & 3 deletions src/numpy/core/shape_base.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -439,9 +439,9 @@ def block(arrays):
"""
Assemble an nd-array from nested lists of blocks.

Blocks in the innermost lists are concatenated (see `concatenate`) along
the last dimension (-1), then these are concatenated along the
second-last dimension (-2), and so on until the outermost list is reached.
Blocks in the innermost lists are `concatenate`d along the last
dimension (-1), then these are `concatenate`d along the second-last
dimension (-2), and so on until the outermost list is reached

Blocks can be of any dimension, but will not be broadcasted using the normal
rules. Instead, leading axes of size 1 are inserted, to make ``block.ndim``
Expand Down
Binary file modifiedsrc/numpy/core/struct_ufunc_test.so
100755 → 100644
Binary file not shown.
Binary file modifiedsrc/numpy/core/test_rational.so
100755 → 100644
Binary file not shown.
10 changes: 3 additions & 7 deletions src/numpy/core/tests/test_defchararray.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,8 +5,7 @@
import numpy as np
from numpy.core.multiarray import _vec_string
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_array_equal,
suppress_warnings,
TestCase, run_module_suite, assert_, assert_equal, assert_array_equal
)

kw_unicode_true = {'unicode': True} # make 2to3 work properly
Expand DownExpand Up@@ -347,11 +346,8 @@ def test_decode(self):
A = np.char.array([b'\\u03a3'])
assert_(A.decode('unicode-escape')[0] == '\u03a3')
else:
with suppress_warnings() as sup:
if sys.py3kwarning:
sup.filter(DeprecationWarning, "'hex_codec'")
A = np.char.array(['736563726574206d657373616765'])
assert_(A.decode('hex_codec')[0] == 'secret message')
A = np.char.array(['736563726574206d657373616765'])
assert_(A.decode('hex_codec')[0] == 'secret message')

def test_encode(self):
B = self.B.encode('unicode_escape')
Expand Down
18 changes: 0 additions & 18 deletions src/numpy/core/tests/test_deprecations.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -132,24 +132,6 @@ class _VisibleDeprecationTestCase(_DeprecationTestCase):
warning_cls = np.VisibleDeprecationWarning


class TestBooleanBinaryMinusDeprecation(_DeprecationTestCase):
"""Test deprecation of binary boolean `-`. While + and * are well
defined, binary - is not and even a corrected form seems to have
no real uses.

The deprecation process was started in NumPy 1.9.
"""
message = r"numpy boolean subtract, the `-` operator, .*"

def test_operator_deprecation(self):
array = np.array([True])
generic = np.bool_(True)

# Minus operator/subtract ufunc:
self.assert_deprecated(operator.sub, args=(array, array))
self.assert_deprecated(operator.sub, args=(generic, generic))


class TestRankDeprecation(_DeprecationTestCase):
"""Test that np.rank is deprecated. The function should simply be
removed. The VisibleDeprecationWarning may become unnecessary.
Expand Down
75 changes: 1 addition & 74 deletions src/numpy/core/tests/test_multiarray.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,7 @@
)

# Need to test an object that does not fully implement math interface
from datetime import timedelta, datetime
from datetime import timedelta


if sys.version_info[:2] > (3, 2):
Expand DownExpand Up@@ -1476,21 +1476,6 @@ def test_void_sort(self):
arr = np.empty(1000, dt)
arr[::-1].sort()

def test_sort_raises(self):
#gh-9404
arr = np.array([0, datetime.now(), 1], dtype=object)
for kind in ['q', 'm', 'h']:
assert_raises(TypeError, arr.sort, kind=kind)
#gh-3879
class Raiser(object):
def raises_anything(*args, **kwargs):
raise TypeError("SOMETHING ERRORED")
__eq__ = __ne__ = __lt__ = __gt__ = __ge__ = __le__ = raises_anything
arr = np.array([[Raiser(), n] for n in range(10)]).reshape(-1)
np.random.shuffle(arr)
for kind in ['q', 'm', 'h']:
assert_raises(TypeError, arr.sort, kind=kind)

def test_sort_degraded(self):
# test degraded dataset would take minutes to run with normal qsort
d = np.arange(1000000)
Expand DownExpand Up@@ -2494,17 +2479,6 @@ def test_diagonal_memleak(self):
if HAS_REFCOUNT:
assert_(sys.getrefcount(a) < 50)

def test_size_zero_memleak(self):
# Regression test for issue 9615
# Exercises a special-case code path for dot products of length
# zero in cblasfuncs (making it is specific to floating dtypes).
a = np.array([], dtype=np.float64)
x = np.array(2.0)
for _ in range(100):
np.dot(a, a, out=x)
if HAS_REFCOUNT:
assert_(sys.getrefcount(x) < 50)

def test_trace(self):
a = np.arange(12).reshape((3, 4))
assert_equal(a.trace(), 15)
Expand DownExpand Up@@ -2788,10 +2762,6 @@ def test__complex__should_not_work(self):
e = np.array(['1+1j'], 'U')
assert_raises(TypeError, complex, e)

class TestCequenceMethods(object):
def test_array_contains(self):
assert_(4.0 in np.arange(16.).reshape(4,4))
assert_(20.0 not in np.arange(16.).reshape(4,4))

class TestBinop(object):
def test_inplace(self):
Expand DownExpand Up@@ -3202,26 +3172,6 @@ def test_elide_scalar(self):
a = np.bool_()
assert_(type(~(a & a)) is np.bool_)

def test_elide_scalar_readonly(self):
# The imaginary part of a real array is readonly. This needs to go
# through fast_scalar_power which is only called for powers of
# +1, -1, 0, 0.5, and 2, so use 2. Also need valid refcount for
# elision which can be gotten for the imaginary part of a real
# array. Should not error.
a = np.empty(100000, dtype=np.float64)
a.imag ** 2

def test_elide_readonly(self):
# don't try to elide readonly temporaries
r = np.asarray(np.broadcast_to(np.zeros(1), 100000).flat) * 0.0
assert_equal(r, 0)

def test_elide_updateifcopy(self):
a = np.ones(2**20)[::2]
b = a.flat.__array__() + 1
del b
assert_equal(a, 1)


class TestCAPI(TestCase):
def test_IsPythonScalar(self):
Expand DownExpand Up@@ -4353,18 +4303,6 @@ def test_none_shape(self):
x.resize()
assert_array_equal(x, np.eye(3))

def test_0d_shape(self):
# to it multiple times to test it does not break alloc cache gh-9216
for i in range(10):
x = np.empty((1,))
x.resize(())
assert_equal(x.shape, ())
assert_equal(x.size, 1)
x = np.empty(())
x.resize((1,))
assert_equal(x.shape, (1,))
assert_equal(x.size, 1)

def test_invalid_arguments(self):
self.assertRaises(TypeError, np.eye(3).resize, 'hi')
self.assertRaises(ValueError, np.eye(3).resize, -1)
Expand DownExpand Up@@ -6692,17 +6630,6 @@ def test_empty_result(self):
assert_array_equal(ibad,
np.atleast_2d(np.array([[],[]], dtype=np.intp)))

def test_largedim(self):
# invalid read regression gh-9304
shape = [10, 2, 3, 4, 5, 6]
np.random.seed(2)
array = np.random.rand(*shape)

for i in range(10):
benchmark = array.nonzero()
result = array.nonzero()
assert_array_equal(benchmark, result)


if not IS_PYPY:
# sys.getsizeof() is not valid on PyPy
Expand Down
84 changes: 0 additions & 84 deletions src/numpy/core/tests/test_multiarray_assignment.py

This file was deleted.

Loading