Skip to content

Instantly share code, notes, and snippets.

View Julian's full-sized avatar

Julian Berman Julian

View GitHub Profile
def extend_with_default(validator_class):
validate_properties = validator_class.VALIDATORS["properties"]
def set_defaults(validator, properties, instance, schema):
for error in validate_properties(
validator, properties, instance, schema,
):
yield error
for property, subschema in properties.items():
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Lean
file_extensions:
- lean
scope: source.lean
contexts:
main:
- include: comments
from hypothesis import find, strategies
def check(x):
if x+1 is 1+x:
return False
if x+2 is not 2+x:
return False
return True
from collections import defaultdict
from datetime import datetime, timedelta
from decimal import Decimal
from pprint import pformat, pprint
import json
import boto3
import requests
with requests.get("http://www.ec2instances.info/instances.json") as response:

Keybase proof

I hereby claim:

  • I am Julian on github.
  • I am Julian (https://keybase.io/Julian) on keybase.
  • I have a public key whose fingerprint is FC33 5F6C C08E 36DB A6C1 44E2 5574 E672 CDC2 228C

To claim this, I am signing this object:

import itertools
class PersistentList(object):
BIT_WIDTH = 5 # number of bits to access each level
def __init__(self, contents=()):
root = self._contents = []
tail = self._tail = []
@Julian
Julian / divide.py
Created March 24, 2013 06:13
Iterator Partitioning
import collections
class Divide(object):
def __init__(self, iterable, key=None):
self._buffer = collections.defaultdict(collections.deque)
self._key = key
self._iterable = iter(iterable)
def __getitem__(self, item):