I hereby claim:
- I am binarydud on github.
- I am mattg (https://keybase.io/mattg) on keybase.
- I have a public key whose fingerprint is 84F7 580E 24CE 33D1 8B49 2F29 DC60 0858 4A6F 5CB2
To claim this, I am signing this object:
from cornice.resource import resource | |
def dbresource(**kw): | |
"""Class decorator to declare CRUD classes. | |
""" | |
def wrapper(klass): | |
setattr(klass, kw.pop('mapping')) | |
setattr(klass, kw.pop('session')) | |
setattr(klass, kw.pop('match_key', 'id')) | |
setattr(klass, kw.pop('primary_key', 'id')) |
@view_config(route_name='my-route') | |
def my_view(request): | |
# here i want to know if path-1 or path-2 was taken, preferably via a var n matchdict? | |
if request.matched_route.name == 'my-route2': | |
# do extra work | |
config.add_route('my-route', '/path-1/view') | |
config.add_route('my-route2', '/path-2/view') |
class AccountEvent(object): | |
def __init__(self, request, user): | |
self.user = user | |
self.request = request | |
class SignupEvent(AccountEvent): | |
pass | |
class LoginEvent(AccountEvent): | |
pass |
import collections | |
def extract_top_ten(str): | |
return collections.Counter(str.split()).most_common(10) |
import requests | |
parts = { | |
'GRAY': 'ME344LL/A', | |
'SILVER': 'ME345LL/A' | |
} | |
url_template = 'http://store.apple.com/us/retail/availabilitySearch?parts.0={}&zip={}' | |
def send_notice(): | |
pass |
from .base import AbstractTariff | |
from .us import USTariff | |
from .ca import CATariff | |
def factory(name): | |
mod = sys.modules[__name__] | |
classname = '{}Tariff'.format(name) | |
return getattr(mod, classname, None) | |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/python | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
# The author disclaims copyright to this source code. | |
# Quickly and dirtily modified by Mustafa Al-Bassam ([email protected]) to test | |
# the Alexa top X. | |
# Modified by Matt George (mgeorge@gmail) to test arbitrary domains |
I hereby claim:
To claim this, I am signing this object:
from hypothesis.testdecorators import given | |
def me(x,y): | |
if x < y: | |
raise Exception('this is an error') | |
return True | |
def test_answer(): | |
assert me(5,3) == True | |
@given(int, int) |