Skip to content

Instantly share code, notes, and snippets.

View phe_query.py
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
View conda-conflicts-output.txt
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 \
View new.py
import concurrent.futures
import json
import requests
from datetime import datetime
from pathlib import Path
import pandas as pd
from tqdm.notebook import tqdm
View docs.rst

Configuration

Lorum ipsum gooble gabble

View pyproject.toml
[tool.poetry]
name = "ansible-config"
version = "0.1.0"
description = ""
authors = ["Chris Withers <chris@simplistix.co.uk>"]
[tool.poetry.dependencies]
python = "^3.7"
ansible = "^2.8"
jinja2 = "^2.10"
View python.wut
>>> 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'
View switch-y thing in python
switch = Switch({
'foo': lambda x: x+1,
})
switch['foo']('bar')
switch = Switch()
@switch.handles('foo')
View meta.yaml
{% set data = load_setup_py_data() %}
package:
name: "{{ data['name'] }}"
version: "{{ data['version'] }}"
source:
path: .
build:
View gist:82b8047e804a13dec35fb44b227a9703
__________________ ERROR at setup of fail.rst line=1 column=1 __________________
self = <FixtureRequest for <SybilItem 'line:1,column:1'>>
fixturedef = <FixtureDef name='session_fixture' scope='session' baseid='' >
def _getfixturevalue(self, fixturedef):
# prepare a subrequest object before calling fixture function
# (latter managed by fixturedef)
argname = fixturedef.argname
funcitem = self._pyfuncitem
View stuff.py
from collections import defaultdict
import re
order = 'ID', 'GE', 'FN', 'LN','MN', 'EM', 'ST'
MAX_NUM = int(input ("Please enter the number of records: "))
records = []
while len(records) < MAX_NUM:
new_records = input("Please enter some records separated by ';' or '!': ")
for record in re.split('[!;]', new_records):