code: def _handle_filter_sets(self, app):
          
          if 'IMAGINE_FILTER_SETS' in app.config and isinstance(app.config['IMAGINE_FILTER_SETS'], dict):
              for filter_name, filters_settings in app.config['IMAGINE_FILTER_SETS'].items():
                  filter_set = []
                  if isinstance(filters_settings, dict) and 'filters' in filters_settings:
                      for filter_type, filter_settings in filters_settings['filters'].items():
                          if filter_type in self._filters:
                              filter_item = self._filters[filter_type](**filter_settings)
                              if isinstance(filter_item, ImagineFilterInterface):
                                  filter_set.append(filter_item)
                              else:
                                  raise ValueError('Filter must be implement ImagineFilterInterface')
                          else:
                              raise ValueError('Unknown filter type: %s' % filter_type)
  
                      filter_config = {'filters': filter_set}
                      if 'cached' in filters_settings:
                          filter_config['cached'] = filters_settings['cached']
                      else:
                          filter_config['cached'] = app.config['IMAGINE_CACHE_ENABLED']
  
                      self._filter_sets.update({filter_name: filter_config})
                  else:
                      raise ValueError('Wrong settings for filter: %s' % filter_name)
          else:
              raise ValueError('Filters configuration does not present')
docs: Handle filter sets
          :param app: Flask application