code: def matches(self, properties):
          
          # Use a generator, and declare it outside of the method call
          # => seems to be quite a speed up trick
          generator = (
              criterion.matches(properties) for criterion in self.subfilters
          )
  
          # Extract "if" from loops and use built-in methods
          if self.operator == OR:
              result = any(generator)
          else:
              result = all(generator)
              if self.operator == NOT:
                  # Revert result
                  return not result
  
          return result
docs: Tests if the given properties matches this LDAP filter and its children
  
          :param properties: A dictionary of properties
          :return: True if the properties matches this filter, else False