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 ssl | |
| from socketserver import TCPServer, ThreadingMixIn, StreamRequestHandler | |
| class MySSL_TCPServer(TCPServer): | |
| def __init__(self, server_address, RequestHandlerClass): | |
| TCPServer.__init__(self, server_address, RequestHandlerClass, True) | |
| self.context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) | |
| self.context.load_cert_chain( |
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
| SELECT EXTRACT(WEEK FROM download_time), python_type, COUNT(*) | |
| FROM ( | |
| SELECT python_type, download_time | |
| FROM downloads | |
| WHERE installer_type = 'pip' AND installer_version != '' | |
| ) AS d | |
| GROUP BY EXTRACT(WEEK FROM download_time), python_type | |
| ORDER BY EXTRACT(WEEK FROM download_time), python_type, COUNT(*); | |
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
| {u'able_to_detect_n_minus_one_splitting': False, | |
| u'beast_vuln': False, | |
| u'ephemeral_keys_supported': True, | |
| u'given_cipher_suites': [u'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384', | |
| u'TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384', | |
| u'TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384', | |
| u'TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384', | |
| u'TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA', | |
| u'TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA', | |
| u'TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA', |
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
| #!/bin/bash | |
| set -x | |
| mkdir -p foo/bar | |
| mkdir -p foo/win | |
| touch foo/bar/PKG-INFO | |
| touch foo/win/a.py | |
| tree foo |
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
| #!/Users/dstufft/.pyenv/versions/3.4.0rc3/bin/python3.4 | |
| # -*- coding: utf-8 -*- | |
| import re | |
| import sys | |
| from pip import main | |
| if __name__ == '__main__': | |
| sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) |
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
| # Number 1 | |
| def application(environ, start_response): | |
| # forget about start_response right now | |
| return ["body"] | |
| # Number 2 | |
| import asyncio | |
| @asyncio.coroutine | |
| def compute(x, y): |
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
| driver = Provider(....) | |
| # \/ Only accesses Container.name, which is "container-name" | |
| driver.upload(data, Container("container-name", None, driver), "object-name") |
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
| $ rm -rf .testrepository | |
| .testrepository/0 | |
| .testrepository/format | |
| .testrepository/next-stream | |
| .testrepository/times.dbm | |
| .testrepository | |
| $ tox -e py26 | |
| GLOB sdist-make: /Users/dstufft/projects/barbican/setup.py | |
| py26 inst-nodeps: /Users/dstufft/projects/barbican/.tox/dist/barbican-2014.1.dev1.gdbcc1d9.zip | |
| py26 runtests: PYTHONHASHSEED='547984020' |
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
| def foo(thing): | |
| if thing is None: | |
| self._do_thing_none() | |
| else: | |
| self._do_thing(thing) |
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
| pip install python-barbicanclient (pip) | |
| Downloading/unpacking python-barbicanclient | |
| Downloading python-barbicanclient-2.1.0.tar.gz (41kB): 41kB downloaded | |
| Storing download in cache at /Users/dstufft/.pip/cache/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fp%2Fpython-barbicanclient%2Fpython-barbicanclient-2.1.0.tar.gz | |
| Running setup.py (path:/Users/dstufft/.virtualenvs/pip/build/python-barbicanclient/setup.py) egg_info for package python-barbicanclient | |
| Traceback (most recent call last): | |
| File "<string>", line 26, in <module> | |
| File "/Users/dstufft/.virtualenvs/pip/build/python-barbicanclient/setup.py", line 23, in <module> | |
| pbr=True, | |
| File "/Users/dstufft/projects/pip/pip/hacks/setuptools.py", line 6, in setup |