code: def check_aggregate_region(self, variable, region='World', subregions=None,
                                 components=None, exclude_on_fail=False,
                                 **kwargs):
          
          # compute aggregate from subregions, return None if no subregions
          df_subregions = self.aggregate_region(variable, region, subregions,
                                                components)
          if df_subregions is None:
              return
  
          # filter and groupby data, use `pd.Series.align` for matching index
          rows = self._apply_filters(region=region, variable=variable)
          df_region, df_subregions = (
              _aggregate(self.data[rows], ['region', 'variable'])
              .align(df_subregions)
          )
  
          # use `np.isclose` for checking match
          diff = df_region[~np.isclose(df_region, df_subregions, **kwargs)]
  
          if len(diff):
              msg = (
                  '`{}` - {} of {} rows are not aggregates of subregions'
              )
              logger().info(msg.format(variable, len(diff), len(df_region)))
  
              if exclude_on_fail:
                  self._exclude_on_fail(diff.index.droplevel([2, 3]))
  
              col_args = dict(region=region, variable=variable)
              return IamDataFrame(diff, **col_args).timeseries()
docs: Check whether the region timeseries data match the aggregation
          of components
  
          Parameters
          ----------
          variable: str
              variable to be checked for matching aggregation of subregions
          region: str, default 'World'
              region to be checked for matching aggregation of subregions
          subregions: list of str
              list of subregions, defaults to all regions other than `region`
          components: list of str, default None
              list of variables, defaults to all sub-categories of `variable`
              included in `region` but not in any of `subregions`
          exclude_on_fail: boolean, default False
              flag scenarios failing validation as `exclude: True`
          kwargs: passed to `np.isclose()`