This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def citations(text): | |
rgx = u'(\\d+)\\s+U\\.?S\\.?C\\.?\\s*\xa7*\\s\\s*([\\d\\w\\-\\\u2013\\.\u2013]+)(\\([\\d\\w\\-\\\u2013\\.\u2013()]+\\))*' | |
matches = [] | |
for match in re.finditer(rgx, text): | |
title, section, path = match.groups() | |
section = section.strip(u'\u2013.- ') | |
start, end = match.span() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
usc25.xml: | |
- The xml for /us/usc/t25/s450l (Contract or grant specifications) contains a model agreement with its own internal | |
Thom Neale <twneale@gmail.com> | |
Apr 13 | |
to Katherine | |
Hi Katherine, please forgive the earlier email fragment; I accidentally sent if before I was done typing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[('/us/usc/t21/s812/b/1', 4), | |
('/us/usc/t21/s812/b/4', 4), | |
('/us/usc/t21/s812/b/5', 4), | |
('/us/usc/t21/s812/b/2', 4), | |
('/us/usc/t21/s812/a', 4), | |
('/us/usc/t21/s812/b', 4), | |
('/us/usc/t21/s812/b/3', 4), | |
('/us/usc/t21/s812/c', 4), | |
('/us/usc/t42/s14214/d/10', 3), | |
('/us/usc/t21/s812/a/1', 3), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Any person violating any provision of subsection | |
1-2.6 | |
shall be punished by a fine not exceeding twenty ($20.00) dollars for each offense, and not only the | |
The provisions of subsection | |
2-12.3 | |
to the contrary notwithstanding, this ordinance shall be published by the action of the City Council | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
''' | |
Usage: | |
>>> f = open('usc08.10') | |
>>> x = getlines(f) | |
>>> x.next() | |
GPOLocatorLine(code='F', arg='5800', data=u'\r\n') | |
>>> print x.next().data | |
TITLE 8–ALIENS AND NATIONALITY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Simple async crawler/callback queue based on gevent.""" | |
import traceback | |
import logging | |
import httplib2 | |
import gevent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install openjdk-6-jre-headless | |
curl -O http://dist.neo4j.org/neo4j-community-1.5.M02-unix.tar.gz | |
tar -xf neo4j-community-1.5.M02-unix.tar.gz | |
rm neo4j-community-1.5.M02-unix.tar.gz | |
neo4j-community-1.5.M02/bin/neo4j start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{'email': u'twneale@gmail.com', | |
'interests': [{'active': False, | |
'changed_at': datetime.datetime(2012, 11, 16, 21, 16, 33, 661000), | |
'filters': {'state': u'CA'}, | |
'in': u'rent', | |
'interest_type': 'search', | |
'query_type': 'advanced', | |
'search_type': 'state_bills'}], | |
'notifications': 'email_daily', | |
'secret_key': 'openstates-scout-staging', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{u'actions': {u'added': 5, u'removed': 0}, | |
u'user': {u'_id': u'50d34ac74a4ee9b329000001', | |
u'email': u'twneale@gmail.com', | |
u'interests': [{u'_id': u'50d3512c4a4ee90c4d000004', | |
u'created_at': u'2012-12-20T12:55:58-05:00', | |
u'filters': {u'state': u'CA'}, | |
u'in': u'rent', | |
u'interest_type': u'search', | |
u'query_type': u'advanced', | |
u'updated_at': u'2012-12-20T12:55:58-05:00'}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{u'email': u'twneale@gmail.com', | |
u'interests': [{u'active': False, | |
u'changed_at': 1353100593.0, | |
u'filters': {u'state': u'CA'}, | |
u'in': u'rent', | |
u'interest_type': u'search', | |
u'query_type': u'advanced', | |
u'search_type': u'state_bills'}, | |
{u'active': True, | |
u'changed_at': 1353338983.0, |
OlderNewer