def smoothing_factor(smoothing: float, length: int) -> float:
    """Smoothing parameter s for splprep / splprep. Chosen in such a way that 1)
    the smoothing ~ mean square error of fitting the process and 2) it is length
    independent.

    Args:
        smoothing: Smoothing factor.
        length: Number of data points.

    Returns:
        splrep / splprep smoothing parameter s.
    """
    return smoothing * length