Works well with sloria's cookiecutter-pypackage template.
- Update HISTORY.rst
- Update version number in
my_project/__init__.py
- Run the tests:
git checkout dev
python setup.py test
tox
import math | |
from text.blob import TextBlob as tb | |
def tf(word, blob): | |
return blob.words.count(word) / len(blob.words) | |
def n_containing(word, bloblist): | |
return sum(1 for blob in bloblist if word in blob) | |
def idf(word, bloblist): |
{"lastUpload":"2021-08-17T14:10:13.842Z","extensionVersion":"v3.4.3"} |
WITH | |
dls AS ( | |
SELECT | |
DATE_SUB(DATE(@run_time), INTERVAL 1 DAY) AS date, | |
file.project AS package, | |
details.installer.name AS installer, | |
details.python AS python_version, | |
CAST(SPLIT(details.python, '.')[ | |
OFFSET | |
(0)] AS string) AS python_major, |
# Better | |
class Person: | |
def __init__(self, name, occupation): | |
self.name = name | |
self.occupation = occupation | |
self._relatives = None | |
@property | |
def relatives(self): | |
if self._relatives is None: |
import os | |
import re | |
import urlparse | |
import json as pyjson | |
NOTSET = object() | |
def shortcut(cast, **kwargs): | |
def method(self, var, default=NOTSET): |
class Point: | |
def __init__(self, x, y): | |
self.x, self.y = x, y | |
@classmethod | |
def polar(cls, r, theta): | |
return cls(r * cos(theta), | |
r * sin(theta)) | |
point = Point.polar(r=13, theta=22.6) |
"""Dead simple ANSI coloring.""" | |
import os | |
import sys | |
RED = 31 | |
GREEN = 32 | |
YELLOW = 33 | |
BOLD = 1 | |
RESET_ALL = 0 |
Works well with sloria's cookiecutter-pypackage template.
my_project/__init__.py
git checkout dev
python setup.py test
tox
# Recorded with the doitlive recorder | |
#doitlive shell: /bin/bash | |
#doitlive prompt: sorin | |
```python | |
class Foo: | |
pass | |
# We can assign anything | |
f = Foo() |