I hereby claim:
- I am sethmlarson on github.
- I am sethmlarson (https://keybase.io/sethmlarson) on keybase.
- I have a public key whose fingerprint is EDD5 6765 A9D8 4653 CBC8 A134 51B0 6736 1740 F5FC
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
""" | |
Code that reproduces Yahoo's HTTP/2 issue. | |
Requires you to run `python -m pip install h2` before executing. | |
Example output: | |
``` | |
Testing 'google.com' with 'send_unknown_setting=False'... | |
Result: <ResponseReceived stream_id:1, headers:[(b':status', b'301'), (b'location', b... |
Python Version | # of Downloads | % of 2.7.x Downloads | % of All Downloads |
---|---|---|---|
<2.7.9 | 133029 | 11.84% | 4.06% |
>=2.7.9 | 990229 | 88.16% | 30.21% |
2.7.x | 1123258 | 100% | 34.27% |
All | 3277817 | N/A | 100% |
"""JSON serializer for Elasticsearch Python client that | |
uses the 'orjson' library for performance. | |
https://github.com/ijl/orjson | |
""" | |
# Implement the Serializer.loads() and .dumps() APIs w/ orjson: | |
import orjson | |
from elasticsearch import SerializationError, JSONSerializer |
Attesting that I was watching and listening to the live stream of the ceremony on Youtube for the entire duration of the broadcast without interruption. Notes were taken as I went with a stopwatch keeping track of relative timestamps from the start of the ceremony.
All times are of my viewing of the ceremony, not necessarily as the ceremony actually occurred due to delay between real events and the stream.
import inspect | |
import sys | |
from pathlib import Path | |
def warn_stacklevel() -> int: | |
"""Dynamically determine stacklevel for warnings based on the call stack""" | |
try: | |
# Grab the root module from the current module '__name__' | |
module_name = __name__.partition(".")[0] |
diff --git a/setup.py b/setup.py | |
index f804932..12ae724 100644 | |
--- a/setup.py | |
+++ b/setup.py | |
@@ -1,11 +1,43 @@ | |
#!/usr/bin/env python | |
+import platform | |
+import sys | |
from setuptools import find_packages, setup | |
+from setuptools.command.build_ext import build_ext |
import asyncio as A,urllib.parse as U,re;B,C,I,S=b"",b"\r\n",int,lambda*A:re.match(*A,24).groups() | |
async def request(m,u,h,b): | |
s,_,a,_,q,_=z=U.urlparse(u);T,E,d,N=s!=b"http",0,B,z.hostname;r,w=await A.open_connection(N,I(z.port or 80+363*T),ssl=T,server_hostname=[None,N][T]);w.write(m+b" "+(a or b"/")+[b"?"+q,B][q==B]+b" HTTP/1.0"+C+C.join([b"%b:%b"%W for W in h]+[B,b]));await w.drain() | |
while c:=await r.read(): | |
if C*2in(d:=d+c)*(E==0):E,d=d.split(C*2,1);t,o=S(b"HTTP/.+? (\d+).*?%b(.*)"%C,E);o=[S(rb"([^\s]+):\s*(.+?)\s*$",x)for x in o.split(C)] | |
w.close();return I(t),o,d |
import ssl | |
import requests | |
from requests.adapters import HTTPAdapter | |
import truststore | |
class TruststoreAdapter(HTTPAdapter): | |
def init_poolmanager( | |
self, *args, **kwargs | |
): | |
ctx = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT) |