コード例 #1
0
def test_drop():
    assert list(drop(3, 'ABCDE')) == list('DE')
    assert list(drop(1, (3, 2, 1))) == list((2, 1))
コード例 #2
0
ファイル: test_itertoolz.py プロジェクト: karansag/toolz
def test_drop():
    assert list(drop(3, 'ABCDE')) == list('DE')
    assert list(drop(1, (3, 2, 1))) == list((2, 1))
コード例 #3
0
ファイル: consensus.py プロジェクト: VDBWRAIR/bioframes
def drop_gaps_because_insertion_offsets(A, off_pos):
    '''remove those N values that are the minimum of those greater than the offset
     position, where N is offset'''
    off, pos = off_pos
    before, after = partition(lambda x: x >= pos, A)
    return itertools.chain.from_iterable([before, drop(off,  imap(lambda x: x+off, after))])