Lynn Rees avatar Lynn Rees committed 79088d0

- fix paths

Comments (0)

Files changed (35)

callchain/chainlet/io.py

 from appspace import key
 from stuf.utils import exhaustmap
 
-from callchain import ResetLocalMixin
-
 from callchain.chainlet import imps
+from callchain.base import ResetLocalMixin
 from callchain.chainlet.base import Chainlet
 from callchain.chainlet.keys import KDumps, KLoads, KIO
 
         '''
         pickle = imps.pickle  # @UndefinedVariable
         return self._process(
-            lambda x: pickle.dumps(x, protocol=pickle.HIGHEST_PROTOCOL), 
+            lambda x: pickle.dumps(x, protocol=pickle.HIGHEST_PROTOCOL),
             'application/python-pickle',
         )
 
     def thrift(self):
         '''
         thrift dumper
-    
+
         http://thrift.apache.org/
-    
+
         http://pypi.python.org/pypi/thrift/
         '''
         try:
     def tnetstring(self):
         '''
         tnetstring loader
-    
+
         http://pypi.python.org/pypi/tnetstring/
         '''
         try:
     def thrift(self, base):
         '''
         thrift serialization key
-    
+
         http://thrift.apache.org/
-    
+
         http://pypi.python.org/pypi/thrift/
         '''
         try:
     def tnetstring(self):
         '''
         tnetstring loader
-    
+
         http://pypi.python.org/pypi/tnetstring/
         '''
         try:
                 lambda x: imps.yaml.load(x, **kw), 'application/x-yaml',  # @UndefinedVariable @IgnorePep8
             )
         except AttributeError:
-            raise ImportError('requires PyYaml module')
+            raise ImportError('requires PyYaml module')

callchain/config.py

 # -*- coding: utf-8 -*-
 '''callchain settings management'''
 
+from inspect import isclass
+
 from appspace import key
-
+from stuf.six import items
 from stuf import frozenstuf
-from appspace.utils import object_walk
 from stuf.utils import deepget, lazy_set, setter
 
 from callchain.base import ResetLocalMixin
     KSettingsManager, KInternalDefaults, KExternalDefaults)
 
 
+def object_walk(this):
+    '''
+    transform classes within an object into stufs
+
+    @param this: object
+    '''
+    this_stuf = dict()
+    for k, v in items(vars(this)):
+        if not k.startswith('_'):
+            if isclass(v):
+                this_stuf[k] = object_walk(v)
+            else:
+                this_stuf[k] = v
+    return this_stuf
+
+
 class lock_set(lazy_set):
 
     '''lazily assign attributes with a custom setter'''

callchain/key/queue.py

         @param iterable: an iterable to exhaust
         '''
 
-    def exhaust(iterable, exception=StopIteration):  # @NoSelf
-        '''
-        call next on an iterator until it's exhausted
-
-        @param iterable: iterable to exhaust
-        @param exception: exception marking end of iteration
-        '''
-
-    def exhaustmap(map, call, filter=False, exception=StopIteration):  # @NoSelf @IgnorePep8
-        '''
-        call `next` on an iterator until it's exhausted
-
-        @param mapping: a mapping to exhaust
-        @param call: call to handle what survives the filter
-        @param filter: a filter to apply to mapping (default: `None`)
-        @param exception: exception sentinel (default: `StopIteration`)
-        '''
-
-    def iterexcept(call, exception, start=None):  # @NoSelf
-        '''
-        call a function repeatedly until an exception is raised
-
-        Converts a call-until-exception interface to an iterator interface.
-        Like `iter(call, sentinel)` but uses an exception instead of a sentinel
-        to end the loop.
-
-        Raymond Hettinger, Python Cookbook recipe # 577155
-        '''
-
 
 class KResult(KThings):
 
     def end():  # @NoSelf
         '''return outgoing things then clear out everything'''
 
-    def first():  # @NoSelf
-        '''first incoming thing'''
-
-    def last():  # @NoSelf
-        '''last incoming thing'''
-
     def peek():  # @NoSelf
         '''results from read-only context'''
 

callchain/linked/activeauto.py

 '''active auto-balancing linked chains'''
 
 from appspace import key
-from twoq.active import AutoResultMixin
+from knife.active import OutMixin
 from callchain.linked.keys import KLinked, KEventLinked
 from callchain.linked.core import EventLinked, PriorityLinked, ChainLinked
 
 
 @key(KLinked)
-class chainlink(ChainLinked, AutoResultMixin):
+class chainlink(ChainLinked, OutMixin):
 
     '''linked chain'''
 
 
 @key(KLinked)
-class prioritylink(PriorityLinked, AutoResultMixin):
+class prioritylink(PriorityLinked, OutMixin):
 
     '''priority linked chain'''
 
 
 @key(KEventLinked)
-class eventlink(EventLinked, AutoResultMixin):
+class eventlink(EventLinked, OutMixin):
 
     '''lite linked event chain'''

callchain/linked/activeman.py

-# -*- coding: utf-8 -*-
-'''active manually balanced linked chains'''
-
-from appspace import key
-from twoq.active import ManResultMixin
-from callchain.linked.keys import KLinked, KEventLinked
-from callchain.linked.core import EventLinked, PriorityLinked, ChainLinked
-
-
-@key(KLinked)
-class chainlink(ChainLinked, ManResultMixin):
-
-    '''linked chain'''
-
-
-@key(KLinked)
-class prioritylink(PriorityLinked, ManResultMixin):
-
-    '''priority linked chain'''
-
-
-@key(KEventLinked)
-class eventlink(EventLinked, ManResultMixin):
-
-    '''lite linked event chain'''

callchain/linked/lazyauto.py

 '''lazy auto-balancing linked chains'''
 
 from appspace import key
-from twoq.lazy import AutoResultMixin
+from knife.active import OutMixin
 from callchain.linked.keys import KLinked, KEventLinked
 from callchain.linked.core import EventLinked, PriorityLinked, ChainLinked
 
 
 @key(KLinked)
-class chainlink(ChainLinked, AutoResultMixin):
+class chainlink(ChainLinked, OutMixin):
 
     '''linked chain'''
 
 
 @key(KLinked)
-class prioritylink(PriorityLinked, AutoResultMixin):
+class prioritylink(PriorityLinked, OutMixin):
 
     '''priority linked chain'''
 
 
 @key(KEventLinked)
-class eventlink(EventLinked, AutoResultMixin):
+class eventlink(EventLinked, OutMixin):
 
     '''lite linked event chain'''

callchain/linked/lazyman.py

-# -*- coding: utf-8 -*-
-'''lazy manually balanced linked chains'''
-
-from appspace import key
-from twoq.lazy import ManResultMixin
-from callchain.linked.keys import KLinked, KEventLinked
-from callchain.linked.core import EventLinked, PriorityLinked, ChainLinked
-
-
-@key(KLinked)
-class chainlink(ChainLinked, ManResultMixin):
-
-    '''linked chain'''
-
-
-@key(KLinked)
-class prioritylink(PriorityLinked, ManResultMixin):
-
-    '''priority linked chain'''
-
-
-@key(KEventLinked)
-class eventlink(EventLinked, ManResultMixin):
-
-    '''lite linked event chain'''

callchain/mixin.py

 from itertools import count, chain
 from functools import partial
 
-from twoq.support import isstring
+from stuf.six import isstring
 from appspace.builders import Appspace
 from stuf.utils import OrderedDict, lazy
 

callchain/queue/activeauto/chainlet.py

 '''active auto-balancing chainlets'''
 
 from appspace import key
-from twoq.active import AutoQMixin
-from twoq.mapping import DelayMixin, RepeatMixin, MapMixin
-from twoq.reducing import MathMixin, TruthMixin, ReduceMixin
-from twoq.ordering import RandomMixin, OrderMixin, CombineMixin
-from twoq.filtering import FilterMixin, CollectMixin, SetMixin, SliceMixin
+from knife.active import OutMixin
+from knife.mixins import (
+    ReduceMixin, OrderMixin, RepeatMixin, MapMixin, MathMixin, FilterMixin,
+    CmpMixin, SliceMixin)
 
 from callchain.queue import keys
 from callchain.chainlet.base import Chainlet
 
 
-class chainlet(Chainlet, AutoQMixin):
+class chainlet(Chainlet, OutMixin):
 
     '''chainlet'''
 
 
-@key(keys.KDelay)
-class delaylet(Chainlet, AutoQMixin, DelayMixin):
+@key(keys.KRepeat)
+class repeatlet(Chainlet, OutMixin, CmpMixin):
 
-    '''delayed mapping chainlet'''
+    '''comparing chainlet'''
 
 
 @key(keys.KRepeat)
-class repeatlet(Chainlet, AutoQMixin, RepeatMixin):
+class cmplet(Chainlet, OutMixin, RepeatMixin):
 
     '''repeat chainlet'''
 
 
 @key(keys.KMap)
-class maplet(Chainlet, AutoQMixin, MapMixin):
+class maplet(Chainlet, OutMixin, MapMixin):
 
     '''mapping chainlet'''
 
 
-@key(keys.KCollect)
-class collectlet(Chainlet, AutoQMixin, CollectMixin):
-
-    '''collecting chainlet'''
-
-
-@key(keys.KSet)
-class setlet(Chainlet, AutoQMixin, SetMixin):
-
-    '''seting chainlet'''
-
-
 @key(keys.KSlice)
-class slicelet(Chainlet, AutoQMixin, SliceMixin):
+class slicelet(Chainlet, OutMixin, SliceMixin):
 
     '''slicing chainlet'''
 
 
 @key(keys.KFilter)
-class filterlet(Chainlet, AutoQMixin, FilterMixin):
+class filterlet(Chainlet, OutMixin, FilterMixin):
 
     '''filtering chainlet'''
 
 
-@key(keys.KRandom)
-class randomlet(Chainlet, AutoQMixin, RandomMixin):
-
-    '''randomizing chainlet'''
-
-
 @key(keys.KOrder)
-class orderlet(Chainlet, AutoQMixin, OrderMixin):
+class orderlet(Chainlet, OutMixin, OrderMixin):
 
     '''ordering chainlet'''
 
 
 @key(keys.KMath)
-class mathlet(Chainlet, AutoQMixin, MathMixin):
+class mathlet(Chainlet, OutMixin, MathMixin):
 
     '''mathing chainlet'''
 
 
 @key(keys.KReduce)
-class reducelet(Chainlet, AutoQMixin, ReduceMixin):
+class reducelet(Chainlet, OutMixin, ReduceMixin):
 
     '''reducing chainlet'''
-
-
-@key(keys.KCombine)
-class combinelet(Chainlet, AutoQMixin, CombineMixin):
-
-    '''combining chainlet'''
-
-
-@key(keys.KTruth)
-class truthlet(Chainlet, AutoQMixin, TruthMixin):
-
-    '''truthing chainlet'''

callchain/queue/activeauto/eventlet.py

 '''active auto-balancing eventlets'''
 
 from appspace import key
-from twoq.active import AutoQMixin
-from twoq.mapping import DelayMixin, RepeatMixin, MapMixin
-from twoq.reducing import MathMixin, TruthMixin, ReduceMixin
-from twoq.ordering import RandomMixin, OrderMixin, CombineMixin
-from twoq.filtering import FilterMixin, CollectMixin, SetMixin, SliceMixin
+from knife.active import OutMixin
+from knife.mixins import (
+    RepeatMixin, MapMixin, CmpMixin, SliceMixin, FilterMixin, OrderMixin,
+    MathMixin, ReduceMixin)
 
 from callchain.queue import keys
 from callchain.chainlet.base import Eventlet
 
 
-class eventlet(Eventlet, AutoQMixin):
+class eventlet(Eventlet, OutMixin):
 
     '''eventlet'''
 
 
 @key(keys.KDelay)
-class delaylet(Eventlet, AutoQMixin, DelayMixin):
+class delaylet(Eventlet, OutMixin, CmpMixin):
 
     '''delayed mapping eventlet'''
 
 
 @key(keys.KRepeat)
-class repeatlet(Eventlet, AutoQMixin, RepeatMixin):
+class repeatlet(Eventlet, OutMixin, RepeatMixin):
 
     '''repeat eventlet'''
 
 
 @key(keys.KMap)
-class maplet(Eventlet, AutoQMixin, MapMixin):
+class maplet(Eventlet, OutMixin, MapMixin):
 
     '''mapping eventlet'''
 
 
-@key(keys.KCollect)
-class collectlet(Eventlet, AutoQMixin, CollectMixin):
-
-    '''collecting eventlet'''
-
-
-@key(keys.KSet)
-class setlet(Eventlet, AutoQMixin, SetMixin):
-
-    '''seting eventlet'''
-
-
 @key(keys.KSlice)
-class slicelet(Eventlet, AutoQMixin, SliceMixin):
+class slicelet(Eventlet, OutMixin, SliceMixin):
 
     '''slicing eventlet'''
 
 
 @key(keys.KFilter)
-class filterlet(Eventlet, AutoQMixin, FilterMixin):
+class filterlet(Eventlet, OutMixin, FilterMixin):
 
     '''filtering eventlet'''
 
 
-@key(keys.KRandom)
-class randomlet(Eventlet, AutoQMixin, RandomMixin):
-
-    '''randomizing eventlet'''
-
-
 @key(keys.KOrder)
-class orderlet(Eventlet, AutoQMixin, OrderMixin):
+class orderlet(Eventlet, OutMixin, OrderMixin):
 
     '''ordering eventlet'''
 
 
 @key(keys.KMath)
-class mathlet(Eventlet, AutoQMixin, MathMixin):
+class mathlet(Eventlet, OutMixin, MathMixin):
 
     '''mathing eventlet'''
 
 
 @key(keys.KReduce)
-class reducelet(Eventlet, AutoQMixin, ReduceMixin):
+class reducelet(Eventlet, OutMixin, ReduceMixin):
 
     '''reducing eventlet'''
-
-
-@key(keys.KCombine)
-class combinelet(Eventlet, AutoQMixin, CombineMixin):
-
-    '''combining eventlet'''
-
-
-@key(keys.KTruth)
-class truthlet(Eventlet, AutoQMixin, TruthMixin):
-
-    '''truthing eventlet'''

callchain/queue/activeman/__init__.py

-# -*- coding: utf-8 -*-
-'''active manually balanced chains'''

callchain/queue/activeman/chainlet.py

-# -*- coding: utf-8 -*-
-'''active manually balanced chainlets'''
-
-from appspace import key
-from twoq.active import ManQMixin
-from twoq.mapping import DelayMixin, RepeatMixin, MapMixin
-from twoq.reducing import MathMixin, TruthMixin, ReduceMixin
-from twoq.ordering import RandomMixin, OrderMixin, CombineMixin
-from twoq.filtering import FilterMixin, CollectMixin, SetMixin, SliceMixin
-
-from callchain.queue import keys
-from callchain.chainlet.base import Chainlet
-
-
-class chainlet(Chainlet, ManQMixin):
-
-    '''chainlet'''
-
-
-@key(keys.KDelay)
-class delaylet(Chainlet, ManQMixin, DelayMixin):
-
-    '''delayed mapping chainlet'''
-
-
-@key(keys.KRepeat)
-class repeatlet(Chainlet, ManQMixin, RepeatMixin):
-
-    '''repeat chainlet'''
-
-
-@key(keys.KMap)
-class maplet(Chainlet, ManQMixin, MapMixin):
-
-    '''mapping chainlet'''
-
-
-@key(keys.KCollect)
-class collectlet(Chainlet, ManQMixin, CollectMixin):
-
-    '''collecting chainlet'''
-
-
-@key(keys.KSet)
-class setlet(Chainlet, ManQMixin, SetMixin):
-
-    '''seting chainlet'''
-
-
-@key(keys.KSlice)
-class slicelet(Chainlet, ManQMixin, SliceMixin):
-
-    '''slicing chainlet'''
-
-
-@key(keys.KFilter)
-class filterlet(Chainlet, ManQMixin, FilterMixin):
-
-    '''filtering chainlet'''
-
-
-@key(keys.KRandom)
-class randomlet(Chainlet, ManQMixin, RandomMixin):
-
-    '''randomizing chainlet'''
-
-
-@key(keys.KOrder)
-class orderlet(Chainlet, ManQMixin, OrderMixin):
-
-    '''ordering chainlet'''
-
-
-@key(keys.KMath)
-class mathlet(Chainlet, ManQMixin, MathMixin):
-
-    '''mathing chainlet'''
-
-
-@key(keys.KReduce)
-class reducelet(Chainlet, ManQMixin, ReduceMixin):
-
-    '''reducing chainlet'''
-
-
-@key(keys.KCombine)
-class combinelet(Chainlet, ManQMixin, CombineMixin):
-
-    '''combining chainlet'''
-
-
-@key(keys.KTruth)
-class truthlet(Chainlet, ManQMixin, TruthMixin):
-
-    '''truthing chainlet'''

callchain/queue/activeman/eventlet.py

-# -*- coding: utf-8 -*-
-'''active manually balanced eventlets'''
-
-from appspace import key
-from twoq.active import ManQMixin
-from twoq.mapping import DelayMixin, RepeatMixin, MapMixin
-from twoq.reducing import MathMixin, TruthMixin, ReduceMixin
-from twoq.ordering import RandomMixin, OrderMixin, CombineMixin
-from twoq.filtering import FilterMixin, CollectMixin, SetMixin, SliceMixin
-
-from callchain.queue import keys
-from callchain.chainlet.base import Eventlet
-
-
-class eventlet(Eventlet, ManQMixin):
-
-    '''eventlet'''
-
-
-@key(keys.KDelay)
-class delaylet(Eventlet, ManQMixin, DelayMixin):
-
-    '''delayed mapping eventlet'''
-
-
-@key(keys.KRepeat)
-class repeatlet(Eventlet, ManQMixin, RepeatMixin):
-
-    '''repeat eventlet'''
-
-
-@key(keys.KMap)
-class maplet(Eventlet, ManQMixin, MapMixin):
-
-    '''mapping eventlet'''
-
-
-@key(keys.KCollect)
-class collectlet(Eventlet, ManQMixin, CollectMixin):
-
-    '''collecting eventlet'''
-
-
-@key(keys.KSet)
-class setlet(Eventlet, ManQMixin, SetMixin):
-
-    '''seting eventlet'''
-
-
-@key(keys.KSlice)
-class slicelet(Eventlet, ManQMixin, SliceMixin):
-
-    '''slicing eventlet'''
-
-
-@key(keys.KFilter)
-class filterlet(Eventlet, ManQMixin, FilterMixin):
-
-    '''filtering eventlet'''
-
-
-@key(keys.KRandom)
-class randomlet(Eventlet, ManQMixin, RandomMixin):
-
-    '''randomizing eventlet'''
-
-
-@key(keys.KOrder)
-class orderlet(Eventlet, ManQMixin, OrderMixin):
-
-    '''ordering eventlet'''
-
-
-@key(keys.KMath)
-class mathlet(Eventlet, ManQMixin, MathMixin):
-
-    '''mathing eventlet'''
-
-
-@key(keys.KReduce)
-class reducelet(Eventlet, ManQMixin, ReduceMixin):
-
-    '''reducing eventlet'''
-
-
-@key(keys.KCombine)
-class combinelet(Eventlet, ManQMixin, CombineMixin):
-
-    '''combining eventlet'''
-
-
-@key(keys.KTruth)
-class truthlet(Eventlet, ManQMixin, TruthMixin):
-
-    '''truthing eventlet'''

callchain/queue/keys.py

     def mode():  # @NoSelf
         '''mode of all incoming things'''
 
-    def uncommon():  # @NoSelf
-        '''least common incoming thing'''
-
-    def frequency():  # @NoSelf
-        '''frequency of each incoming thing'''
-
     def statrange():  # @NoSelf
         '''statistical range of all incoming things'''
 
         @param thing: some thing
         '''
 
+    def uncommon():  # @NoSelf
+        '''least common incoming thing'''
+
+    def frequency():  # @NoSelf
+        '''frequency of each incoming thing'''
+
     def quantify():  # @NoSelf
         '''how many times call is `True` for incoming things'''
 
     def merge():  # @NoSelf
         '''flatten nested but ordered incoming things'''
 
-    def smash():  # @NoSelf
+    def flatten():  # @NoSelf
         '''flatten deeply nested incoming things'''
 
     def pairwise():  # @NoSelf
         sort incoming things, optionally using current call as key function
         '''
 
-
-class KCombine(KChainlet):
-
-    '''combination key'''
-
-    def combinations(r):  # @NoSelf
-        '''
-        `r` length slices of incoming things
-
-        @param r: length of combinations
-        '''
-
-    def permutations(r):  # @NoSelf
-        '''
-        successive `r` length permutations of incoming things
-
-        @param r: length of permutations
-        '''
-
     def product(n=1):  # @NoSelf
         '''
         nested for each loops repeated `n` times
         @param n: number of repetitions (default: 1)
         '''
 
+
 class KDelay(KChainlet):
 
     '''delayed map key'''
     def copy():  # @NoSelf
         '''copy each incoming thing'''
 
-    def padnone():  # @NoSelf
-        '''repeat incoming things and then `None` indefinitely'''
-
     def range(start, stop=0, step=1):  # @NoSelf
         '''
         put sequence of numbers in incoming things
 
     '''slicing key'''
 
+    def first():  # @NoSelf
+        '''first incoming thing'''
+
+    def last():  # @NoSelf
+        '''last incoming thing'''
+
     def nth(n, default=None):  # @NoSelf
         '''
         `nth` incoming thing or default thing

callchain/queue/lazyauto/chainlet.py

 '''lazy auto-balanced chainlets'''
 
 from appspace import key
-from twoq.lazy import AutoQMixin
-from twoq.mapping import DelayMixin, RepeatMixin, MapMixin
-from twoq.reducing import MathMixin, TruthMixin, ReduceMixin
-from twoq.ordering import RandomMixin, OrderMixin, CombineMixin
-from twoq.filtering import FilterMixin, CollectMixin, SetMixin, SliceMixin
+from knife.lazy import OutMixin
 
 from callchain.queue import keys
 from callchain.chainlet.base import Chainlet
+from knife.mixins import (
+    RepeatMixin, MapMixin, CmpMixin, SliceMixin, FilterMixin, OrderMixin,
+    MathMixin, ReduceMixin)
 
 
-class chainlet(Chainlet, AutoQMixin):
+class chainlet(Chainlet, OutMixin):
 
     '''chainlet'''
 
 
-@key(keys.KDelay)
-class delaylet(Chainlet, AutoQMixin, DelayMixin):
-
-    '''delayed mapping chainlet'''
-
-
 @key(keys.KRepeat)
-class repeatlet(Chainlet, AutoQMixin, RepeatMixin):
+class repeatlet(Chainlet, OutMixin, RepeatMixin):
 
     '''repeat chainlet'''
 
 
 @key(keys.KMap)
-class maplet(Chainlet, AutoQMixin, MapMixin):
+class maplet(Chainlet, OutMixin, MapMixin):
 
     '''mapping chainlet'''
 
 
 @key(keys.KCollect)
-class collectlet(Chainlet, AutoQMixin, CollectMixin):
+class cmplet(Chainlet, OutMixin, CmpMixin):
 
     '''collecting chainlet'''
 
 
-@key(keys.KSet)
-class setlet(Chainlet, AutoQMixin, SetMixin):
-
-    '''seting chainlet'''
-
-
 @key(keys.KSlice)
-class slicelet(Chainlet, AutoQMixin, SliceMixin):
+class slicelet(Chainlet, OutMixin, SliceMixin):
 
     '''slicing chainlet'''
 
 
 @key(keys.KFilter)
-class filterlet(Chainlet, AutoQMixin, FilterMixin):
+class filterlet(Chainlet, OutMixin, FilterMixin):
 
     '''filtering chainlet'''
 
 
-@key(keys.KRandom)
-class randomlet(Chainlet, AutoQMixin, RandomMixin):
-
-    '''randomizing chainlet'''
-
-
 @key(keys.KOrder)
-class orderlet(Chainlet, AutoQMixin, OrderMixin):
+class orderlet(Chainlet, OutMixin, OrderMixin):
 
     '''ordering chainlet'''
 
 
 @key(keys.KMath)
-class mathlet(Chainlet, AutoQMixin, MathMixin):
+class mathlet(Chainlet, OutMixin, MathMixin):
 
     '''mathing chainlet'''
 
 
 @key(keys.KReduce)
-class reducelet(Chainlet, AutoQMixin, ReduceMixin):
+class reducelet(Chainlet, OutMixin, ReduceMixin):
 
     '''reducing chainlet'''
-
-
-@key(keys.KCombine)
-class combinelet(Chainlet, AutoQMixin, CombineMixin):
-
-    '''combining chainlet'''
-
-
-@key(keys.KTruth)
-class truthlet(Chainlet, AutoQMixin, TruthMixin):
-
-    '''truthing chainlet'''

callchain/queue/lazyauto/eventlet.py

 '''lazy auto-balancing eventlets'''
 
 from appspace import key
-from twoq.lazy import AutoQMixin
-from twoq.mapping import DelayMixin, RepeatMixin, MapMixin
-from twoq.reducing import MathMixin, TruthMixin, ReduceMixin
-from twoq.ordering import RandomMixin, OrderMixin, CombineMixin
-from twoq.filtering import FilterMixin, CollectMixin, SetMixin, SliceMixin
+from knife.lazy import OutMixin
+from knife.mixins import (
+    RepeatMixin, MapMixin, CmpMixin, SliceMixin, FilterMixin, OrderMixin,
+    MathMixin, ReduceMixin)
 
 from callchain.queue import keys
 from callchain.chainlet.base import Eventlet
 
 
-class eventlet(Eventlet, AutoQMixin):
+class eventlet(Eventlet, OutMixin):
 
     '''eventlet'''
 
 
 @key(keys.KDelay)
-class delaylet(Eventlet, AutoQMixin, DelayMixin):
+class cmplet(Eventlet, OutMixin, CmpMixin):
 
     '''delayed mapping eventlet'''
 
 
 @key(keys.KRepeat)
-class repeatlet(Eventlet, AutoQMixin, RepeatMixin):
+class repeatlet(Eventlet, OutMixin, RepeatMixin):
 
     '''repeat eventlet'''
 
 
 @key(keys.KMap)
-class maplet(Eventlet, AutoQMixin, MapMixin):
+class maplet(Eventlet, OutMixin, MapMixin):
 
     '''mapping eventlet'''
 
 
-@key(keys.KCollect)
-class collectlet(Eventlet, AutoQMixin, CollectMixin):
-
-    '''collecting eventlet'''
-
-
-@key(keys.KSet)
-class setlet(Eventlet, AutoQMixin, SetMixin):
-
-    '''seting eventlet'''
-
-
 @key(keys.KSlice)
-class slicelet(Eventlet, AutoQMixin, SliceMixin):
+class slicelet(Eventlet, OutMixin, SliceMixin):
 
     '''slicing eventlet'''
 
 
 @key(keys.KFilter)
-class filterlet(Eventlet, AutoQMixin, FilterMixin):
+class filterlet(Eventlet, OutMixin, FilterMixin):
 
     '''filtering eventlet'''
 
 
-@key(keys.KRandom)
-class randomlet(Eventlet, AutoQMixin, RandomMixin):
-
-    '''randomizing eventlet'''
-
-
 @key(keys.KOrder)
-class orderlet(Eventlet, AutoQMixin, OrderMixin):
+class orderlet(Eventlet, OutMixin, OrderMixin):
 
     '''ordering eventlet'''
 
 
 @key(keys.KMath)
-class mathlet(Eventlet, AutoQMixin, MathMixin):
+class mathlet(Eventlet, OutMixin, MathMixin):
 
     '''mathing eventlet'''
 
 
 @key(keys.KReduce)
-class reducelet(Eventlet, AutoQMixin, ReduceMixin):
+class reducelet(Eventlet, OutMixin, ReduceMixin):
 
     '''reducing eventlet'''
-
-
-@key(keys.KCombine)
-class combinelet(Eventlet, AutoQMixin, CombineMixin):
-
-    '''combining eventlet'''
-
-
-@key(keys.KTruth)
-class truthlet(Eventlet, AutoQMixin, TruthMixin):
-
-    '''truthing eventlet'''

callchain/queue/lazyman/__init__.py

-# -*- coding: utf-8 -*-
-'''lazy manually balanced chains'''

callchain/queue/lazyman/chainlet.py

-# -*- coding: utf-8 -*-
-'''lazy manually balanced chainlets'''
-
-from appspace import key
-from twoq.lazy import ManQMixin
-from twoq.mapping import DelayMixin, RepeatMixin, MapMixin
-from twoq.reducing import MathMixin, TruthMixin, ReduceMixin
-from twoq.ordering import RandomMixin, OrderMixin, CombineMixin
-from twoq.filtering import FilterMixin, CollectMixin, SetMixin, SliceMixin
-
-from callchain.queue import keys
-from callchain.chainlet.base import Chainlet
-
-
-class chainlet(Chainlet, ManQMixin):
-
-    '''chainlet'''
-
-
-@key(keys.KDelay)
-class delaylet(Chainlet, ManQMixin, DelayMixin):
-
-    '''delayed mapping chainlet'''
-
-
-@key(keys.KRepeat)
-class repeatlet(Chainlet, ManQMixin, RepeatMixin):
-
-    '''repeat chainlet'''
-
-
-@key(keys.KMap)
-class maplet(Chainlet, ManQMixin, MapMixin):
-
-    '''mapping chainlet'''
-
-
-@key(keys.KCollect)
-class collectlet(Chainlet, ManQMixin, CollectMixin):
-
-    '''collecting chainlet'''
-
-
-@key(keys.KSet)
-class setlet(Chainlet, ManQMixin, SetMixin):
-
-    '''seting chainlet'''
-
-
-@key(keys.KSlice)
-class slicelet(Chainlet, ManQMixin, SliceMixin):
-
-    '''slicing chainlet'''
-
-
-@key(keys.KFilter)
-class filterlet(Chainlet, ManQMixin, FilterMixin):
-
-    '''filtering chainlet'''
-
-
-@key(keys.KRandom)
-class randomlet(Chainlet, ManQMixin, RandomMixin):
-
-    '''randomizing chainlet'''
-
-
-@key(keys.KOrder)
-class orderlet(Chainlet, ManQMixin, OrderMixin):
-
-    '''ordering chainlet'''
-
-
-@key(keys.KMath)
-class mathlet(Chainlet, ManQMixin, MathMixin):
-
-    '''mathing chainlet'''
-
-
-@key(keys.KReduce)
-class reducelet(Chainlet, ManQMixin, ReduceMixin):
-
-    '''reducing chainlet'''
-
-
-@key(keys.KCombine)
-class combinelet(Chainlet, ManQMixin, CombineMixin):
-
-    '''combining chainlet'''
-
-
-@key(keys.KTruth)
-class truthlet(Chainlet, ManQMixin, TruthMixin):
-
-    '''truthing chainlet'''

callchain/queue/lazyman/eventlet.py

-# -*- coding: utf-8 -*-
-'''lazy manually balanced eventlets'''
-
-from appspace import key
-from twoq.lazy import ManQMixin
-from twoq.mapping import DelayMixin, RepeatMixin, MapMixin
-from twoq.reducing import MathMixin, TruthMixin, ReduceMixin
-from twoq.ordering import RandomMixin, OrderMixin, CombineMixin
-from twoq.filtering import FilterMixin, CollectMixin, SetMixin, SliceMixin
-
-from callchain.queue import keys
-from callchain.chainlet.base import Eventlet
-
-
-class eventlet(Eventlet, ManQMixin):
-
-    '''eventlet'''
-
-
-@key(keys.KDelay)
-class delaylet(Eventlet, ManQMixin, DelayMixin):
-
-    '''delayed mapping eventlet'''
-
-
-@key(keys.KRepeat)
-class repeatlet(Eventlet, ManQMixin, RepeatMixin):
-
-    '''repeat eventlet'''
-
-
-@key(keys.KMap)
-class maplet(Eventlet, ManQMixin, MapMixin):
-
-    '''mapping eventlet'''
-
-
-@key(keys.KCollect)
-class collectlet(Eventlet, ManQMixin, CollectMixin):
-
-    '''collecting eventlet'''
-
-
-@key(keys.KSet)
-class setlet(Eventlet, ManQMixin, SetMixin):
-
-    '''seting eventlet'''
-
-
-@key(keys.KSlice)
-class slicelet(Eventlet, ManQMixin, SliceMixin):
-
-    '''slicing eventlet'''
-
-
-@key(keys.KFilter)
-class filterlet(Eventlet, ManQMixin, FilterMixin):
-
-    '''filtering eventlet'''
-
-
-@key(keys.KRandom)
-class randomlet(Eventlet, ManQMixin, RandomMixin):
-
-    '''randomizing eventlet'''
-
-
-@key(keys.KOrder)
-class orderlet(Eventlet, ManQMixin, OrderMixin):
-
-    '''ordering eventlet'''
-
-
-@key(keys.KMath)
-class mathlet(Eventlet, ManQMixin, MathMixin):
-
-    '''mathing eventlet'''
-
-
-@key(keys.KReduce)
-class reducelet(Eventlet, ManQMixin, ReduceMixin):
-
-    '''reducing eventlet'''
-
-
-@key(keys.KCombine)
-class combinelet(Eventlet, ManQMixin, CombineMixin):
-
-    '''combining eventlet'''
-
-
-@key(keys.KTruth)
-class truthlet(Eventlet, ManQMixin, TruthMixin):
-
-    '''truthing eventlet'''

callchain/root/activeauto.py

 '''active auto-balancing root chains'''
 
 from appspace import key
-from twoq.active import AutoResultMixin
+from knife.active import OutMixin
 
 from callchain.route import Chains, Events
 from callchain.mixin import ChainMixin, PriorityMixin, EventMixin
 
 @key(KRoot)
 @thingchain
-class callchain(RootMixin, ChainMixin, AutoResultMixin):
+class callchain(RootMixin, ChainMixin, OutMixin):
 
     '''active queued auto-balancing lite call chain'''
 
 
 @key(KRoot)
 @thingchain
-class prioritychain(RootMixin, PriorityMixin, AutoResultMixin):
+class prioritychain(RootMixin, PriorityMixin, OutMixin):
 
     '''active priority queued auto-balancing lite call chain'''
 
 
 @key(KEventRoot)
 @thingevent
-class eventchain(EventRootMixin, EventMixin, AutoResultMixin):
+class eventchain(EventRootMixin, EventMixin, OutMixin):
 
     '''active queued auto-balancing lite event chain'''
 
 
 @key(KRoot)
 @chain
-class chainq(RootMixin, ChainMixin, AutoResultMixin):
+class chainq(RootMixin, ChainMixin, OutMixin):
 
     '''active queued auto-balancing call chain'''
 
 
 @key(KRoot)
 @chain
-class priorityq(RootMixin, PriorityMixin, AutoResultMixin):
+class priorityq(RootMixin, PriorityMixin, OutMixin):
 
     '''active priority queued auto-balancing lite call chain'''
 
 
 @key(KEventRoot)
 @event
-class eventq(EventRootMixin, EventMixin, AutoResultMixin):
+class eventq(EventRootMixin, EventMixin, OutMixin):
 
     '''active priority queued auto-balancing lite call chain'''

callchain/root/activeman.py

-# -*- coding: utf-8 -*-
-'''active manually balanced chains'''
-
-from appspace import key
-from twoq.active import ManResultMixin
-
-from callchain.route import Chains, Events
-from callchain.mixin import ChainMixin, PriorityMixin, EventMixin
-
-from callchain.root.settings import Defaults
-from callchain.root.keys import KRoot, KEventRoot
-from callchain.root.core import RootMixin, EventRootMixin
-from callchain.root.apps import thingchain, thingevent, chain, events
-
-thingchain = Chains(thingchain).defaults(Defaults)
-thingevent = Events(thingevent).events(events).defaults(Defaults)
-
-
-@key(KRoot)
-@thingchain
-class callchain(RootMixin, ChainMixin, ManResultMixin):
-
-    '''active queued manually balanced lite call chain'''
-
-
-@key(KRoot)
-@thingchain
-class prioritychain(RootMixin, PriorityMixin, ManResultMixin):
-
-    '''active priority queued manually balanced lite call chain'''
-
-
-@key(KEventRoot)
-@thingevent
-class eventchain(EventRootMixin, EventMixin, ManResultMixin):
-
-    '''active queued manually balanced lite event chain'''
-
-
-class chainqueue(chain):
-    prefix = 'callchain.chainlet.activeman.chainlet'
-
-
-class eventqueue(chain):
-    prefix = 'callchain..chainlet.activeman.eventlet'
-    chain = 'callchain.chainlet.activeman.chainlet.chainlink'
-
-
-chain = Chains(chainqueue).defaults(Defaults)
-event = Events(eventqueue).events(events).defaults(Defaults)
-
-
-@key(KRoot)
-@chain
-class chainq(RootMixin, ChainMixin, ManResultMixin):
-
-    '''active queued manually balanced call chain'''
-
-
-@key(KRoot)
-@chain
-class priorityq(RootMixin, PriorityMixin, ManResultMixin):
-
-    '''active priority queued manually balanced lite call chain'''
-
-
-@key(KEventRoot)
-@event
-class eventq(EventRootMixin, EventMixin, ManResultMixin):
-
-    '''active queued manually balanced event chain'''

callchain/root/core.py

 # -*- coding: utf-8 -*-
 '''root chain mixins'''
 
-from stuf.utils import lazy_class
-
 from callchain.base import ResetLocalMixin
 from callchain.mixin import ChainMixin, PriorityMixin, EventMixin
 
         # clear call chain and queues and extend incoming things
         return self.clear().extend(args)
 
-    @lazy_class
-    def port(self):
-        '''python 2.x <-> python 3.x porting helper'''
-        from twoq.support import port
-        return port
-
     def back(self, branch):
         '''
         handle switch from branch chain

callchain/root/lazyauto.py

 '''lazy auto-balancing root chains'''
 
 from appspace import key
-from twoq.lazy import AutoResultMixin
+from knife.lazy import OutMixin
 
 from callchain.route import Chains, Events
 from callchain.mixin import ChainMixin, PriorityMixin, EventMixin
 
 @key(KRoot)
 @thingchain
-class callchain(RootMixin, ChainMixin, AutoResultMixin):
+class callchain(RootMixin, ChainMixin, OutMixin):
 
     '''lazy queued auto-balancing lite call chain'''
 
 
 @key(KRoot)
 @thingchain
-class prioritychain(RootMixin, PriorityMixin, AutoResultMixin):
+class prioritychain(RootMixin, PriorityMixin, OutMixin):
 
     '''lazy priority queued auto-balancing lite call chain'''
 
 
 @key(KEventRoot)
 @thingevent
-class eventchain(EventRootMixin, EventMixin, AutoResultMixin):
+class eventchain(EventRootMixin, EventMixin, OutMixin):
 
     '''lazy queued auto-balancing lite event chain'''
 
 
 @key(KRoot)
 @chain
-class chainq(RootMixin, ChainMixin, AutoResultMixin):
+class chainq(RootMixin, ChainMixin, OutMixin):
 
     '''lazy queued auto-balancing call chain'''
 
 
 @key(KRoot)
 @chain
-class priorityq(RootMixin, PriorityMixin, AutoResultMixin):
+class priorityq(RootMixin, PriorityMixin, OutMixin):
 
     '''lazy priority queued auto-balancing lite call chain'''
 
 
 @key(KEventRoot)
 @event
-class eventq(EventRootMixin, EventMixin, AutoResultMixin):
+class eventq(EventRootMixin, EventMixin, OutMixin):
 
     '''lazy priority queued auto-balancing lite call chain'''

callchain/root/lazyman.py

-# -*- coding: utf-8 -*-
-'''lazy manually balanced chains'''
-
-from appspace import key
-from twoq.lazy import ManResultMixin
-
-from callchain.route import Chains, Events
-from callchain.mixin import ChainMixin, PriorityMixin, EventMixin
-
-from callchain.root.settings import Defaults
-from callchain.root.keys import KRoot, KEventRoot
-from callchain.root.core import RootMixin, EventRootMixin
-from callchain.root.apps import thingchain, thingevent, chain, events
-
-thingchain = Chains(thingchain).defaults(Defaults)
-thingevent = Events(thingevent).events(events).defaults(Defaults)
-
-
-@key(KRoot)
-@thingchain
-class callchain(RootMixin, ChainMixin, ManResultMixin):
-
-    '''lazy queued manually balanced lite call chain'''
-
-
-@key(KRoot)
-@thingchain
-class prioritychain(RootMixin, PriorityMixin, ManResultMixin):
-
-    '''lazy priority queued manually balanced lite call chain'''
-
-
-@key(KEventRoot)
-@thingevent
-class eventchain(EventRootMixin, EventMixin, ManResultMixin):
-
-    '''lazy queued manually balanced lite event chain'''
-
-
-class chainqueue(chain):
-    prefix = 'callchain.chainlet.lazyman.chainlet'
-
-
-class eventqueue(chain):
-    prefix = 'callchain.chainlet.lazyman.eventlet'
-    chain = 'callchain.chainlet.lazyman.chainlet.chainlink'
-
-
-chain = Chains(chainqueue).defaults(Defaults)
-event = Events(eventqueue).events(events).defaults(Defaults)
-
-
-@key(KRoot)
-@chain
-class chainq(RootMixin, ChainMixin, ManResultMixin):
-
-    '''lazy queued manually balanced call chain'''
-
-
-@key(KRoot)
-@chain
-class priorityq(RootMixin, PriorityMixin, ManResultMixin):
-
-    '''lazy priority queued manually balanced lite call chain'''
-
-
-@key(KEventRoot)
-@event
-class eventq(EventRootMixin, EventMixin, ManResultMixin):
-
-    '''lazy queued manually balanced event chain'''

callchain/tests/auto/filtering.py

 # -*- coding: utf-8 -*-
 '''auto filtering call chain test mixins'''
 
-from inspect import ismodule
-
-from twoq.support import port
-
 
 class ASliceQMixin(object):
 
         self.assertEqual(
             self.qclass(1, 2, 1, 0, 3, 1, 4).without(0, 1).end(), [2, 3, 4],
         )
-
-__all__ = sorted(name for name, obj in port.items(locals()) if not any([
-    name.startswith('_'), ismodule(obj), name in ['ismodule', 'port']
-]))
-del ismodule
-del port

callchain/tests/auto/mapping.py

 # -*- coding: utf-8 -*-
 '''auto mapping call chain test mixins'''
 
-from inspect import ismodule
-
-from twoq.support import port
-
 
 class ARepeatQMixin(object):
 
             self.qclass([5, 1, 7], [3, 2, 1]).invoke('sort').end(),
             [[1, 5, 7], [1, 2, 3]],
         )
-
-
-__all__ = sorted(name for name, obj in port.items(locals()) if not any([
-    name.startswith('_'), ismodule(obj), name in ['ismodule', 'port']
-]))
-del ismodule

callchain/tests/auto/ordering.py

 # -*- coding: utf-8 -*-
 '''auto ordering call chain test mixins'''
 
-from inspect import ismodule
-
-from twoq.support import port
-
 
 class ARandomQMixin(object):
 
             self.qclass(4, 6, 65, 3, 63, 2, 4).sort().end(),
             [2, 3, 4, 4, 6, 63, 65],
         )
-
-
-__all__ = sorted(name for name, obj in port.items(locals()) if not any([
-    name.startswith('_'), ismodule(obj), name in ['ismodule', 'port']
-]))
-del ismodule

callchain/tests/auto/reducing.py

 # -*- coding: utf-8 -*-
 '''auto reduce test mixins'''
 
-from inspect import ismodule
-
-from twoq.support import port
-
 
 class AMathQMixin(object):
 
             ).zip().end(),
             [('moe', 30, True), ('larry', 40, False), ('curly', 50, False)],
         )
-
-
-__all__ = sorted(name for name, obj in port.items(locals()) if not any([
-    name.startswith('_'), ismodule(obj), name in ['ismodule', 'port']
-]))
-del ismodule

callchain/tests/man/__init__.py

-# -*- coding: utf-8 -*-
-'''callchain manual test mixins'''

callchain/tests/man/filtering.py

-# -*- coding: utf-8 -*-
-'''filtering test mixins'''
-
-from inspect import ismodule
-
-from twoq.support import port
-
-
-class MSliceQMixin(object):
-
-    def test_first(self):
-        manq = self.qclass(5, 4, 3, 2, 1).first()
-        self.assertFalse(manq.balanced)
-        manq.sync()
-        self.assertTrue(manq.balanced)
-        self.assertEqual(manq.value(), 5)
-        self.assertFalse(manq.balanced)
-
-    def test_nth(self):
-        self._false_true_false(
-            self.qclass(5, 4, 3, 2, 1).nth(2), self.assertEqual, 3,
-        )
-        self._false_true_false(
-            self.qclass(5, 4, 3, 2, 1).nth(10, 11), self.assertEqual, 11,
-        )
-
-    def test_last(self):
-        manq = self.qclass(5, 4, 3, 2, 1).last()
-        self.assertFalse(manq.balanced)
-        manq.sync()
-        self.assertTrue(manq.balanced)
-        self.assertEqual(manq.value(), 1)
-        self.assertFalse(manq.balanced)
-
-    def test_initial(self):
-        self._false_true_false(
-            self.qclass(5, 4, 3, 2, 1).initial(),
-            self.assertEqual,
-            [5, 4, 3, 2],
-        )
-
-    def test_rest(self):
-        self._false_true_false(
-            self.qclass(5, 4, 3, 2, 1).rest(), self.assertEqual, [4, 3, 2, 1],
-        )
-
-    def test_take(self):
-        self._false_true_false(
-            self.qclass(5, 4, 3, 2, 1).take(2), self.assertEqual, [5, 4],
-        )
-
-    def test_takeback(self):
-        self._false_true_false(
-            self.qclass(5, 4, 3, 2, 1).snatch(2), self.assertEqual, [2, 1],
-        )
-
-
-class MCollectQMixin(object):
-
-    def test_members(self):
-        class stooges:
-            name = 'moe'
-            age = 40
-        class stoog2: #@IgnorePep8
-            name = 'larry'
-            age = 50
-        class stoog3: #@IgnorePep8
-            name = 'curly'
-            age = 60
-        self._true_true_false(
-            self.qclass(
-                stooges, stoog2, stoog3
-            ).tap(
-                lambda x: not x[0].startswith('__')
-            ).members().detap().sync(),
-            self.assertEqual,
-            [('age', 40), ('name', 'moe'), ('age', 50), ('name', 'larry'),
-            ('age', 60), ('name', 'curly')],
-        )
-
-    def test_deepmembers(self):
-        class stooges:
-            name = 'moe'
-            age = 40
-            def boo(self):#@IgnorePep8
-                return 'boo'
-            def foo(self):#@IgnorePep8
-                return 'foo'
-        class stoog2: #@IgnorePep8
-            name = 'larry'
-            age = 50
-            def boo(self):#@IgnorePep8
-                return 'boo'
-            def foo(self):#@IgnorePep8
-                return 'foo'
-        class stoog3: #@IgnorePep8
-            name = 'curly'
-            age = 60
-            def boo(self):#@IgnorePep8
-                return 'boo'
-            def foo(self):#@IgnorePep8
-                return 'foo'
-        test = lambda x: not x[0].startswith('__')
-        self._false_true_false(
-            self.qclass(stooges, stoog2, stoog3).tap(test).deepmembers(),
-            self.assertEqual,
-                [('age', 40), ('boo', stooges.boo), ('foo', stooges.foo),
-                ('name', 'moe'), ('age', 50), ('boo', stoog2.boo),
-                ('foo', stoog2.foo), ('name', 'larry'), ('age', 60),
-                ('boo', stoog3.boo), ('foo', stoog3.foo), ('name', 'curly')],
-            )
-        from stuf.six import callable
-        test = lambda x: not x[0].startswith('_') and callable(x[1])
-        self._false_true_false(
-            self.qclass(stooges, stoog2, stoog3).tap(test).deepmembers(),
-            self.assertEqual,
-            [('boo', stooges.boo), ('foo', stooges.foo), ('boo', stoog2.boo),
-            ('foo', stoog2.foo), ('boo', stoog3.boo), ('foo', stoog3.foo)],
-        )
-
-    def test_pick(self):
-        from stuf import stuf
-        stooges = [
-            stuf(name='moe', age=40),
-            stuf(name='larry', age=50),
-            stuf(name='curly', age=60)
-        ]
-        self._true_true_false(
-            self.qclass(*stooges).pick('name'),
-            self.assertEqual,
-            ['moe', 'larry', 'curly'],
-        )
-        self._true_true_false(
-            self.qclass(*stooges).pick('name', 'age'),
-            self.assertEqual,
-            [('moe', 40), ('larry', 50), ('curly', 60)],
-        )
-        self._false_true_true(
-            self.qclass(*stooges).pick('place'),
-            self.assertEqual,
-            [],
-        )
-
-    def test_pluck(self):
-        from stuf import stuf
-        stooges = [
-            stuf(name='moe', age=40),
-            stuf(name='larry', age=50),
-            stuf(name='curly', age=60)
-        ]
-        self._true_true_false(
-            self.qclass(*stooges).pluck('name'),
-            self.assertEqual,
-            ['moe', 'larry', 'curly'],
-        )
-        self._true_true_false(
-            self.qclass(*stooges).pluck('name', 'age'),
-            self.assertEqual,
-            [('moe', 40), ('larry', 50), ('curly', 60)],
-        )
-        stooges = [['moe', 40], ['larry', 50], ['curly', 60]]
-        self._true_true_false(
-            self.qclass(*stooges).pluck(0),
-            self.assertEqual,
-            ['moe', 'larry', 'curly'],
-        )
-        self._true_true_false(
-            self.qclass(*stooges).pluck(1),
-            self.assertEqual,
-            [40, 50, 60],
-        )
-        self._false_true_true(
-            self.qclass(*stooges).pluck('place'),
-            self.assertEqual,
-            [],
-        )
-
-
-class MSetQMixin(object):
-
-    def test_difference(self):
-        self._false_true_false(
-            self.qclass([1, 2, 3, 4, 5], [5, 2, 10]).difference(),
-            self.assertEqual,
-            [1, 3, 4]
-        )
-
-    def test_symmetric_difference(self):
-        self._false_true_false(
-            self.qclass([1, 2, 3, 4, 5], [5, 2, 10]).symmetric_difference(),
-            self.assertEqual,
-            [1, 3, 4, 10]
-        )
-
-    def test_disjointed(self):
-        self._false_true_false(
-            self.qclass([1, 2, 3], [5, 4, 10]).disjointed(), self.assertTrue,
-        )
-        self._false_true_false(
-            self.qclass([1, 2, 3], [5, 2, 10]).disjointed(), self.assertFalse,
-        )
-
-    def test_intersection(self):
-        self._false_true_false(
-            self.qclass([1, 2, 3], [101, 2, 1, 10], [2, 1]).intersection(),
-            self.assertEqual,
-            [1, 2],
-        )
-
-    def test_union(self):
-        self._false_true_false(
-            self.qclass([1, 2, 3], [101, 2, 1, 10], [2, 1]).union(),
-            self.assertEqual,
-            [1, 10, 3, 2, 101],
-        )
-
-    def test_subset(self):
-        self._false_true_false(
-            self.qclass([1, 2, 3], [101, 2, 1, 3]).subset(),
-            self.assertTrue,
-        )
-
-    def test_superset(self):
-        self._false_true_false(
-            self.qclass([1, 2, 3], [101, 2, 1, 3, 6, 34]).superset(),
-            self.assertTrue,
-        )
-
-    def test_unique(self):
-        self._false_true_false(
-            self.qclass(1, 2, 1, 3, 1, 4).unique(),
-            self.assertEqual,
-            [1, 2, 3, 4],
-        )
-        self._false_true_false(
-            self.qclass(1, 2, 1, 3, 1, 4).tap(round).unique(),
-            self.assertEqual,
-            [1, 2, 3, 4],
-        )
-
-
-class MFilterQMixin(MCollectQMixin, MSetQMixin, MSliceQMixin):
-
-    def test_filter(self):
-        self._false_true_false(
-            self.qclass(1, 2, 3, 4, 5, 6).tap(lambda x: x % 2 == 0).filter(),
-            self.assertEqual,
-            [2, 4, 6],
-        )
-
-    def test_find(self):
-        self._false_true_false(
-            self.qclass(1, 2, 3, 4, 5, 6).tap(lambda x: x % 2 == 0).find(),
-            self.assertEqual,
-            2,
-        )
-
-    def test_reject(self):
-        self._false_true_false(
-            self.qclass(1, 2, 3, 4, 5, 6).tap(lambda x: x % 2 == 0).reject(),
-            self.assertEqual,
-            [1, 3, 5],
-        )
-
-    def test_partition(self):
-        self._false_true_false(
-            self.qclass(
-                1, 2, 3, 4, 5, 6
-            ).tap(lambda x: x % 2 == 0).partition(),
-            self.assertEqual,
-            [[1, 3, 5], [2, 4, 6]],
-        )
-
-    def test_compact(self):
-        self._false_true_false(
-            self.qclass(0, 1, False, 2, '', 3).compact(),
-            self.assertEqual,
-            [1, 2, 3],
-        )
-
-    def test_without(self):
-        self._false_true_false(
-            self.qclass(1, 2, 1, 0, 3, 1, 4).without(0, 1),
-            self.assertEqual,
-            [2, 3, 4],
-        )
-
-
-__all__ = sorted(name for name, obj in port.items(locals()) if not any([
-    name.startswith('_'), ismodule(obj), name in ['ismodule', 'port']
-]))
-del ismodule

callchain/tests/man/manning.py

-# -*- coding: utf-8 -*-
-'''manual balancing test mixins'''
-
-try:
-    import unittest2 as unittest
-except ImportError:
-    import unittest
-
-
-class Manning(unittest.TestCase):
-
-    def _false_true_false(self, manq, expr, comp=None):
-        self.assertFalse(manq.balanced)
-        manq.sync()
-        self.assertTrue(manq.balanced)
-        if comp is not None:
-            expr(manq.value(), comp)
-        else:
-            expr(manq.value())
-        self.assertFalse(manq.balanced)
-
-    def _true_true_false(self, manq, expr, comp=None):
-        self.assertTrue(manq.balanced)
-        manq.sync()
-        self.assertTrue(manq.balanced)
-        if comp is not None:
-            expr(manq.value(), comp)
-        else:
-            expr(manq.value())
-        self.assertFalse(manq.balanced)
-
-    def _false_true_true(self, manq, expr, comp=None):
-        self.assertFalse(manq.balanced)
-        manq.sync()
-        self.assertTrue(manq.balanced)
-        if comp is not None:
-            expr(manq.value(), comp)
-        else:
-            expr(manq.value())
-        self.assertTrue(manq.balanced)

callchain/tests/man/mapping.py

-# -*- coding: utf-8 -*-
-'''mapping call chain test mixins'''
-
-from inspect import ismodule
-
-from twoq.support import port
-
-
-class MRepeatQMixin(object):
-
-    def test_range(self):
-        self._false_true_false(
-            self.qclass().range(3), self.assertEqual, [0, 1, 2]
-        )
-        self._false_true_false(
-            self.qclass().range(1, 3), self.assertEqual, [1, 2],
-        )
-        self._false_true_false(
-            self.qclass().range(1, 3, 2), self.assertEqual, 1,
-        )
-
-    def test_repeat(self):
-        self._true_true_false(
-            self.qclass(40, 50, 60).repeat(3),
-            self.assertEqual,
-            [(40, 50, 60), (40, 50, 60), (40, 50, 60)],
-        )
-
-    def test_times(self):
-        def test(*args):
-            return list(args)
-        self._true_true_false(
-            self.qclass(40, 50, 60).tap(test).times(3),
-            self.assertEqual,
-            [[40, 50, 60], [40, 50, 60], [40, 50, 60]],
-        )
-
-    def test_copy(self):
-        testlist = [[1, [2, 3]], [4, [5, 6]]]
-        manq = self.qclass(testlist).copy().back()
-        self.assertTrue(manq.balanced)
-        manq.sync()
-        self.assertTrue(manq.balanced)
-        newlist = manq.end()
-        self.assertFalse(newlist is testlist)
-        self.assertListEqual(newlist, testlist)
-        self.assertFalse(newlist[0] is testlist[0])
-        self.assertListEqual(newlist[0], testlist[0])
-        self.assertFalse(newlist[1] is testlist[1])
-        self.assertListEqual(newlist[1], testlist[1])
-        self.assertTrue(manq.balanced)
-
-
-class MDelayQMixin(object):
-
-    def test_delay_each(self):
-        def test(*args, **kw):
-            return sum(args) * kw['a']
-        self._true_true_false(
-            self.qclass(
-                ((1, 2), {'a': 2}), ((2, 3), {'a': 2}), ((3, 4), {'a': 2})
-            ).tap(test).delay_each(0.0001),
-            self.assertEqual,
-            [6, 10, 14],
-        )
-
-    def test_delay_map(self):
-        self._true_true_false(
-            self.qclass(1, 2, 3).tap(lambda x: x * 3).delay_map(0.0001),
-            self.assertEqual,
-            [3, 6, 9],
-        )
-
-    def test_delay_invoke(self):
-        self._true_true_false(
-            self.qclass(
-                [5, 1, 7], [3, 2, 1]
-            ).args(1).delay_invoke('index', 0.0001),
-            self.assertEqual,
-            [1, 2],
-        )
-        self._true_true_false(
-            self.qclass([5, 1, 7], [3, 2, 1]).delay_invoke('sort', 0.0001),
-            self.assertEqual,
-            [[1, 5, 7], [1, 2, 3]],
-        )
-
-
-class MMapQMixin(MDelayQMixin, MRepeatQMixin):
-
-    def test_wrap(self):
-        from stuf import stuf
-        thing = self.qclass(
-            ('a', 1), ('b', 2), ('c', 3)
-        ).reup().wrap(stuf).map().shift().end()
-        self.assertDictEqual(thing, stuf(a=1, b=2, c=3), thing)
-
-    def test_each(self):
-        def test(*args, **kw):
-            return sum(args) * kw['a']
-        self._true_true_false(
-            self.qclass(
-                ((1, 2), {'a': 2}), ((2, 3), {'a': 2}), ((3, 4), {'a': 2})
-            ).tap(test).each(),
-            self.assertEqual,
-            [6, 10, 14],
-        )
-
-    def test_map(self):
-        self._true_true_false(
-            self.qclass(1, 2, 3).tap(lambda x: x * 3).map(),
-            self.assertEqual,
-            [3, 6, 9],
-        )
-
-    def test_starmap(self):
-        self._true_true_false(
-            self.qclass(
-                (1, 2), (2, 3), (3, 4)
-            ).tap(lambda x, y: x * y).starmap(),
-            self.assertEqual,
-            [2, 6, 12],
-        )
-
-    def test_items(self):
-        self._false_true_false(
-            self.qclass(
-                dict([(1, 2), (2, 3), (3, 4)]), dict([(1, 2), (2, 3), (3, 4)])
-            ).tap(lambda x, y: x * y).items(),
-            self.assertEqual,
-            [2, 6, 12, 2, 6, 12],
-        )
-
-    def test_invoke(self):
-        self._true_true_false(
-            self.qclass([5, 1, 7], [3, 2, 1]).args(1).invoke('index'),
-            self.assertEqual,
-            [1, 2],
-        )
-        self._true_true_false(
-            self.qclass([5, 1, 7], [3, 2, 1]).invoke('sort'),
-            self.assertEqual,
-            [[1, 5, 7], [1, 2, 3]]
-        )
-
-__all__ = sorted(name for name, obj in port.items(locals()) if not any([
-    name.startswith('_'), ismodule(obj), name in ['ismodule', 'port']
-]))
-del ismodule

callchain/tests/man/ordering.py

-# -*- coding: utf-8 -*-
-'''ordering test mixins'''
-
-from inspect import ismodule
-
-from twoq.support import port
-
-
-class MRandomQMixin(object):
-
-    def test_choice(self):
-        manq = self.qclass(1, 2, 3, 4, 5, 6).choice().back()
-        self.assertFalse(manq.balanced)
-        manq.sync()
-        self.assertTrue(manq.balanced)
-        manq.end()
-        self.assertTrue(manq.balanced)
-
-    def test_sample(self):
-        manq = self.qclass(1, 2, 3, 4, 5, 6).sample(3).back()
-        self.assertFalse(manq.balanced)
-        manq.sync()
-        self.assertTrue(manq.balanced)
-        manq.end()
-        self.assertTrue(manq.balanced)
-
-    def test_shuffle(self):
-        manq = self.qclass(1, 2, 3, 4, 5, 6).shuffle().back()