def METHOD_NAME(
    quantity: xr.DataArray,
    sum_over: Optional[Union[Text, List[Text]]] = None,
    drop: Optional[Union[Text, List[Text]]] = None,
) -> xr.DataArray:
    from pandas import MultiIndex
    from muse.utilities import multiindex_to_coords
    if isinstance(sum_over, Text):
        sum_over = [sum_over]
    if sum_over:
        sum_over = [s for s in sum_over if s in quantity.coords]
    if sum_over:
        quantity = quantity.sum(sum_over)
    if "timeslice" in quantity.dims and isinstance(quantity.timeslice, MultiIndex):
        quantity = multiindex_to_coords(quantity, "timeslice")
    if drop:
        quantity = quantity.drop_vars([d for d in drop if d in quantity.coords])
    return quantity