docs: def __create_matcher(self, match_class, **keywds):
          """implementation details"""
          matcher_args = keywds.copy()
          del matcher_args['function']
          del matcher_args['recursive']
          if 'allow_empty' in matcher_args:
              del matcher_args['allow_empty']
  
          decl_matcher = decl_matcher = match_class(**matcher_args)
          if keywds['function']:
              self._logger.debug(
                  'running query: %s and <user defined function>',
                  str(decl_matcher))
              return lambda decl: decl_matcher(decl) and keywds['function'](decl)
  
          self._logger.debug('running query: %s', str(decl_matcher))
          return decl_matcher