Let’s first write a function to check the outputs. Since it’s quite simple, I’ll use the example from the problem definition and a couple of corner cases:
(defn spy [x] (prn x) x)
FROM tensorflow/tensorflow:1.4.0 | |
ENV HOME /root | |
RUN echo 'export LC_ALL=C.UTF-8' >> /etc/profile | |
RUN echo 'export LANG=C.UTF-8' >> /etc/profile | |
RUN pip install enigma-catalyst | |
RUN jupyter nbextension enable --py --sys-prefix widgetsnbextension |
from sklearn.base import BaseEstimator, TransformerMixin | |
from sklearn.model_selection import cross_val_predict | |
from sklearn.pipeline import make_union | |
from sklearn.model_selection._split import check_cv | |
from sklearn.utils.validation import check_X_y | |
class BlendedClassifierTransformer(BaseEstimator, TransformerMixin): | |
def __init__(self, clf, cv=3): | |
self.clf = clf | |
self.cv = cv |
#!/usr/bin/env bash | |
set -euo pipefail | |
HEARTBEAT_INTERVAL=3 | |
EXPONENTIAL_BACKOFF_POWER=2 | |
EXPONENTIAL_BACKOFF_MAX_TIMEOUT=60 | |
EXPONENTIAL_BACKOFF_INITIAL_TIMEOUT=1 | |
(ns aeron-cluster-test.core | |
(:require [clojure.stacktrace :refer [print-stack-trace]]) | |
(:import [org.agrona CloseHelper] | |
[org.agrona.concurrent AgentTerminationException] | |
[org.agrona ExpandableArrayBuffer] | |
[org.agrona ErrorHandler] | |
[io.aeron.cluster ClusteredMediaDriver ConsensusModule ConsensusModule$Context] | |
[io.aeron.cluster.client EgressListener AeronCluster AeronCluster$Context ] | |
[io.aeron.cluster.service ClusteredService ClusteredServiceContainer ClusteredServiceContainer$Context Cluster ClusteredServiceAgent ClientSession] |
(ns caioaao.purely-functional.solutions.range-consolidation) | |
(defn ranges->events [vs] | |
(mapcat (fn [[a b]] [[:open a] [:close b]]) vs)) | |
(def type->priority | |
{:open 1 | |
:close 2}) | |
;; since range includes both ends, `open` events have priority over `close` |
(ns playground | |
(:require [state-flow.core :as state-flow] | |
[state-flow.state :as state])) | |
(defn inc-a [s] | |
(update s :a inc)) | |
(defn change-state [] | |
(state/modify inc-a)) |
(ns leak-test.core | |
(:gen-class)) | |
(def alphanumerics (concat (map char (range (int \A) (inc (int \Z)))) | |
(range 0 10))) | |
(defn random-alphanumeric-string [len] | |
"Generates a pseudo-random alphanumeric string" | |
(apply str (repeatedly len #(rand-nth alphanumerics)))) |
(ns common.config | |
(:require [aero.alpha.core :as aero.alpha] | |
[aero.core :as aero] | |
[clojure.java.io :as io] | |
[buddy.core.keys :as buddy.keys])) | |
(defn- rewrap [tl] | |
(fn [v] (tagged-literal (:tag tl) v))) | |
(defmethod aero.alpha/eval-tagged-literal 'priv-key |
(load-extension "libfive-guile" "scm_init_libfive_modules") | |
(use-modules (libfive kernel) (libfive vec) (libfive csg) (libfive shapes) (libfive transforms)) | |
(define test-shape | |
(difference | |
(sphere 1 #[0 0 0]) | |
(cylinder-z 0.6 2 #[0 0 -1]) | |
(reflect-xz (cylinder-z 0.6 2 #[0 0 -1])) | |
(reflect-yz (cylinder-z 0.6 2 #[0 0 -1])))) | |
(shape->mesh test-shape "out.stl" 10 '((-2 . 2) (-2 . 2) (-2 . 2))) |