# python
Python 2.7.12 (default, Sep 1 2016, 22:14:00)
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy.distutils.system_info as si
>>> si.get_info('atlas')
ATLAS version 3.8.4 built by mockbuild on Sat Jul 7 07:38:30 UTC 2012:
UNAME : Linux gobi-build-31003.sea31.amazon.com 2.6.18-164.el5az00 #1 SMP Tue Sep 15 14:19:07 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
INSTFLG : -1 0 -a 1
This file contains hidden or 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 collections import deque | |
def is_person_seller(person): | |
return True if person.endswith('m') else False | |
def search(graph, start_point, search_function): | |
search_queue = deque() | |
search_queue.extend(graph[start_point]) |
This file contains hidden or 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 is from | |
# Item 22: Prefer Helper Classes Over Bookkeeping with | |
# Dictionaries and Tuples | |
# from Effective Python written by Brett Slatkin | |
# 2015 | |
import collections | |
Grade = collections.namedtuple('Grade', ('score', 'weight')) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
#!/bin/bash | |
set -ex | |
set -o pipefail | |
yum update -y | |
yum install -y \ | |
atlas-sse3-devel \ | |
blas-devel \ | |
gcc \ | |
gcc-c++ \ |
This file contains hidden or 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 __future__ import unicode_literals | |
import base64 | |
from datetime import datetime, timedelta | |
import random | |
import string | |
import json | |
import zlib | |
from concurrent.futures import ThreadPoolExecutor, as_completed |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
# fourFn.py | |
# | |
# Make the original fourFn.py simple to understand how it works. | |
# | |
# Original source code: | |
# http://pyparsing.wikispaces.com/file/view/fourFn.py/30154950/fourFn.py | |
import math | |
import operator | |
from pyparsing import Literal, CaselessLiteral, Word, Combine, \ |
This file contains hidden or 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
def repeat(object, times=None): | |
# repeat(10, 3) --> 10 10 10 | |
if times is None: | |
while True: | |
yield object | |
else: | |
for i in range(times): | |
yield object |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.