def sieve(param=None, **kwargs):
 def _sieve_hook(func):
  assert (len(inspect.getargspec(func).args) == 3), 'Sieve plugin has incorrect argument count. Needs params: bot, input, plugin'
  hook = _get_hook(func, 'sieve')
  if (hook is None):
   hook = _Hook(func, 'sieve')
   _add_hook(func, hook)
  hook._add_hook(kwargs)
  return func
 if callable(param):
  return _sieve_hook(param)
 else:
  return (lambda func: _sieve_hook(func))

def sieve ( param = None , ** kwargs ) : def _sieve_hook ( func ) : assert ( len ( inspect . getargspec ( func ) . args ) == 3 ) , 'Sieve plugin has incorrect argument count. Needs params: bot, input, plugin' hook = _get_hook ( func , 'sieve' ) if ( hook is None ) : hook = _Hook ( func , 'sieve' ) _add_hook ( func , hook ) hook . _add_hook ( kwargs ) return func if callable ( param ) : return _sieve_hook ( param ) else : return ( lambda func : _sieve_hook ( func ) )
external sieve decorator .