code: def validate(df, criteria={}, exclude_on_fail=False, **kwargs):
      
      fdf = df.filter(**kwargs)
      if len(fdf.data) > 0:
          vdf = fdf.validate(criteria=criteria, exclude_on_fail=exclude_on_fail)
          df.meta['exclude'] |= fdf.meta['exclude']  # update if any excluded
          return vdf
docs: Validate scenarios using criteria on timeseries values
  
      Parameters
      ----------
      df: IamDataFrame instance
      args: see `IamDataFrame.validate()` for details
      kwargs: passed to `df.filter()`