code: def _assert_binary(series: TimeSeries, name_series: str):
      """Checks if series is a binary timeseries (1 and 0)"
  
      Parameters
      ----------
      series
          series to check for.
      name_series
          name str of the series.
      """
  
      raise_if_not(
          np.array_equal(
              series.values(copy=False),
              series.values(copy=False).astype(bool),
          ),
          f"Input series {name_series} must be a binary time series.",
      )
  
file_path: darts/darts/ad/utils.py
imports: from typing import Sequence, Tuple, Union
  import matplotlib.pyplot
  import numpy
  from sklearn.metrics import accuracy_score, average_precision_score, f1_score, precision_score, recall_score, roc_auc_score
  from darts import TimeSeries
  from darts.logging import get_logger, raise_if, raise_if_not
label_desc: Use image node_id 1 for calling a global function with example usage: _assert_binary(series, name_series) without return types