def METHOD_NAME(demand, cost):
    from xarray import broadcast
    from muse.demand_matching import demand_matching
    x = demand_matching(demand, cost.sum("b"))
    assert set(x.dims) == set(demand.dims)
    x, expected = broadcast(x, demand)
    assert x.values == approx(expected.values)
    x = demand_matching(demand, cost)
    assert set(x.dims) == set(demand.dims)
    x, expected = broadcast(x, demand)
    assert x.values == approx(expected.values)
    x = demand_matching(demand.sum("a"), cost)
    assert set(x.dims) == set(demand.dims)
    x, expected = broadcast(x.sum("a"), demand.sum("a"))
    assert x.values == approx(expected.values)