This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| import json | |
| import types | |
| from traceback import format_tb | |
| from simplegeneric import generic | |
| @generic | |
| def encode_log_record(obj): | |
| return repr(obj) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ python compare.py customers.csv orders.csv | |
| 1711 out of 7067 order customer ids are missing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import logging | |
| logging.basicConfig() | |
| def gen(): | |
| yield "this" | |
| yield "that" | |
| requests.put('http://httpbin.org/put', data=gen()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (reconf)LM-sjn-00874409:reconf gsbrown$ vi setup.py │ | |
| (reconf)LM-sjn-00874409:reconf gsbrown$ │ | |
| import os | |
| import tarfile | |
| import time | |
| from io import BytesIO | |
| def copyfileobj(fsrc, fdst, length=16*1024): | |
| size = 0L |