I hereby claim:
- I am theyorubayesian on github.
- I am akintundeoladipo (https://keybase.io/akintundeoladipo) on keybase.
- I have a public key ASCJPgB8hVzBUiyKhU3w4RF_EU10MXPrlnUGXWZyT1dmqAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
set -e | |
usage="$(basename "$0") [-h] [-i PROJECT] [-v VM] [-p PYTHON] [-d NOTEBOOKS] | |
Make a user provide SSH key and jupyter notebooks (in roles/bootstrap/files/notebooks) to each user listed in var/common.yml | |
where: | |
-h show this help text | |
-i google cloud project id | |
-v name of instance/virtual machine | |
-p python path |
""" | |
Download the latest wiki dump files for a language, | |
If from_date is passed, the latest before that date is downloaded | |
""" | |
import requests | |
from datetime import datetime | |
from datetime import timedelta | |
from string import Template | |
from tqdm import tqdm |
from collections import defaultdict | |
from pprint import pprint | |
from django.db.models.query import QuerySet | |
def parse_annotated_query_set(qs: QuerySet, nest_level: int = 1) -> dict: | |
""" | |
This function parses annotated query sets and returns a nested dictionary. | |
import re | |
CURRENCY_LIST = {"£": "pounds", "$": "dollars", "€": "euros"} | |
CURRENCY_PATTERN = fr"((?:[{''.join(CURRENCY_LIST.keys())}]+\d*)(?:\,*\d+)(?:\.\d+)?(?i:[km])*)|(\d+(?:\,*\d+)(?:\.\d+)?(?i:[km])*(?:[{''.join(CURRENCY_LIST.keys())}]+))|((?:[{''.join(CURRENCY_LIST.keys())}]+))" | |
def _currency_to_text(text: str) -> str: | |
clean = ( | |
lambda x: x.lower() | |
.replace(",", "") |