This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Scalar = string | number | boolean | undefined | null | |
type ScalarsOf<T> = {[Key in keyof T]: T[Key] extends Scalar ? Key : never}[keyof T] | |
type ObjectsOf<T> = {[Key in keyof T]: T[Key] extends Scalar ? never : Key}[keyof T] | |
type Simplify<T> = T extends Function ? T : {[K in keyof T]: Simplify<T[K]>}; | |
type ValuableKeys<T> = {[Key in keyof T]: T[Key] extends never ? never : Key}[keyof T] | |
type Nevertheless<T> = T extends {} ? {[K in ValuableKeys<T>]: Nevertheless<T[K]>} : T | |
type CompleteSelector<T> = {[Key in ScalarsOf<T>]: true} & { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
polars | |
jupyter | |
numpy | |
pyarrow | |
pandas | |
altair |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
effect leq<a> { | |
fun leq(first: a, second: a) : bool | |
} | |
fun for( | |
from: a, | |
incr: a -> <div,leq<a>|e> a, | |
to: a, | |
do: () -> <div,leq<a>|e> () | |
) : <div,leq<a>|e> () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://vega.github.io/schema/vega/v5.json", | |
"description": "A node-link diagram with force-directed layout, depicting character co-occurrence in the novel Les Misérables.", | |
"width": 700, | |
"height": 500, | |
"padding": 0, | |
"autosize": "none", | |
"signals": [ | |
{ "name": "cx", "update": "width / 2" }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .schemas import HealthCheckModel, HealthCheckDict | |
@app.get("/health-check", response_model=HealthCheckModel) # FastAPI uses pydantic version | |
async def healthcheck() -> HealthCheckDict: # route annotated with TypedDict version for static validation | |
return {'status': 'ok'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Record, String, Number, Runtype, Lazy, Array} from 'runtypes' | |
const noAdditionalProperties = < | |
T, | |
R extends Runtype<T> | |
>(rt: R) => (t: T): boolean | string => { | |
const reflected = rt.reflect | |
switch (reflected.tag) { | |
case 'record': { | |
return Object.entries(t).every(([key, value]) => { |
NewerOlder