Did I find the right examples for you? yes no

All Samples(6)  |  Call(4)  |  Derive(0)  |  Import(2)

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,
    def test_get_merged_spans(self):
        """tests merger of overlapping spans"""
        sample = [[0, 10], [12, 15], [13, 16], [18, 25], [19, 20]]
        result = get_merged_overlapping_coords(sample)
        expect = [[0, 10], [12, 16], [18, 25]]
        self.assertEqual(result, expect)
        sample = [[0, 10], [5, 9], [12, 16], [18, 20], [19, 25]]
        result = get_merged_overlapping_coords(sample)

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,
    def test_get_merged_spans(self):
        """tests merger of overlapping spans"""
        sample = [[0, 10], [12, 15], [13, 16], [18, 25], [19, 20]]
        result = get_merged_overlapping_coords(sample)
        expect = [[0, 10], [12, 16], [18, 25]]
        self.assertEqual(result, expect)
        sample = [[0, 10], [5, 9], [12, 16], [18, 20], [19, 25]]
        result = get_merged_overlapping_coords(sample)