italic bold bold and italic
- Numbered List
- With more items
- Sub lists are indented
import math | |
import tidal | |
import utime | |
tidal.enable_peripheral_I2C() | |
from tidal import i2c, i2cp | |
class RAMBlockDev: | |
def __init__(self, block_size, num_blocks): |
// Compiled result | |
:root { | |
--colour-soft1-0: #eadbea; | |
--colour-soft1-25: #efe4ef; | |
--colour-soft1-50: #f5edf5; | |
--colour-soft1-75: #faf6fa; | |
--colour-soft2-0: #ead2d5; | |
--colour-soft2-25: #efdde0; | |
--colour-soft2-50: #f5e9ea; |
import argparse | |
import os | |
import re | |
import subprocess | |
import tempfile | |
import requests | |
def get_repo(owner, repo): |
import typing as t | |
T_iter = t.TypeVar("T_iter") | |
def which_is_last(data: t.Iterable[T_iter]) -> t.Iterator[t.Tuple[T_iter, bool]]: | |
"""Given an iterable, return an iterable of value, bool pairs | |
where the bool is True iff this is the last item.""" | |
last_found: T_iter | |
has_value = False |
import fractions | |
for num_pads in range(15): | |
options = {num_pads: fractions.Fraction(1)} | |
for pad in range(num_pads-1, 0, -1): | |
free_pads = [p for p in range(num_pads+1) if p > pad] | |
path_lengths = [] | |
for free_pad in free_pads: | |
path_lengths.append(options[free_pad] + 1) | |
options[pad] = sum(path_lengths) / len(path_lengths) |
from contextlib import contextmanager | |
import tempfile | |
from unittest import mock | |
import factory | |
import pytest | |
from betterevidence import models | |
from __future__ import print_function | |
import argparse | |
import json | |
import operator | |
import pprint | |
def sort_key(value): | |
player_id, payoff = value | |
return int(player_id) |
# ZODB recovery script that 'rebases' transactions onto an older copy of the same | |
# FileStorage. This is useful in the case where a FileStorage is lightly corrupted | |
# but that is not detected and it remains in production, garnering new transactions. | |
# | |
# The corruption in the storage may have prevented various transactions for completing | |
# and prevents packing or incremental backups, so backup taken before the corruption | |
# happened is used as a graft for the newer transactions. This only works if all | |
# the corruption happens to transactions covered by the backup, corruption that affects | |
# the transactions being appended is not recoverable in this fashion. | |
# |
import sys | |
filename = sys.argv[1] | |
import csv | |
import StringIO | |
import subprocess | |
import zipfile | |
data = zipfile.ZipFile(filename, mode='r') | |
info_file = data.open('data/info.csv') |