Skip to content

Instantly share code, notes, and snippets.

import pytest
class IntervalMap:
def __init__(self):
self.limits = []
self.map = {}
def __setitem__(self, upper_bound, value):
self.limits.append(upper_bound)
import pytest
class IntervalMap:
def __init__(self):
self.limits = []
self.map = {}
def __setitem__(self, upper_bound, value):
self.limits.append(upper_bound)
from itertools import zip_longest
class Bits(bytes):
CHUNK = 8
def __new__(cls, n):
return super().__new__(cls, cls.number_to_bits(n))
@staticmethod
"""Geometry"""
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def __eq__(self, other):
return self.x == other.x and self.y == other.y