code: def collect(cls, result_key, func):
          
          def scanner(self, obj):
              if not getattr(self, result_key, None):
                  setattr(self, result_key, [])
              rv = func(obj)
              if rv:
                  getattr(self, result_key).append(rv)
  
          cls._scan(result_key, scanner)
docs: Sets the `result_key` to an iterable of objects for which `func(obj)`
          returns True