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 |
import asyncio | |
from functools import wraps, partial | |
def run_in_executor(fn=None, *, executor=None): | |
"""Make a sync function async. By default uses ThreadPoolExecutor. | |
Args: | |
fn: Function to decorate. | |
executor: Executor pool to execute fn in. |
package main | |
import ( | |
"flockexper/lock" | |
"fmt" | |
"io/ioutil" | |
"os" | |
"path/filepath" | |
"sync" | |
"time" |
#!/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/[email protected]/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 |