def line_1d(x, slope, offset):
    """Return the value of a line with given slope and offset.

    Parameters
    ----------
    x : float or iterable of floats
        The x-value to calculate the value of the line at.
    slope : float
        The slope of the line. Must be finite.
    offset : float
        The y-offset of the line.

    Returns
    -------
    float or iterable of floats
        The value at the given `x`, or values if len(x) > 1, in which case it
        will be an array with length = len(x).

    """

    return slope * x + offset