Real unit test (isolation, no children render)
Calls:
- constructor
- render
#!/bin/sh | |
set -eu | |
steam_dir="$HOME/.steam" | |
proton= | |
list=false | |
eval set -- "$(getopt -o d:p:l -l directory,proton,list -- "$@")" | |
while true; do |
#!/usr/bin/env python3 | |
import socket | |
import uuid | |
import paho.mqtt.client as mqtt | |
import trio | |
client_id = 'paho-mqtt-python/issue72/' + str(uuid.uuid4()) | |
topic = client_id | |
print("Using client_id / topic: " + client_id) |
""" | |
Backport of the asyncio.runners module from Python 3.7. | |
""" | |
# Source: | |
# https://github.com/python/cpython/blob/a4afcdfa55ddffa4b9ae3b0cf101628c7bff4102/Lib/asyncio/runners.py | |
# Modifications: | |
# * removed relative imports of .coroutines, .events, .tasks | |
# * replaced `coroutines`, `events`, `tasks` with `asyncio`. | |
# * replaced `tasks.all_tasks` with `asyncio.Task.all_tasks` because it is |
""" Tested on Windows 10, 64 bit, Python 3.6 | |
Sources: | |
https://eli.thegreenplace.net/2015/redirecting-all-kinds-of-stdout-in-python/ | |
https://stackoverflow.com/questions/17942874/stdout-redirection-with-ctypes | |
""" | |
from contextlib import contextmanager | |
import ctypes | |
import io | |
import os, sys |
/** | |
* Generate a Netlify HTTP2 Server Push configuration. | |
* | |
* Options: | |
* - headersFile {string} path to the _headers file that should be generated (relative to your output dir) | |
*/ | |
function NetlifyServerPushPlugin(options) { | |
this.options = options; | |
} |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://unpkg.com/mobx@2.6.0/lib/mobx.umd.js"></script> | |
<script> | |
var MobxDemo = Object.create(HTMLElement.prototype); | |
MobxDemo.attachedCallback = function() { | |
var state = mobx.observable({ | |
counter : parseInt(this.getAttribute("counter")) | |
}) |
""" | |
twisted async/await with asyncio reactor and uvloop | |
""" | |
import asyncio | |
import uvloop | |
from asyncio.tasks import ensure_future | |
try: | |
# as per github source the asyncio reactor is intended to be released in future version |
import pandas as pd | |
def _map_to_pandas(rdds): | |
""" Needs to be here due to pickling issues """ | |
return [pd.DataFrame(list(rdds))] | |
def toPandas(df, n_partitions=None): | |
""" | |
Returns the contents of `df` as a local `pandas.DataFrame` in a speedy fashion. The DataFrame is | |
repartitioned if `n_partitions` is passed. |
import falcon | |
app = falcon.API() | |
if __name__ == '__main__': | |
from wsgiref.simple_server import make_server | |
server = make_server('localhost', 8000, app) | |
print("Listening on localhost:8000") | |
server.serve_forever() |