Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
// === Arrays | |
var [a, b] = [1, 2]; | |
console.log(a, b); | |
//=> 1 2 | |
// Use from functions, only select from pattern | |
var foo = () => [1, 2, 3]; |
/** @jsx React.DOM */ | |
define([ | |
'underscore', 'jquery', 'react', 'kendo' | |
], function (_, $, React, kendo) { | |
'use strict'; | |
void kendo; | |
var PropTypes = React.PropTypes; | |
function isCellSelection(selectable) { |
#!/bin/bash | |
# run autopep8 linter on any python files that are part of the commit | |
# and modify them in-place to conform to pep8 | |
git diff --cached --name-only | egrep '\.py$' | xargs --no-run-if-empty autopep8 -ri | |
# re-index files staged for commit | |
git diff --cached --name-only | egrep '\.py$'| xargs -l git add |
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.
import functools | |
def force_async(fn): | |
''' | |
turns a sync function to async function using threads | |
''' | |
from concurrent.futures import ThreadPoolExecutor | |
import asyncio | |
pool = ThreadPoolExecutor() |
def apply_model_ner(source,spacy_model): | |
""" | |
source: "./data/T_4_slot_1.jsonl" | |
spacy_model="./model_T_2_1" | |
example --> apply_model_ner("./data/T_4_slot_1.jsonl","./model_T_2_1") | |
""" | |
from prodigy.components.loaders import JSONL | |
import copy | |
import spacy |