IAM Policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1517398919242",| """This is not the full code. We do a lot of stuff to clean up connections, particularly for unit testing.""" | |
| import sqlalchemy | |
| from sqlalchemy.orm import Query, Session, scoped_session, sessionmaker | |
| CONFIG_KEY_SQLALCHEMY_BINDS = 'SQLALCHEMY_BINDS' | |
| CONFIG_KEY_SQLALCHEMY_RO_BINDS = 'SQLALCHEMY_READ_ONLY_BINDS' | |
| class Config: | |
| # These default values are for testing. In a deployed environment, they would be three separate instances. | |
| SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/branded_dev' |
| import random | |
| import math | |
| import timeit | |
| import matplotlib.pyplot as plt | |
| timeBubble = [] | |
| timeSelection = [] | |
| timeInsertion = [] | |
| timeQuick = [] | |
| timeMerge = [] |
| # Enter your code here. Read input from STDIN. Print output to STDOUT | |
| class Node: | |
| def __init__(self,value,point): | |
| self.value = value | |
| self.point = point | |
| self.parent = None | |
| self.H = 0 | |
| self.G = 0 | |
| def move_cost(self,other): | |
| return 0 if self.value == '.' else 1 |
| # Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail | |
| # Make sure you have IMAP enabled in your gmail settings. | |
| # Right now it won't download same file name twice even if their contents are different. | |
| import email | |
| import getpass, imaplib | |
| import os | |
| import sys | |
| detach_dir = '.' |
| import urllib2 | |
| from multiprocessing.dummy import Pool as ThreadPool | |
| urls = [ | |
| 'http://www.python.org', | |
| 'http://www.python.org/about/', | |
| 'http://www.onlamp.com/pub/a/python/2003/04/17/metaclasses.html', | |
| 'http://www.python.org/doc/', | |
| 'http://www.python.org/download/', | |
| 'http://www.python.org/getit/', |
| from numpy import exp, array, random, dot | |
| class NeuronLayer(): | |
| def __init__(self, number_of_neurons, number_of_inputs_per_neuron): | |
| self.synaptic_weights = 2 * random.random((number_of_inputs_per_neuron, number_of_neurons)) - 1 | |
| class NeuralNetwork(): | |
| def __init__(self, layer1, layer2): |
| @namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul); | |
| /* Set Font Size In Folder Pane */ | |
| #folderTree >treechildren::-moz-tree-cell-text { | |
| /*font-family: Lucida Sans !important;*/ | |
| font-size: 12pt !important; } | |
| /* Set Font Size In Thread Pane */ |
| #!/usr/bin/env python | |
| # python subnet.py 200.100.33.65/26 | |
| import sys | |
| # Get address string and CIDR string from command line | |
| (addrString, cidrString) = sys.argv[1].split('/') | |
| # Split address into octets and turn CIDR into int | |
| addr = addrString.split('.') |
| // select db | |
| use test; | |
| // create a user with db role(s) (http://docs.mongodb.org/manual/reference/built-in-roles/) | |
| db.createUser( { user: "test", pwd: "changeit", roles: [ { role: "dbOwner", db: "test" } ] } ); |