<commit_before>from django.db import models
from satori.dbev import events
from satori.objects import Argument, ReturnValue
from satori.ars import django_
from satori.ars.model import String
from satori.core.models._Object import Object

class Test(Object):
    """Model. Single test.
    """
    __module__ = "satori.core.models"

    owner       = models.ForeignKey('User', null=True)
    problem     = models.ForeignKey('Problem', null=True)
    name        = models.CharField(max_length=50)
    description = models.TextField(blank=True, default="")
    environment = models.CharField(max_length=50)

    class Meta:                                                # pylint: disable-msg=C0111
        unique_together = (('problem', 'name'),)

class TestEvents(events.Events):
    model = Test
    on_insert = on_update = ['owner', 'problem', 'name']
    on_delete = []

class TestOpers(django_.Opers):
    test = django_.ModelProceduresProvider(Test)

    @test.method
    @ReturnValue(type=Test)
    @Argument(name='name', type=str)
    def create(name):
        t = Test()
        t.name = name
        t.save()
        return t.id
<commit_msg>Corrected create().<commit_after>from django.db import models
from satori.dbev import events
from satori.objects import Argument, ReturnValue
from satori.ars import django_
from satori.ars.model import String
from satori.core.models._Object import Object

class Test(Object):
    """Model. Single test.
    """
    __module__ = "satori.core.models"

    owner       = models.ForeignKey('User', null=True)
    problem     = models.ForeignKey('Problem', null=True)
    name        = models.CharField(max_length=50)
    description = models.TextField(blank=True, default="")
    environment = models.CharField(max_length=50)

    class Meta:                                                # pylint: disable-msg=C0111
        unique_together = (('problem', 'name'),)

class TestEvents(events.Events):
    model = Test
    on_insert = on_update = ['owner', 'problem', 'name']
    on_delete = []

class TestOpers(django_.Opers):
    test = django_.ModelProceduresProvider(Test)

    @test.method
    @ReturnValue(type=Test)
    @Argument(name='name', type=str)
    def create(name):
        t = Test()
        t.name = name
        t.save()
        return t

{'fraction_non_alphanumeric': 0.11734028683181226, 'fraction_numerical': 0.006953498478922208, 'mean_word_length': 2.823920265780731, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7045046', 'n_tokens_mistral': 695, 'n_tokens_neox': 681, 'n_words': 159}