libicu-dev (PyICU dependency)
brew uninstall --ignore-dependencies icu4c
brew install pkg-config icu4c # keg-only
brew uninstall --ignore-dependencies icu4c
brew install pkg-config icu4c # keg-only
Make sure slackclient v1.3.1 is installed (for apache-airflow 1.10).
pip install -U "apache-airflow[slack,...]"
kubebash <namespace> <deployment>
kubelogs <namespace> <deployment>
kubebranch <namespace> [<partial deployment name>]
A customized subset of kubectl commands. See also: official kubectl cheatsheet
import boto3 | |
import logging | |
import os | |
import pprint | |
import xmltodict | |
pp = pprint.PrettyPrinter(depth=3).pprint | |
logger = logging.getLogger(__name__) | |
logger.setLevel(logging.DEBUG) |
"""Convert ipynb file to py file from CLI. | |
Usage: | |
python ./convert_ipynb_to_py.py [full input path] [full output path] | |
!! overwrites output path without warning if it exists !! | |
""" | |
import sys | |
import json |
import translitcodec | |
def print_variations(x): | |
print(x) | |
print(translitcodec.short_encode(x)[0]) | |
print(translitcodec.long_encode(x)[0]) | |
print_variations("Gesellschaft mit beschränkter Haftung") | |
print_variations("Société Privée à Responsabilité Limitée") | |
print_variations("Shoqëri me përgjegjësi të kufizuar") |
#!/usr/bin/env python | |
import zipfile | |
from pathlib import Path | |
def zipdir(src, dest=None, glob='*', **kwargs): | |
"""Zip contents of src directory into dest. | |
Args: | |
src: source directory path-like |
"""Interact with Doccano Sequence Labelling projects. | |
Trains on checked (approved) annotations, pushes back predictions for unchecked annotations. | |
### Notes | |
- Doccano might implement active learning themselves in the future: https://github.com/doccano/doccano/issues/191 | |
- To support multilingual NER projects, split_sentence() below uses polyglot, which in turn requires PyICU. |
Uploaded using the New Issue
dialog (and its githubusercontent link copied from the Preview tab)
![obama-awards-obama-a-medal](https://user-images.githubusercontent.com/14880945/104736592-80303380-5743-11eb-8224-2bae4fab6f15.png)
import asyncio | |
from functools import wraps, partial | |
def run_in_executor(fn=None, *, executor=None): | |
"""Make a sync function async. By default uses ThreadPoolExecutor. | |
Args: | |
fn: Function to decorate. | |
executor: Executor pool to execute fn in. |