Example #1
0
def random_fast(n=1000,consenting=True,english_only=True,user_filter=is_sigscroll_user):
    from jv3.study.content_analysis import _actlogs_to_values,_notes_to_values,_note_instance_to_value
    notes = [ x for x in Note.objects.all() ]
    random.shuffle(notes)
    notes = notes[:n]
    print "returning %d notes " % len(notes)
    values = [_note_instance_to_value(v) for v in notes]
    random.shuffle(values)
    return values
Example #2
0
def random_fast(n=1000,
                consenting=True,
                english_only=True,
                user_filter=is_sigscroll_user):
    from jv3.study.content_analysis import _actlogs_to_values, _notes_to_values, _note_instance_to_value
    notes = [x for x in Note.objects.all()]
    random.shuffle(notes)
    notes = notes[:n]
    print "returning %d notes " % len(notes)
    values = [_note_instance_to_value(v) for v in notes]
    random.shuffle(values)
    return values
Example #3
0
def random_notes(n=1000,consenting=True,english_only=True,user_filter=is_sigscroll_user):
    from jv3.study.content_analysis import _actlogs_to_values,_notes_to_values,_note_instance_to_value
    
    if consenting:
        users = [ u for u in non_stop_consenting_users() if user_filter(u) ]
    else:
        users = [ u for u in non_stop_users() if user_filter(u) ]
        
    notes = filter_notes(Note.objects.filter(owner__in=users))
    random.shuffle(notes)
    notes = notes[:n]
    print "returning %d notes " % len(notes)
    values = [_note_instance_to_value(v) for v in notes]
    random.shuffle(values)
    return values
Example #4
0
def random_notes(n=1000,
                 consenting=True,
                 english_only=True,
                 user_filter=is_sigscroll_user):
    from jv3.study.content_analysis import _actlogs_to_values, _notes_to_values, _note_instance_to_value

    if consenting:
        users = [u for u in non_stop_consenting_users() if user_filter(u)]
    else:
        users = [u for u in non_stop_users() if user_filter(u)]

    notes = filter_notes(Note.objects.filter(owner__in=users))
    random.shuffle(notes)
    notes = notes[:n]
    print "returning %d notes " % len(notes)
    values = [_note_instance_to_value(v) for v in notes]
    random.shuffle(values)
    return values