code: def _apply_criteria(df, criteria, **kwargs):
      
      idxs = []
      for var, check in criteria.items():
          _df = df[df['variable'] == var]
          for group in _df.groupby(META_IDX):
              grp_idxs = _check_rows(group[-1], check, **kwargs)
              idxs.append(grp_idxs)
      df = df.loc[itertools.chain(*idxs)]
      return df
docs: Apply criteria individually to every model/scenario instance