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 boto3 | |
from botocore.exceptions import ClientError | |
class BotoBackoff(object): | |
""" | |
Wrap a client for an AWS service such that every call is backed by exponential backoff with jitter. | |
Examples: | |
>>> ecs = BotoBackoff('ecs') | |
>>> ecs.list_tasks(cluster='my-cluster') |
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 bash | |
# Script to run before doing a commit. This will run autopep8 and any unit tests it can find. | |
# Place this script in .git/hooks/ directory of your repo and rename it pre-commit (no extension) | |
# To have this file copied to every new repo you created, place it in $HOME/.git_template/hooks/pre-commit | |
# NOTES: | |
# 1. This is an opinionated script, following the notion that code formatting issues are the most contentious but the | |
# least consequential. As such it borrows a page from Go and lets the machine decide on the formatting. Concretely, | |
# this means that any PEP8 violations will be fixed before commit, so long as the semantics of the code aren't changed |