This file contains 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
from inspect import iscoroutinefunction, isawaitable | |
import sys | |
from collections import deque | |
# NOTE: this follows the contextlib.ExitStack implementation | |
class _BaseExitStack: | |
def __init__(self): |
This file contains 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 asyncio | |
from datetime import datetime, timezone | |
import os | |
def utc_now(): | |
# utcnow returns a naive datetime, so we have to set the timezone manually <sigh> | |
return datetime.utcnow().replace(tzinfo=timezone.utc) | |
class Terminator: | |
pass |
This file contains 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 multiprocessing | |
import setproctitle | |
import os | |
import threading | |
import tracemalloc | |
import linecache | |
import traceback | |
import gc | |
import logging |
This file contains 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
#include <unistd.h> | |
#include <sys/types.h> | |
#include <errno.h> | |
#include "zmq.h" | |
#include <stdio.h> | |
#include <sys/wait.h> | |
#include <stdlib.h> | |
#include <stdexcept> | |
#include <time.h> | |
#include <string> |
This file contains 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
#!/usr/bin/env python3.5 | |
import zmq.asyncio | |
import zmq | |
import asyncio | |
import pickle | |
import logging | |
import tempfile | |
import traceback | |
import multiprocessing |
This file contains 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 numpy as np | |
import netCDF4 | |
def reversed_list_enumerate(value: list): | |
for i in range(-1, -len(value) - 1, -1): | |
yield i, value[i] | |
def find_first(dataset, var_name, reverse: bool, ahps_to_inches: bool=False): |
This file contains 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 asyncio | |
import aiohttp.web | |
async def stream_handler(request): | |
# Without the Content-Type, most (all?) browsers will not render | |
# partially downloaded content. Note, the response type is | |
# StreamResponse not Response. | |
resp = aiohttp.web.StreamResponse(status=200, | |
reason='OK', | |
headers={'Content-Type': 'text/html'}) |
This file contains 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 asynctest | |
import asyncio | |
import logging | |
from collections import deque | |
class RateLimiter: | |
class Error(Exception): | |
pass |
This file contains 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 wrapt | |
from aws_xray_sdk.core import xray_recorder | |
from aws_xray_sdk.core.models import http | |
from aws_xray_sdk.ext.util import inject_trace_header | |
import ssl | |
_XRAY_PROP = '_xray_prop' |
This file contains 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 asyncio | |
import functools | |
import logging | |
import os | |
import threading | |
import socket | |
import http.server | |
from typing import Dict, Any, Optional | |
# Third Party |
OlderNewer