Skip to content

Instantly share code, notes, and snippets.

@kdungs
kdungs / check.py
Last active February 21, 2016 12:42
Define a Check monad and corresponding functions in Python. Now also a repo: https://github.com/kdungs/python-mcheck
""" Define a Check monad and corresponding functions.
"""
from functools import partial
class Check:
""" This super class is not really necessary but helps make the structure
clear.
data Check a = Pass a | Fail Message
@alexpearce
alexpearce / are_nightlies_healthy.py
Created May 6, 2015 14:08
Check the status of the LHCb nightlies
#!/usr/bin/env python
from __future__ import print_function
import argparse
import os
import re
import ssl
import sys
import urllib
from xml.dom import minidom
@cgoldberg
cgoldberg / timer.py
Last active December 16, 2025 22:38
Python Timer Class - Context Manager for Timing Code Blocks
#!/usr/bin/env python
#
# Python Timer Class - Context Manager for Timing Code Blocks
# Corey Goldberg - 2012
from timeit import default_timer
class Timer(object):