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
from xml import sax | |
class XMLParser(sax.handler.ContentHandler): | |
def __init__(self, keys=[], lists=[], *args, **kwargs): | |
""" | |
:param keys: list of data keys have to be available in data | |
:param lists: list of nodes have be represented as list |
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
""" | |
Search bebop series. | |
""" | |
import arrow | |
import json | |
from tornado import options | |
from tornado.httpclient import HTTPError, HTTPClient, HTTPRequest | |
from tornado_botocore import Botocore | |
from tvs import TVS |
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 -*- | |
TVS = [{ | |
'number': 1, | |
'title': 'Asteroid Blues', | |
'airdate': 'October 24, 1998', | |
'genre': ['anime', 'action'], | |
'content': """In a flashback, Spike Spiegel is shown waiting near a church holding a bouquet of flowers, before leaving as the church bell rings. As he walks away, images of a gunfight he participated in are shown. In the present, Spike, currently a bounty hunter, and his partner Jet Black head to the Tijuana asteroid colony on their ship, the Bebop, to track down a bounty-head named Asimov Solensan. Asimov is wanted for killing members of his own crime syndicate and for stealing a cache of a dangerous combat drug known as Bloody-Eye. On the colony, Asimov and his girlfriend, Katerina, are ambushed at a bar by his former syndicate while attempting to sell a vial of Bloody-Eye, but Asimov manages to fight his way out by using the drug himself. Spike later encounters Katerina and reveals to her that he is a bounty hunter searching for Asimov; Spike is prompt |
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 os.path | |
import sqlite3 | |
import redis | |
import time | |
import uuid | |
class RedisSearch(object): | |
@property |
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 botocore.session | |
import logging | |
import re | |
import six | |
from functools import partial | |
logger = logging.getLogger() |
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
from email.mime.application import MIMEApplication | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
import botocore.session | |
if __name__ == '__main__': | |
session = botocore.session.get_session() | |
ses = session.get_service('ses') |
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
""" | |
This code has been written just for fun, it is slow and may produce inaccurate results. | |
The idea was to transition from mathematics to an algorithm. | |
""" | |
import binascii | |
import hashlib | |
import itertools |
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 struct | |
class Miner(): | |
def __init__(self, previous_hash, transactions_hash, timestamp, bits, nonces): | |
self.previous_hash = previous_hash | |
self.transactions_hash = transactions_hash | |
self.timestamp = timestamp | |
self.bits = bits |
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
svg = """ | |
<path d="M 680.40768,58.690197 C 680.17329,58.760524 680.10297,59.018351 680.22018,59.440197 C 680.47016,59.783987 680.47015,61.533977 680.18893,64.690197 C 677.50142,64.783977 674.53266,64.752738 671.31393,64.627697 L 671.12643,64.721447 C 671.22017,65.971477 671.28266,67.346466 671.31393,68.846447 C 674.40767,68.721467 677.28265,68.596477 679.90768,68.440197 C 679.78267,70.752727 679.72015,73.377716 679.75143,76.346447 C 677.90766,77.158957 676.28265,78.190218 674.84518,79.440197 C 673.40767,80.690217 672.22016,82.221457 671.31393,84.033947 C 670.43892,85.815207 670.06391,87.783957 670.15768,89.940197 C 670.25143,92.065207 670.78266,93.752697 671.75143,94.971447 C 672.75142,96.158947 674.06391,96.846447 675.72018,97.065197 C 677.37641,97.315197 678.9389,97.096447 680.37643,96.377697 C 681.81391,95.690197 682.90764,95.065197 683.65768,94.533947 L 684.25143,96.033947 C 686.31391,94.908947 687.81389,94.221447 688.72018,93.940197 L 688.75143,93.408947 C 688.28265,92.565197 687.84514,91.752697 687.4389 |
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
from threading import Lock | |
from botocore.endpoint import Endpoint | |
import botocore.session | |
import treq | |
__all__ = ('AWSClient',) | |
OlderNewer