<commit_before>"""
>>> from django.contrib.auth.models import User
>>> user1 = User(username='user1')
>>> user1.save()
>>> user2 = User(username='user2')
>>> user2.save()
>>> from gallery.models import *
>>> gallery1 = Gallery(name='Gallery1')
>>> gallery1.save()
>>> gallery2 = Gallery(name='Gallery2')
>>> gallery2.save()

>>> Picture(name='Picture1',gallery=gallery1,owner=user1,image='uploads/picture1.jpg').save()
>>> Gallery.objects.get(name='Gallery1').users
u'user1'
>>> Gallery.objects.get(name='Gallery2').users
u''
>>> Gallery.objects.get(name='Gallery1').picture_count
1
>>> Gallery.objects.get(name='Gallery2').picture_count
0

>>> Picture(name='Picture2',gallery=gallery2,owner=user2,image='uploads/picture2.jpg').save()
>>> Gallery.objects.get(name='Gallery1').users
u'user1'
>>> Gallery.objects.get(name='Gallery2').users
u'user2'
>>> Gallery.objects.get(name='Gallery1').picture_count
1
>>> Gallery.objects.get(name='Gallery2').picture_count
1

>>> pic = Picture.objects.get(name='Picture2')
>>> pic.gallery = gallery1
>>> pic.save()
>>> Gallery.objects.get(name='Gallery1').users
u'user1, user2'
>>> Gallery.objects.get(name='Gallery2').users
u''
>>> Gallery.objects.get(name='Gallery1').picture_count
2
>>> Gallery.objects.get(name='Gallery2').picture_count
0

>>> Picture.objects.get(name='Picture2').delete()
>>> Gallery.objects.get(name='Gallery1').users
u'user1'
>>> Gallery.objects.get(name='Gallery2').users
u''
>>> Gallery.objects.get(name='Gallery1').picture_count
1
>>> Gallery.objects.get(name='Gallery2').picture_count
0

>>> user = User.objects.get(username='user1')
>>> user.username = 'somenewname'
>>> user.save()
>>> Gallery.objects.get(name='Gallery1').users
u'somenewname'

>>> Comment(text='sometext',picture=Picture.objects.get(name='Picture1'),author=user).save()
>>> Comment.objects.get(text='sometext').title
u'Comment on Picture1 by somenewname'
"""
<commit_msg>slightly extended tests<commit_after>"""
>>> from django.contrib.auth.models import User
>>> user1 = User(username='user1')
>>> user1.save()
>>> user2 = User(username='user2')
>>> user2.save()
>>> from gallery.models import *
>>> gallery1 = Gallery(name='Gallery1')
>>> gallery1.save()
>>> gallery2 = Gallery(name='Gallery2')
>>> gallery2.save()

>>> Picture(name='Picture1',gallery=gallery1,owner=user1,image='uploads/picture1.jpg').save()
>>> Gallery.objects.get(name='Gallery1').users
u'user1'
>>> Gallery.objects.get(name='Gallery2').users
u''
>>> Gallery.objects.get(name='Gallery1').picture_count
1
>>> Gallery.objects.get(name='Gallery2').picture_count
0

>>> Picture(name='Picture2',gallery=gallery2,owner=user2,image='uploads/picture2.jpg').save()
>>> Gallery.objects.get(name='Gallery1').users
u'user1'
>>> Gallery.objects.get(name='Gallery2').users
u'user2'
>>> Gallery.objects.get(name='Gallery1').picture_count
1
>>> Gallery.objects.get(name='Gallery2').picture_count
1

>>> pic = Picture.objects.get(name='Picture2')
>>> pic.gallery = gallery1
>>> pic.save()
>>> Gallery.objects.get(name='Gallery1').users
u'user1, user2'
>>> Gallery.objects.get(name='Gallery2').users
u''
>>> Gallery.objects.get(name='Gallery1').picture_count
2
>>> Gallery.objects.get(name='Gallery2').picture_count
0

>>> Picture.objects.get(name='Picture2').delete()
>>> Gallery.objects.get(name='Gallery1').users
u'user1'
>>> Gallery.objects.get(name='Gallery2').users
u''
>>> Gallery.objects.get(name='Gallery1').picture_count
1
>>> Gallery.objects.get(name='Gallery2').picture_count
0

>>> user = User.objects.get(username='user1')
>>> user.username = 'somenewname'
>>> user.save()
>>> Gallery.objects.get(name='Gallery1').users
u'somenewname'

>>> pic = Picture.objects.get(name='Picture1')
>>> Comment(text='sometext',picture=pic,author=user).save()
>>> Comment.objects.get(text='sometext').title
u'Comment on Picture1 by somenewname'

>>> user.username = 'user1again'
>>> user.save()
>>> pic.name = 'somenewname_for_picture1'
>>> pic.save()
>>> Comment.objects.get(text='sometext').title
u'Comment on somenewname_for_picture1 by user1again'
"""

{'fraction_non_alphanumeric': 0.21950012373174957, 'fraction_numerical': 0.029200692897797576, 'mean_word_length': 7.864035087719298, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 249, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4648362', 'n_tokens_mistral': 1405, 'n_tokens_neox': 1378, 'n_words': 166}