Exemplo n.º 1
0
    def test_segment():
        import random
        from bitdeli.segment_discodb import make_segment_view

        random.seed(21)
        labels = ["First Segment"]  # , 'Second']
        segments = [frozenset(random.sample(model.unique_values(), 100))]
        # frozenset(random.sample(model.unique_values(), 200))]
        view = make_segment_view(model, segments)
        return namedtuple("SegmentInfo", ("model", "segments", "labels", "view"))(model, segments, labels, view)
Exemplo n.º 2
0
def segment(model, segments, labels):
    return namedtuple('SegmentInfo', ('model', 'segments', 'labels', 'view'))\
                     (model, segments, labels, make_segment_view(model, segments))
Exemplo n.º 3
0
def segment(model, segments, labels):
    return namedtuple('SegmentInfo', ('model', 'segments', 'labels', 'view'))\
                     (model, segments, labels, make_segment_view(model, segments))