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.
| import sqlalchemy | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy import Column, Integer, String, ForeignKey | |
| from sqlalchemy.orm import sessionmaker, relationship | |
| engine = sqlalchemy.create_engine('sqlite:///:memory:') | |
| Base = declarative_base() |
| postgres: | |
| image: postgres:9.4 | |
| volumes: | |
| - ./init.sql:/docker-entrypoint-initdb.d/init.sql |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
| python manage.py shell |
| import unittest | |
| import os | |
| from zipfile import ZipFile | |
| from mock import MagicMock, patch, Mock, mock_open | |
| # The functions that are tested: | |
| def function_to_test_zipfile(example_arg): | |
| with ZipFile(example_arg, 'r') as zip_in: | |
| for input_file in zip_in.infolist(): |
| import re, string, unicodedata | |
| import nltk | |
| import contractions | |
| import inflect | |
| from nltk import word_tokenize, sent_tokenize | |
| from nltk.corpus import stopwords | |
| from nltk.stem import LancasterStemmer, WordNetLemmatizer | |
| def replace_contractions(text): | |
| """Replace contractions in string of text""" |