def to_steps(thing):
    if type(thing) in (tuple, list) and len(thing) == 2 and type(thing[0]) in (int, float):
        # reverse x and y
        (y, x) = thing
        x *= units["pixel"]
        y *= units["pixel"]
        # flip x
        #x = (12 * units["inch"]) - x
        x = x.to("steps").magnitude
        y = y.to("steps").magnitude
        return (x, y)
    return map(to_steps, thing)
dataset/ETHPy150Open vishnubob/silhouette/printsvg.py/to_steps/original