One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
from time import time | |
import sys | |
import boto3 | |
client = boto3.client('cloudfront') | |
# Uncomment this to pass a URL to the script | |
#def get_id(url): | |
# print("get_id args: {0}".format(url)) | |
# # url: asdf.cloudfront.net | |
# # return: E2134123ASDF |
How to manually setup flake8 as PyCharm external tool | |
File / Settings / Tools / External Tools / Add | |
Name: Flake8 | |
Program: $PyInterpreterDirectory$/python | |
Parameters: -m flake8 --max-complexity 10 --ignore E501 $FilePath$ | |
Working directory: $ProjectFileDir$ | |
Output Filters / Add | |
Name: Filter 1 |
'''Demonstrate the "prime number conspiracy" as described at | |
https://www.quantamagazine.org/20160313-mathematicians-discover-prime-conspiracy/ | |
"Among the first billion prime numbers, for instance, a prime ending in | |
9 is almost 65 percent more likely to be followed by a prime ending in 1 | |
than another prime ending in 9. In a paper posted online today, Kannan | |
Soundararajan and Robert Lemke Oliver of Stanford University present | |
both numerical and theoretical evidence that prime numbers repel other | |
would-be primes that end in the same digit, and have varied | |
predilections for being followed by primes ending in the other possibl |
#!/usr/bin/env python3 | |
import time, random | |
import math | |
from collections import deque | |
start = time.time() | |
class RealtimePlot: | |
def __init__(self, axes, max_entries = 100): |
#!/usr/bin/env python | |
"""A quick hack to draw gradient lines using a colormap. | |
This was written in response to <Baribal>'s question on IRC. | |
There are two functions provided here: | |
`plot_gradient_hack` takes two arguments, p0 and p1, which are both (x,y) | |
pairs, and plots a gradient between them that spans the full colormap. |
{% macro form_field(field) -%} | |
{% set with_label = kwargs.pop('with_label', False) %} | |
{% set placeholder = '' %} | |
{% if not with_label %} | |
{% set placeholder = field.label.text %} | |
{% endif %} | |
<div class="control-group {% if field.errors %}error{% endif %}"> | |
{% if with_label %} | |
<label for="{{ field.id }}" class="control-label"> | |
{{ field.label.text }}{% if field.flags.required %} *{% endif %}: |