From 5034a8dd9f6542f017a6e5a9d46db2b055e69c65 Mon Sep 17 00:00:00 2001 From: Pierce Edmiston Date: Fri, 13 Sep 2019 09:14:43 -0500 Subject: [PATCH 1/5] Pierce Edmiston --- warmup.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 warmup.py diff --git a/warmup.py b/warmup.py new file mode 100644 index 0000000..ffa56d8 --- /dev/null +++ b/warmup.py @@ -0,0 +1,16 @@ +import pathlib +import shutil +import zipfile + + +def extract_txt(zip_filename, dst_dir): + """Extract all txt files from a zip.""" + with zipfile.ZipFile(zip_filename) as zip_src: + names = [ + name for name in zip_src.namelist() + if pathlib.Path(name).suffix == ".txt" + ] + for member in names: + dst_path = pathlib.Path(dst_dir) / pathlib.Path(member).name + with zip_src.open(member) as src, open(dst_path, "wb") as dst: + shutil.copyfileobj(src, dst) \ No newline at end of file From dfed48c5713c36a13abffc621ca2ee2b840844ba Mon Sep 17 00:00:00 2001 From: Pierce Edmiston Date: Thu, 12 Sep 2019 17:35:38 -0500 Subject: [PATCH 2/5] Create python environment with black installed --- Pipfile | 15 ++++++++++++++ Pipfile.lock | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 Pipfile create mode 100644 Pipfile.lock diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..61a1960 --- /dev/null +++ b/Pipfile @@ -0,0 +1,15 @@ +[[source]] +name = "pypi" +url = "https://pypi.org/simple" +verify_ssl = true + +[dev-packages] + +[packages] +black = "*" + +[requires] +python_version = "3.7" + +[pipenv] +allow_prereleases = true diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..6ba82ab --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,57 @@ +{ + "_meta": { + "hash": { + "sha256": "b132de3bc6e041e3fa5ab7a0feb2ee862f488ae8903790188641b70b5e595abd" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.7" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "appdirs": { + "hashes": [ + "sha256:9e5896d1372858f8dd3344faf4e5014d21849c756c8d5701f78f8a103b372d92", + "sha256:d8b24664561d0d34ddfaec54636d502d7cea6e29c3eaf68f3df6180863e2166e" + ], + "version": "==1.4.3" + }, + "attrs": { + "hashes": [ + "sha256:69c0dbf2ed392de1cb5ec704444b08a5ef81680a61cb899dc08127123af36a79", + "sha256:f0b870f674851ecbfbbbd364d6b5cbdff9dcedbc7f3f5e18a6891057f21fe399" + ], + "version": "==19.1.0" + }, + "black": { + "hashes": [ + "sha256:09a9dcb7c46ed496a9850b76e4e825d6049ecd38b611f1224857a79bd985a8cf", + "sha256:68950ffd4d9169716bcb8719a56c07a2f4485354fec061cdd5910aa07369731c" + ], + "index": "pypi", + "version": "==19.3b0" + }, + "click": { + "hashes": [ + "sha256:2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13", + "sha256:5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7" + ], + "version": "==7.0" + }, + "toml": { + "hashes": [ + "sha256:229f81c57791a41d65e399fc06bf0848bab550a9dfd5ed66df18ce5f05e73d5c", + "sha256:235682dd292d5899d361a811df37e04a8828a5b1da3115886b73cf81ebc9100e" + ], + "version": "==0.10.0" + } + }, + "develop": {} +} From 6520a6a5948bbade735ac696ac3e76b566a83daf Mon Sep 17 00:00:00 2001 From: Pierce Edmiston Date: Thu, 12 Sep 2019 17:35:55 -0500 Subject: [PATCH 3/5] Bert Barabas --- warmup.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/warmup.py b/warmup.py index ffa56d8..a104521 100644 --- a/warmup.py +++ b/warmup.py @@ -1,16 +1,8 @@ -import pathlib -import shutil -import zipfile - - -def extract_txt(zip_filename, dst_dir): - """Extract all txt files from a zip.""" - with zipfile.ZipFile(zip_filename) as zip_src: - names = [ - name for name in zip_src.namelist() - if pathlib.Path(name).suffix == ".txt" - ] - for member in names: - dst_path = pathlib.Path(dst_dir) / pathlib.Path(member).name - with zip_src.open(member) as src, open(dst_path, "wb") as dst: - shutil.copyfileobj(src, dst) \ No newline at end of file +items = [ + {"id": 33, "name": "bob"}, + {"id": 44, "name": "uncle"}, + {"id": 55, "name": "joe"}, + {"id": 66, "name": "uncle"}, +] +print(next((item for item in items if item["name"] == "uncle"), None)) +print(next((item for item in items if item["name"] == "jim"), None)) From 18474056eb0342d1f7bc8a30da1e7acf69be32b5 Mon Sep 17 00:00:00 2001 From: Pierce Edmiston Date: Thu, 12 Sep 2019 17:41:21 -0500 Subject: [PATCH 4/5] Refactor --- warmup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/warmup.py b/warmup.py index a104521..6204d2c 100644 --- a/warmup.py +++ b/warmup.py @@ -1,8 +1,11 @@ +def find_first_match(items, name, default=None): + return next((item for item in items if item["name"] == name), default) + items = [ {"id": 33, "name": "bob"}, {"id": 44, "name": "uncle"}, {"id": 55, "name": "joe"}, {"id": 66, "name": "uncle"}, ] -print(next((item for item in items if item["name"] == "uncle"), None)) -print(next((item for item in items if item["name"] == "jim"), None)) +print(find_first_match(items, "uncle")) +print(find_first_match(items, "jim")) From 30d75bb2bacc21b278a5446cd1d1be4ca908915c Mon Sep 17 00:00:00 2001 From: Pierce Edmiston Date: Thu, 10 Oct 2019 15:48:43 -0500 Subject: [PATCH 5/5] Pierce Edmiston --- Pipfile | 2 + Pipfile.lock | 170 +++++++++++++++++++++++++++++++++++++++++++++-- pizzas.zip | Bin 0 -> 619 bytes roman-candle.csv | 4 ++ warmup.py | 54 ++++++++++++--- 5 files changed, 215 insertions(+), 15 deletions(-) create mode 100644 pizzas.zip create mode 100644 roman-candle.csv diff --git a/Pipfile b/Pipfile index 61a1960..61a78f3 100644 --- a/Pipfile +++ b/Pipfile @@ -7,6 +7,8 @@ verify_ssl = true [packages] black = "*" +ipython = "*" +boto3 = "*" [requires] python_version = "3.7" diff --git a/Pipfile.lock b/Pipfile.lock index 6ba82ab..2f7cf9b 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "b132de3bc6e041e3fa5ab7a0feb2ee862f488ae8903790188641b70b5e595abd" + "sha256": "336cce4fa0ee8f327fa58d4035d890583901158b9bcfe8133d86f43d3660e16c" }, "pipfile-spec": 6, "requires": { @@ -23,12 +23,27 @@ ], "version": "==1.4.3" }, + "appnope": { + "hashes": [ + "sha256:5b26757dc6f79a3b7dc9fab95359328d5747fcb2409d331ea66d0272b90ab2a0", + "sha256:8b995ffe925347a2138d7ac0fe77155e4311a0ea6d6da4f5128fe4b3cbe5ed71" + ], + "markers": "sys_platform == 'darwin'", + "version": "==0.1.0" + }, "attrs": { "hashes": [ - "sha256:69c0dbf2ed392de1cb5ec704444b08a5ef81680a61cb899dc08127123af36a79", - "sha256:f0b870f674851ecbfbbbd364d6b5cbdff9dcedbc7f3f5e18a6891057f21fe399" + "sha256:ec20e7a4825331c1b5ebf261d111e16fa9612c1f7a5e1f884f12bd53a664dfd2", + "sha256:f913492e1663d3c36f502e5e9ba6cd13cf19d7fab50aa13239e420fef95e1396" ], - "version": "==19.1.0" + "version": "==19.2.0" + }, + "backcall": { + "hashes": [ + "sha256:38ecd85be2c1e78f77fd91700c76e14667dc21e2713b63876c0eb901196e01e4", + "sha256:bbbf4b1e5cd2bdb08f915895b51081c041bac22394fdfcfdfbe9f14b77c08bf2" + ], + "version": "==0.1.0" }, "black": { "hashes": [ @@ -38,6 +53,21 @@ "index": "pypi", "version": "==19.3b0" }, + "boto3": { + "hashes": [ + "sha256:13d90ebe4d41e1717d7cc015e983370aadba2995a2af30695f29b69f196e82fc", + "sha256:e50edae8ccb630dc1950332764c6b462a9550663a3d71c00f898280f1446f107" + ], + "index": "pypi", + "version": "==1.9.247" + }, + "botocore": { + "hashes": [ + "sha256:76ff516cfbe5c9f2ac4eb8bb5d8945bc7354d4898f2609ad32080efc9ecea751", + "sha256:fa425f3e24bb17a357a297532b253a7353a496f2be7b7a5c3fc1dd7419de259d" + ], + "version": "==1.12.247" + }, "click": { "hashes": [ "sha256:2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13", @@ -45,12 +75,144 @@ ], "version": "==7.0" }, + "decorator": { + "hashes": [ + "sha256:86156361c50488b84a3f148056ea716ca587df2f0de1d34750d35c21312725de", + "sha256:f069f3a01830ca754ba5258fde2278454a0b5b79e0d7f5c13b3b97e57d4acff6" + ], + "version": "==4.4.0" + }, + "docutils": { + "hashes": [ + "sha256:6c4f696463b79f1fb8ba0c594b63840ebd41f059e92b31957c46b74a4599b6d0", + "sha256:9e4d7ecfc600058e07ba661411a2b7de2fd0fafa17d1a7f7361cd47b1175c827", + "sha256:a2aeea129088da402665e92e0b25b04b073c04b2dce4ab65caaa38b7ce2e1a99" + ], + "version": "==0.15.2" + }, + "ipython": { + "hashes": [ + "sha256:c4ab005921641e40a68e405e286e7a1fcc464497e14d81b6914b4fd95e5dee9b", + "sha256:dd76831f065f17bddd7eaa5c781f5ea32de5ef217592cf019e34043b56895aa1" + ], + "index": "pypi", + "version": "==7.8.0" + }, + "ipython-genutils": { + "hashes": [ + "sha256:72dd37233799e619666c9f639a9da83c34013a73e8bbc79a7a6348d93c61fab8", + "sha256:eb2e116e75ecef9d4d228fdc66af54269afa26ab4463042e33785b887c628ba8" + ], + "version": "==0.2.0" + }, + "jedi": { + "hashes": [ + "sha256:786b6c3d80e2f06fd77162a07fed81b8baa22dde5d62896a790a331d6ac21a27", + "sha256:ba859c74fa3c966a22f2aeebe1b74ee27e2a462f56d3f5f7ca4a59af61bfe42e" + ], + "version": "==0.15.1" + }, + "jmespath": { + "hashes": [ + "sha256:3720a4b1bd659dd2eecad0666459b9788813e032b83e7ba58578e48254e0a0e6", + "sha256:bde2aef6f44302dfb30320115b17d030798de8c4110e28d5cf6cf91a7a31074c" + ], + "version": "==0.9.4" + }, + "parso": { + "hashes": [ + "sha256:63854233e1fadb5da97f2744b6b24346d2750b85965e7e399bec1620232797dc", + "sha256:666b0ee4a7a1220f65d367617f2cd3ffddff3e205f3f16a0284df30e774c2a9c" + ], + "version": "==0.5.1" + }, + "pexpect": { + "hashes": [ + "sha256:2094eefdfcf37a1fdbfb9aa090862c1a4878e5c7e0e7e7088bdb511c558e5cd1", + "sha256:9e2c1fd0e6ee3a49b28f95d4b33bc389c89b20af6a1255906e90ff1262ce62eb" + ], + "markers": "sys_platform != 'win32'", + "version": "==4.7.0" + }, + "pickleshare": { + "hashes": [ + "sha256:87683d47965c1da65cdacaf31c8441d12b8044cdec9aca500cd78fc2c683afca", + "sha256:9649af414d74d4df115d5d718f82acb59c9d418196b7b4290ed47a12ce62df56" + ], + "version": "==0.7.5" + }, + "prompt-toolkit": { + "hashes": [ + "sha256:46642344ce457641f28fc9d1c9ca939b63dadf8df128b86f1b9860e59c73a5e4", + "sha256:e7f8af9e3d70f514373bf41aa51bc33af12a6db3f71461ea47fea985defb2c31", + "sha256:f15af68f66e664eaa559d4ac8a928111eebd5feda0c11738b5998045224829db" + ], + "version": "==2.0.10" + }, + "ptyprocess": { + "hashes": [ + "sha256:923f299cc5ad920c68f2bc0bc98b75b9f838b93b599941a6b63ddbc2476394c0", + "sha256:d7cc528d76e76342423ca640335bd3633420dc1366f258cb31d05e865ef5ca1f" + ], + "version": "==0.6.0" + }, + "pygments": { + "hashes": [ + "sha256:71e430bc85c88a430f000ac1d9b331d2407f681d6f6aec95e8bcfbc3df5b0127", + "sha256:881c4c157e45f30af185c1ffe8d549d48ac9127433f2c380c24b84572ad66297" + ], + "version": "==2.4.2" + }, + "python-dateutil": { + "hashes": [ + "sha256:7e6584c74aeed623791615e26efd690f29817a27c73085b78e4bad02493df2fb", + "sha256:c89805f6f4d64db21ed966fda138f8a5ed7a4fdbc1a8ee329ce1b74e3c74da9e" + ], + "markers": "python_version >= '2.7'", + "version": "==2.8.0" + }, + "s3transfer": { + "hashes": [ + "sha256:6efc926738a3cd576c2a79725fed9afde92378aa5c6a957e3af010cb019fac9d", + "sha256:b780f2411b824cb541dbcd2c713d0cb61c7d1bcadae204cdddda2b35cef493ba" + ], + "version": "==0.2.1" + }, + "six": { + "hashes": [ + "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", + "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" + ], + "version": "==1.12.0" + }, "toml": { "hashes": [ "sha256:229f81c57791a41d65e399fc06bf0848bab550a9dfd5ed66df18ce5f05e73d5c", "sha256:235682dd292d5899d361a811df37e04a8828a5b1da3115886b73cf81ebc9100e" ], "version": "==0.10.0" + }, + "traitlets": { + "hashes": [ + "sha256:70b4c6a1d9019d7b4f6846832288f86998aa3b9207c6821f3578a6a6a467fe44", + "sha256:d023ee369ddd2763310e4c3eae1ff649689440d4ae59d7485eb4cfbbe3e359f7" + ], + "version": "==4.3.3" + }, + "urllib3": { + "hashes": [ + "sha256:3de946ffbed6e6746608990594d08faac602528ac7015ac28d33cee6a45b7398", + "sha256:9a107b99a5393caf59c7aa3c1249c16e6879447533d0887f4336dde834c7be86" + ], + "markers": "python_version >= '3.4'", + "version": "==1.25.6" + }, + "wcwidth": { + "hashes": [ + "sha256:3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e", + "sha256:f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c" + ], + "version": "==0.1.7" } }, "develop": {} diff --git a/pizzas.zip b/pizzas.zip new file mode 100644 index 0000000000000000000000000000000000000000..c453e47e17f5f8ba2a5b5da3da499fbb91523472 GIT binary patch literal 619 zcmWIWW@Zs#-~d9iDldNqBp|>bz)+N*o0zAYoS2uAld6|oToxL^!yq?le(Z~h^JBj; ziZGn^KI3~;Q^)s=_DP+UPqM!S(NEh zaZy7`QlMS{2Sb22JI9)@TbL|?7CHcN0MHp+V9P_%oWTinMtr=lqqBc-gg(fAMWFp4 z46+}j4ZG{5k+tc?6Y@xMf@pGjLQ=v9U!SlK{9zpd4NMaxnAHWO84G0vntw=3bTIWP zDmn(Jc^qd_5OWAV)FCk4>)iRP-Z~m5Jg=Vi)X~$__4D=g)bR}E<6zUgV_sON)A8(G zl{)hxMvz}S8?6t-0R6WC>{mu6QD%g*k;6fNfd?E4K*C{3BZ!IVat?SD1bBl?!WC`^ wlm0rk15H8-MGkl