Skip to content

Instantly share code, notes, and snippets.

switch = Switch({
'foo': lambda x: x+1,
})
switch['foo']('bar')
switch = Switch()
@switch.handles('foo')
>>> class Wut(object):
... __slots__ = ('a',)
...
>>> Wut()
<__main__.Wut object at 0x7ffff7f55b40>
>>> Wut().b = 1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Wut' object has no attribute 'b'
[tool.poetry]
name = "ansible-config"
version = "0.1.0"
description = ""
authors = ["Chris Withers <[email protected]>"]
[tool.poetry.dependencies]
python = "^3.7"
ansible = "^2.8"
jinja2 = "^2.10"

Configuration

Lorum ipsum gooble gabble

import concurrent.futures
import json
import requests
from datetime import datetime
from pathlib import Path
import pandas as pd
from tqdm.notebook import tqdm
chris@zuul:~$ time /opt/conda/bin/conda env create -p /home/chris/moneybox/env --file /home/chris/moneybox/environment.lock.yaml --force
Collecting package metadata (repodata.json): done
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed /
Solving environment: \
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed \
import concurrent.futures
import json
import requests
from datetime import datetime, timedelta
from pathlib import Path
import matplotlib.pyplot as plt
import pandas as pd
@cjw296
cjw296 / datetime_range.py
Last active July 12, 2021 08:02
pd.date_range for 9am each day between two pd.Timestamp objects
import unittest
from datetime import time
from typing import Callable, Iterable
import pandas as pd
from pandas._libs.tslibs import to_offset
class Tests: