def METHOD_NAME(linear_sampling):
    from muse.carbon_budget import linear_guess_and_weights
    (prices, emissions, budget, a, b) = linear_sampling
    actual_weights = np.abs(emissions - budget)
    (est_a, est_b), est_weights = linear_guess_and_weights(prices, emissions, budget)
    assert actual_weights == approx(est_weights)
    assert a == approx(est_a)
    assert b == approx(est_b)