Did I find the right examples for you? yes no

All Samples(7)  |  Call(4)  |  Derive(0)  |  Import(3)

src/q/i/qiime-1.8.0/qiime/pick_rep_set.py   qiime(Download)
from random import choice
from numpy import argmax
from cogent.util.misc import InverseDictMulti #inverts dict
from cogent.parse.fasta import MinimalFastaParser
 
    Result is {orig_id:unique_rep_id}.
    """
    groups = InverseDictMulti(seqs)
    result = {}
    for v in groups.values():
def make_most_abundant(seqs):
    """Makes function that chooses the most abundant seq from group"""
    seq_to_group = unique_id_map(seqs)
    groups = InverseDictMulti(seq_to_group)
    def most_abundant(ids, seqs='ignored'):

src/c/o/cogent-1.5.3/tests/test_util/test_misc.py   cogent(Download)
from cogent.app.util import get_tmp_filename
from cogent.util.unit_test import TestCase, main
from cogent.util.misc import (iterable, max_index, min_index,
    flatten, is_iterable, is_char, is_char_or_noniterable,
    is_str_or_noniterable, not_list_tuple, list_flatten,
            {'x':['a'],1:['b'],None:['c'],('a','b'):['d']})
        self.assertRaises(TypeError, InverseDictMulti, {'a':['a','b','c']})
        d = InverseDictMulti({'a':3, 'b':3, 'c':3, 'd':'3', 'e':'3'})
        self.assertEqual(len(d), 2)
        assert 3 in d

src/p/y/pycogent-HEAD/tests/test_util/test_misc.py   pycogent(Download)
from cogent.app.util import get_tmp_filename
from cogent.util.unit_test import TestCase, main
from cogent.util.misc import (iterable, max_index, min_index,
    flatten, is_iterable, is_char, is_char_or_noniterable,
    is_str_or_noniterable, not_list_tuple, list_flatten,
            {'x':['a'],1:['b'],None:['c'],('a','b'):['d']})
        self.assertRaises(TypeError, InverseDictMulti, {'a':['a','b','c']})
        d = InverseDictMulti({'a':3, 'b':3, 'c':3, 'd':'3', 'e':'3'})
        self.assertEqual(len(d), 2)
        assert 3 in d