def _assert_binary(series: TimeSeries, name: str):
    """Checks if series is a binary timeseries (1 and 0)"

    Parameters
    ----------
    series
        series to check for.
    name
        name of the series.
    """

    vals = series.values(copy=False)
    if not np.array_equal(vals, vals.astype(bool)):
        raise_log(
            ValueError(f"Input series `{name}` must have binary values only."),
            logger=logger,
        )
Checks if series is a binary timeseries (1 and 0)"

    Parameters
    ----------
    series
        series to check for.
    name
        name of the series.
    
darts/ad/utils.py