Skip to content

Instantly share code, notes, and snippets.

@contextmanager
def modified_environ(**overlay):
"""
XXX FIXME
>>> ...
"""
def _update_environ(d):
for k, v in d.items():
yield k, os.environ.pop(k, None)
from itertools import chain, starmap
from shlex import quote as shquote
from typing import Dict, Union
flatten = chain.from_iterable
def augur_options(opts: Dict[str, Union[str, list, None]]) -> str:
"""
Converts a dictionary of command-line config options to a string suitable
from typing import Dict, Union
from shlex import quote as shquote, split as shsplitwords
def shquotewords(s: str) -> str:
"""
Split string *s* into (POSIX) shell words, quote each word, and join them
back into a string.
This is suitable for properly quoting multi-word, user-defined values which
from typing import Dict, Union
from shlex import quote as shquote, split as shsplitwords
def shquotewords(s: str) -> str:
"""
Split string *s* into (POSIX) shell words, quote each word, and join them
back into a string.
This is suitable for properly quoting multi-word, user-defined values which
should follow shell quoting and escaping semantics (e.g. to allow spaces in
~/nextstrain/all/mers-beast-tutorial ~/nextstrain/all ~/nextstrain/all
~/nextstrain/all/documentation ~/nextstrain/all ~/nextstrain/all
~/nextstrain/all/phyloTree ~/nextstrain/all ~/nextstrain/all
~/nextstrain/all/react-sidebar ~/nextstrain/all ~/nextstrain/all
~/nextstrain/all/auctor ~/nextstrain/all ~/nextstrain/all
~/nextstrain/all/sphinx-theme ~/nextstrain/all ~/nextstrain/all
~/nextstrain/all/forecasts-ncov ~/nextstrain/all ~/nextstrain/all
~/nextstrain/all/sacra ~/nextstrain/all ~/nextstrain/all
~/nextstrain/all/mumps ~/nextstrain/all ~/nextstrain/all
~/nextstrain/all/project-board ~/nextstrain/all ~/nextstrain/all
336 23:16:13.793490 execve("/usr/local/bin/keep-header", ["keep-header", "/nextstrain/augur/tests/data/cla"..., "--", "cat"], 0xffffe2014b50 /* 15 vars */) = 0
336 23:16:13.796029 mmap(NULL, 344, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xffff9e21a000
336 23:16:13.796925 set_tid_address(0x4ed240) = 336
336 23:16:13.797856 brk(NULL) = 0x291e3000
336 23:16:13.798676 brk(0x291e5000) = 0x291e5000
336 23:16:13.799447 mmap(0x291e3000, 4096, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x291e3000
336 23:16:13.800253 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xffff9e219000
336 23:16:13.801241 rt_sigprocmask(SIG_SETMASK, ~[ILL FPE SEGV RTMIN RT_1 RT_2], [], 8) = 0
336 23:16:13.802083 rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 8) = 0
336 23:16:13.802898 mmap(NULL, 143360, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xffff9e1f6000
#!/bin/bash
set -euo pipefail
group="${1:?usage: $(basename "$0") <group-name>}"
echo "# $group group"
echo
for role in owners editors viewers; do
echo "# $role"
aws cognito-idp list-users-in-group \
@tsibley
tsibley / x.md
Last active November 17, 2022 23:52
markdown parsing tests

Nextstrain logo Nextstrain logo Nextstrain logo Nextstrain logo

{"filename": "guides/communicate/create-pdf.md", "lineno": 61, "status": "unchecked", "code": 0, "uri": "", "info": ""}
{"filename": "install.rst", "lineno": 24, "status": "unchecked", "code": 0, "uri": "#choosing-a-runtime", "info": ""}
{"filename": "guides/share/groups/migrate-from-s3.rst", "lineno": 98, "status": "unchecked", "code": 0, "uri": "#group-customization", "info": ""}
{"filename": "guides/share/groups/customize.rst", "lineno": 12, "status": "unchecked", "code": 0, "uri": "#groups-roles", "info": ""}
{"filename": "learn/parts.rst", "lineno": 5, "status": "unchecked", "code": 0, "uri": "#term-Augur", "info": ""}
{"filename": "learn/parts.rst", "lineno": 5, "status": "unchecked", "code": 0, "uri": "#term-Auspice", "info": ""}
{"filename": "learn/parts.rst", "lineno": 82, "status": "unchecked", "code": 0, "uri": "#term-JSONs", "info": ""}
{"filename": "learn/parts.rst", "lineno": 234, "status": "unchecked", "code": 0, "uri": "#term-Nextstrain-CLI", "info": ""}
{"filename": "guides/share/groups/custo