This document provides guidelines for maintaining high-quality Python code. These rules MUST be followed by all AI coding agents and contributors.
All code you write MUST be fully optimized.
"Fully optimized" includes:
A great way to get Docker running smoothly on OS X is to use the awesome project Dinghy. It is basically:
Docker on OS X with batteries included, aimed at making a more pleasant local development experience. Runs on top of docker-machine.
Some of the benefits are:
| """ | |
| Webasset filter to combine JQuery Templates files into javascript-safe strings, | |
| and put them into a namespace | |
| """ | |
| import os | |
| from webassets.filter import Filter | |
| class JqtFilter(Filter): | |
| name = 'jqt' |
| #!/usr/bin/env python | |
| import sys | |
| from random import random | |
| from time import sleep | |
| from threading import Thread, active_count | |
| execfile('gunicorn.conf.py') |
| class QuerySetDoubleIteration(Exception): | |
| "A QuerySet was iterated over twice, you probably want to list() it." | |
| pass | |
| # "Skinny" here means we use iterator by default, rather than | |
| # ballooning in memory. | |
| class SkinnyManager(Manager): | |
| def get_query_set(self): | |
| return SkinnyQuerySet(self.model, using=self._db) |