class_docstr: A Pipenet object connects transformers, detectors and aggregators.
  
  Parameters
  ----------
  steps: dicts
      Components of the pipenet. Each key-value item represents a step (
      transformer, detector, or aggregator), where key is the unique name of
      the step and the value is a dict with the following key-value pairs:
  
          - input (str or list of str): Input to the model, which must be
            either 'original' (i.e. the input time series), or the name of
            a upstream component.
          - subset (str, list of str, or list of lists of str, optional): If
            a model does not use all series from an input component, use this
            field to specify which series should be included. If not given or
            "all", all series from the input component will be used.
          - model (object): A detector, transformer, or aggregator object.
  
  Attributes
  ----------
  steps_graph_: OrderedDict
      Order of steps to be executed. Keys are step names, values are 2-tuple
      (i, j) where i is the index of execution round and j is the the index
      within a round.
  
  final_step_: str
      Name of the final step to be executed. It is the single step in the
      last round of execution in attribute `steps_graph_`.
  
  Examples
  --------
  The following example show how to use a Pipenet to build a level shift
  detector with some basic transformers, detectors, and aggregator.
  
  >>> from adtk.detector import QuantileAD, ThresholdAD
  >>> from adtk.transformer import DoubleRollingAggregate
  >>> from adtk.aggregator import AndAggregator
  >>> from adtk.pipe import Pipenet
  >>> steps = {
          "diff_abs": {
              "input": "original",
              "model": DoubleRollingAggregate(
                  agg="median",
                  window=20,
                  center=True,
                  diff="l1",
              ),
          },
          "quantile_ad": {
              "input": "diff_abs",
              "model": QuantileAD(high=0.99, low=0),
          },
          "diff": {
              "input": "original",
              "model": DoubleRollingAggregate(
                  agg="median",
                  window=20,
                  center=True,
                  diff="diff",
              ),
          },
          "sign_check": {
              "input": "diff",
              "model": ThresholdAD(high=0.0, low=-float("inf")),
          },
          "and": {
              "model": AndAggregator(),
              "input": ["quantile_ad", "sign_check"],
          },
      }
  >>> myPipenet = Pipenet(steps)
docstr: Detect anomalies and score the results against true anomalies.
  
  Parameters
  ----------
  ts: pandas Series or DataFrame
      Time series to detect anomalies from.
  
  anomaly_true: Series, or a list of Timestamps or Timestamp tuple
      True anomalies.
  
      - If pandas Series, it is treated as a series of binary labels.
      - If list, a list of events where an event is a pandas Timestamp if
        it is instantaneous or a 2-tuple of pandas Timestamps if it is a
        closed time interval.
  
  scoring: str, optional
      Scoring function to use. Must be one of "recall", "precision",
      "f1", and "iou". See module `metrics` for more information.
      Default: "recall"
  
  **kwargs
      Optional parameters for scoring function. See module `metrics` for
      more information.
  
  Returns
  -------
  float
      Score of detection result.
docstr_tok: ["Detect","anomalies","and","score","the","results","against","true","anomalies",".","Parameters","--","--","--","--","--","ts",":","pandas","Series","or","DataFrame","Time","series","to","detect","anomalies","from",".","anomaly_true",":","Series",",","or","a","list","of","Timestamps","or","Timestamp","tuple","True","anomalies",".","-","If","pandas","Series",",","it","is","treated","as","a","series","of","binary","labels",".","-","If","list",",","a","list","of","events","where","an","event","is","a","pandas","Timestamp","if","it","is","instantaneous","or","a","2-tuple","of","pandas","Timestamps","if","it","is","a","closed","time","interval",".","scoring",":","str",",","optional","Scoring","function","to","use",".","Must","be","one","of","``","recall","''",",","``","precision","''",",","``","f1","''",",","and","``","iou","''",".","See","module","`","metrics","`","for","more","information",".","Default",":","``","recall","''","*","*","kwargs","Optional","parameters","for","scoring","function",".","See","module","`","metrics","`","for","more","information",".","Returns","--","--","--","-","float","Score","of","detection","result","."]
code: def score(
      self,
      ts: Union[pd.Series, pd.DataFrame],
      anomaly_true: Union[
          pd.Series,
          pd.DataFrame,
          List[Union[Tuple[pd.Timestamp, pd.Timestamp], pd.Timestamp]],
          Dict[
              str,
              List[
                  Union[Tuple[pd.Timestamp, pd.Timestamp], pd.Timestamp]
              ],
          ],
      ],
      scoring: str = "recall",
      **kwargs: Any,
  ) -> Union[float, Dict[str, float]]:
      """Detect anomalies and score the results against true anomalies.
  
      Parameters
      ----------
      ts: pandas Series or DataFrame
          Time series to detect anomalies from.
  
      anomaly_true: Series, or a list of Timestamps or Timestamp tuple
          True anomalies.
  
          - If pandas Series, it is treated as a series of binary labels.
          - If list, a list of events where an event is a pandas Timestamp if
            it is instantaneous or a 2-tuple of pandas Timestamps if it is a
            closed time interval.
  
      scoring: str, optional
          Scoring function to use. Must be one of "recall", "precision",
          "f1", and "iou". See module `metrics` for more information.
          Default: "recall"
  
      **kwargs
          Optional parameters for scoring function. See module `metrics` for
          more information.
  
      Returns
      -------
      float
          Score of detection result.
  
      """
      if scoring == "recall":
          scoring_func = recall  # type: Callable
      elif scoring == "precision":
          scoring_func = precision
      elif scoring == "f1":
          scoring_func = f1_score
      elif scoring == "iou":
          scoring_func = iou
      else:
          raise ValueError(
              "Argument `scoring` must be one of 'recall', 'precision', "
              "'f1' and 'iou'."
          )
      if isinstance(anomaly_true, pd.Series):
          return scoring_func(
              y_true=anomaly_true,
              y_pred=self.detect(ts, return_list=False),
              **kwargs,
          )
      else:
          return scoring_func(
              y_true=anomaly_true,
              y_pred=self.detect(ts, return_list=True),
              **kwargs,
          )
  
imports: from collections import OrderedDict
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import matplotlib.pyplot
  import pandas
  from matplotlib.collections import PatchCollection
  from matplotlib.lines import Line2D
  from matplotlib.patches import Circle
  from tabulate import tabulate
  from .._aggregator_base import _Aggregator
  from .._base import _Model, _TrainableModel
  from .._detector_base import _NonTrainableUnivariateDetector, _TrainableMultivariateDetector, _TrainableUnivariateDetector
  from .._transformer_base import _NonTrainableMultivariateTransformer, _NonTrainableUnivariateTransformer, _TrainableMultivariateTransformer, _TrainableUnivariateTransformer
  from ..metrics import f1_score, iou, precision, recall
label_desc: Use image node_id 10 for calling the Pipenet obj's underlying member method code with example usage: obj.score(ts, anomaly_true, scoring) and returns: scoring_func, scoring_func