- Message yourself
/slackdevtools - In the DevTools console:
function addStyle (styleString) {
const style = document.createElement('style');
style.textContent = styleString;
document.head.append(style);
}
addStyle(`
| import asyncio | |
| from concurrent import futures | |
| import functools | |
| import inspect | |
| import threading | |
| from grpc import _server | |
| def _loop_mgr(loop: asyncio.AbstractEventLoop): |
| class AttentionWithContext(Layer): | |
| """ | |
| Attention operation, with a context/query vector, for temporal data. | |
| Supports Masking. | |
| Follows the work of Yang et al. [https://www.cs.cmu.edu/~diyiy/docs/naacl16.pdf] | |
| "Hierarchical Attention Networks for Document Classification" | |
| by using a context vector to assist the attention | |
| # Input shape | |
| 3D tensor with shape: `(samples, steps, features)`. | |
| # Output shape |
| class ThreadPoolExecutor(concurrent.futures.ThreadPoolExecutor): | |
| """ | |
| A version of :class:`concurrent.futures.ThreadPoolExecutor` that | |
| always uses native threads, even when threading is monkey-patched. | |
| .. versionadded:: 1.2a1 | |
| """ | |
| def __init__(self, max_workers): | |
| super(ThreadPoolExecutor, self).__init__(max_workers) |
| #author : Sujit Pal | |
| #Note: this is a python3 updated version of http://sujitpal.blogspot.fr/2014/12/semantic-similarity-for-short-sentences.html | |
| # by mathieu Chrétien ([email protected]) | |
| #contributor : Mathieu Chrétien | |
| from __future__ import division | |
| import nltk | |
| from nltk.corpus import wordnet as wn |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE DeriveGeneric #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE PolyKinds #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| import Control.Applicative | |
| import Control.Monad.IO.Class | |
| import Data.Aeson |
| package object mail { | |
| implicit def stringToSeq(single: String): Seq[String] = Seq(single) | |
| implicit def liftToOption[T](t: T): Option[T] = Some(t) | |
| sealed abstract class MailType | |
| case object Plain extends MailType | |
| case object Rich extends MailType | |
| case object MultiPart extends MailType |
| import luigi | |
| import time | |
| class TimeTaskMixin(object): | |
| ''' | |
| A mixin that when added to a luigi task, will print out | |
| the tasks execution time to standard out, when the task is | |
| finished | |
| ''' | |
| @luigi.Task.event_handler(luigi.Event.PROCESSING_TIME) |
| import luigi | |
| import luigi.scheduler | |
| import luigi.worker | |
| import logging as log | |
| import socket | |
| from datetime import datetime as dt | |
| from ConfigParser import ConfigParser | |
| from components import AssessSVMRegression | |
| from components import CreateProteinList | |
| from components import CreateReport |
| // Requires scalaz to be on the classpath | |
| import scalaz._ | |
| import scalaz.State._ | |
| // The State monad was hard for me to understand because it | |
| // seems as if you never actually store a value in the state and | |
| // manipulate it inside of a method like you would in java. | |
| // There are really two types of methods in the scalaz library |