Skip to content

helpers

ramp

ramp(
    x: float,
    in1: float,
    in2: float,
    out1: float,
    out2: float,
    clip: bool = False,
) -> float

Map a value x from one range (in1, in2) to another (out1, out2).

remove_indentation

remove_indentation(text: str) -> str

Remove indentation from a multi-line string based on the indentation of the first line.