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
$ python broken.py | |
speeches/fixtures/expected_outputs/mp3/lamb_first_three_seconds.mp3 | |
[Binary data] | |
Output #0, s16le, to 'pipe:': | |
Metadata: | |
encoder : Lavf55.19.104 | |
Stream #0:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s | |
Stream mapping: | |
Stream #0:0 -> #0:0 (mp3 -> pcm_s16le) |
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 urllib | |
from lxml import etree | |
parl_members_xml = etree.parse(urllib.urlopen('http://data.parliament.uk/membersdataplatform/services/mnis/members/query/House=Commons%7CIsEligible=true/')) | |
parl_members = parl_members_xml.getroot() | |
print etree.tostring(parl_members.find('Member[@Member_Id="638"]')) | |
for member in parl_members: | |
if member.attrib['Member_Id'] == '638': |
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
Hanukah | |
[...] | |
1902-12-24 | |
1905-12-22 | |
1908-12-18 | |
1910-12-25 | |
1913-12-23 | |
1916-12-19 | |
1921-12-25 | |
1924-12-21 |
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 argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('args', nargs='*') # from __init__.py execute() | |
parser.add_argument('args', nargs='+') # from base.py LabelCommand add_arguments | |
print parser.parse_args(['foo1', 'foo2', 'foo3', 'foo4']) | |
# Outputs Namespace(args=['foo4']) |
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
PID = 'b04drklx' | |
for date in arrow.Arrow.range('day', arrow.now(), arrow.now().replace(weeks=1)): | |
soup = BeautifulSoup(get_contents('http://www.bbc.co.uk/cbeebies/programmes/schedules/%s' % date.format('YYYY/MM/DD'))) | |
for series in soup.findAll('span', resource=re.compile(PID)): | |
root = series.findParents(typeof="BroadcastEvent")[0] | |
season = root.find(typeof='TVSeason') | |
start_time = root.find(property='startDate')['content'] | |
title = season.nextSibling.string | |
series_num = season.find(property='name').string | |
episode_num = root.find('abbr').find(property='position').string |
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 | |
import socket | |
import signal | |
import sys | |
import threading | |
def sigint_received(signum, frame): | |
sys.exit(0) | |
signal.signal(signal.SIGINT, sigint_received) |
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 | |
import os | |
import re | |
import requests | |
s = requests.Session() | |
class ThreeWebsite(object): | |
username = os.environ['PHONE_NUMBER'] |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
gss | govuk_slug | homepage_url | |
---|---|---|---|
S12000033 | aberdeen | http://www.aberdeencity.gov.uk/ | |
S12000034 | aberdeenshire | http://www.aberdeenshire.gov.uk/ | |
E07000223 | adur | http://www.adur-worthing.gov.uk/ | |
E07000026 | allerdale | http://www.allerdale.gov.uk | |
E07000032 | amber-valley | http://www.ambervalley.gov.uk/ | |
S12000041 | angus | http://www.angus.gov.uk | |
N09000001 | antrim-newtownabbey | http://www.antrimandnewtownabbey.gov.uk | |
N09000011 | ards-and-north-down | http://www.ardsandnorthdown.gov.uk | |
S12000035 | argyll-and-bute | http://www.argyll-bute.gov.uk |
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
TheyWorkForYou person ID | beta.parliament person ID | beta.parliament photo ID | |
---|---|---|---|
24769 | http://id.ukpds.org/2PbBvbwn | http://id.ukpds.org/cu8BXNWP | |
24934 | http://id.ukpds.org/6jaB1p3Z | ||
24825 | http://id.ukpds.org/Ck8wwcfN | http://id.ukpds.org/8IaGHQzb | |
11626 | http://id.ukpds.org/eieTmLXh | http://id.ukpds.org/cs77uhlV | |
25304 | http://id.ukpds.org/gE4aCnm0 | ||
10084 | http://id.ukpds.org/jV72kIxb | http://id.ukpds.org/yBBERkOB | |
10383 | http://id.ukpds.org/dVovQSbU | ||
11943 | http://id.ukpds.org/tJDr7qN7 | ||
25654 | http://id.ukpds.org/DJ4HErt4 | http://id.ukpds.org/QfjSFljl |