def _linear_range_transform(range_, factor, asymmetry=0.0):
    """Return a range that is `factor` larger than `range_`.

    The amount by which the extension is done is the direction of
    each boundary is controlled by a float `asymmetry`, which should
    be between -1 and 1. An `asymmetry` of 0 will extend the range
    symmetrically in the direction of both boundaries. An `asymmetry`
    of -1 (+1) will extend the range in the direction of the first
    (second) boundary, leaving the other boundary unchanged."""
    assert len(range_) == 2
    assert factor > 0.0
    assert -1.0 <= asymmetry <= 1.0
    _m = 0.5 * (range_[1] + range_[0])
    _d = 0.5 * (range_[1] - range_[0])
    _asymm_factor = 1.0 + asymmetry
    return _m - factor * (2.0 - _asymm_factor
        ) * _d, _m + factor * _asymm_factor * _d
