This file contains hidden or 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
| # Odd behavior from `and` operator where right side value of `and` | |
| # is the resulting value after evaluation of the expression | |
| value = 'value' | |
| other_value = 'other value' | |
| def true_func(): | |
| return True | |
| def false_func(): |
This file contains hidden or 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
| version: "3.6" | |
| services: | |
| app: | |
| build: | |
| context: . | |
| args: | |
| requirements: requirements/local.txt | |
| environment: | |
| - DJANGO_SETTINGS_MODULE=sasite.settings.local | |
| - PYTHONDONTWRITEBYTECODE=1 |
This file contains hidden or 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
| FROM python:3.6 | |
| LABEL maintainer cshenkan@shenkan-associates.com | |
| ARG requirements=requirements/local.txt | |
| ENV DJANGO_SETTINGS_MODULE=sasite.settings.local | |
| WORKDIR /app | |
| COPY manage.py /app/ | |
| COPY requirements/ /app/requirements/ |
This file contains hidden or 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
| version: "3.6" | |
| services: | |
| app: | |
| build: | |
| context: . | |
| args: | |
| requirements: requirements/development.txt | |
| environment: | |
| - DJANGO_SETTINGS_MODULE=sasite.settings.development | |
| - PYTHONDONTWRITEBYTECODE=1 |
This file contains hidden or 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
| def normalize_query(query_string, | |
| findterms=re.compile(r'"([^"]+)"|(\S+)').findall, | |
| normspace=re.compile(r'\s{2,}').sub): | |
| ''' Splits the query string in invidual keywords, getting rid of unecessary spaces | |
| and grouping quoted words together. | |
| Example: | |
| >>> normalize_query(' some random words "with quotes " and spaces') | |
| ['some', 'random', 'words', 'with quotes', 'and', 'spaces'] | |
NewerOlder