

def partition(tup, part):
    ' Partition a tuple\n\n    >>> from logpy.assoccomm import partition\n    >>> partition("abcde", [[0,1], [4,3,2]])\n    [(\'a\', \'b\'), (\'e\', \'d\', \'c\')]\n    '
    return [index(tup, ind) for ind in part]

dataset/ETHPy150Open logpy/logpy/logpy/assoccomm.py partition/original