code: def _validate_anomaly(anomaly):
      "Validate argument `anomaly`."
      if isinstance(anomaly, (list, pd.Series)):
          pass
      elif isinstance(anomaly, pd.DataFrame):
          if anomaly.columns.duplicated().any():
              raise ValueError(
                  "DataFrame in argument `anomaly` must have unique column names."
              )
      elif isinstance(anomaly, dict):
          for _, value in anomaly.items():
              _validate_anomaly(value)
      else:
          raise TypeError(
              "Argument `anomaly` must be a list, pandas Series, DataFrame, or "
              "a (nested) dict of them."
          )
  
file_path: adtk/src/adtk/visualization/_visualization.py
imports: import matplotlib.pyplot
  import numpy
  import pandas
  from pandas.plotting import register_matplotlib_converters
  from ..data import to_events, to_labels, validate_events
label_desc: Use image node_id 7 for calling a global function with example usage: _validate_anomaly(anomaly) without return types