<commit_before>import sys
from datetime import datetime
from django.db import models
from django.utils import six
from django.utils.timezone import utc
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
from .abstract_mixin import AbstractMixin
from getpaid import signals
from .utils import import_backend_modules
from django.conf import settings

if six.PY3:
    unicode = str


PAYMENT_STATUS_CHOICES = (
        ('new', _("new")),
        ('in_progress', _("in progress")),
        ('accepted_for_proc', _("accepted for processing")),
        ('partially_paid', _("partially paid")),
        ('paid', _("paid")),
        ('failed', _("failed")),
        )


class PaymentManager(models.Manager):
    def get_queryset(self):
        return super(PaymentManager, self).get_queryset().select_related('order')


@python_2_unicode_compatible
class PaymentFactory(models.Model, AbstractMixin):
    """
    This is an abstract class that defines a structure of Payment model that will be
    generated dynamically with one additional field: ``order``
    """
    amount = models.DecimalField(_("amount"), decimal_places=4, max_digits=20)
    currency = models.CharField(_("currency"), max_length=3)
    status = models.CharField(_("status"), max_length=20, choices=PAYMENT_STATUS_CHOICES, default='new', db_index=True)
    backend = models.CharField(_("backend"), max_length=50)
    created_on = models.DateTimeField(_("created on"), auto_now_add=True, db_index=True)
    paid_on = models.DateTimeField(_("paid on"), blank=True, null=True, default=None, db_index=True)
    amount_paid = models.DecimalField(_("amount paid"), decimal_places=4, max_digits=20, default=0)
    external_id = models.CharField(_("external id"), max_length=64, blank=True, null=True)
    description = models.CharField(_("description"), max_length=128, blank=True, null=True)

    class Meta:
        abstract = True

    def __str__(self):<commit_msg>add status cancelled to Payment<commit_after>import sys
from datetime import datetime
from django.db import models
from django.utils import six
from django.utils.timezone import utc
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
from .abstract_mixin import AbstractMixin
from getpaid import signals
from .utils import import_backend_modules
from django.conf import settings

if six.PY3:
    unicode = str


PAYMENT_STATUS_CHOICES = (
        ('new', _("new")),
        ('in_progress', _("in progress")),
        ('accepted_for_proc', _("accepted for processing")),
        ('partially_paid', _("partially paid")),
        ('paid', _("paid")),
        ('cancelled', _("cancelled")),
        ('failed', _("failed")),
        )


class PaymentManager(models.Manager):
    def get_queryset(self):
        return super(PaymentManager, self).get_queryset().select_related('order')


@python_2_unicode_compatible
class PaymentFactory(models.Model, AbstractMixin):
    """
    This is an abstract class that defines a structure of Payment model that will be
    generated dynamically with one additional field: ``order``
    """
    amount = models.DecimalField(_("amount"), decimal_places=4, max_digits=20)
    currency = models.CharField(_("currency"), max_length=3)
    status = models.CharField(_("status"), max_length=20, choices=PAYMENT_STATUS_CHOICES, default='new', db_index=True)
    backend = models.CharField(_("backend"), max_length=50)
    created_on = models.DateTimeField(_("created on"), auto_now_add=True, db_index=True)
    paid_on = models.DateTimeField(_("paid on"), blank=True, null=True, default=None, db_index=True)
    amount_paid = models.DecimalField(_("amount paid"), decimal_places=4, max_digits=20, default=0)
    external_id = models.CharField(_("external id"), max_length=64, blank=True, null=True)
    description = models.CharField(_("description"), max_length=128, blank=True, null=True)

    class Meta:
        abstract = True

    def __str__(self):
{'fraction_non_alphanumeric': 0.1212571145756001, 'fraction_numerical': 0.00989853996535511, 'mean_word_length': 4.849493487698987, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2593717', 'n_tokens_mistral': 1209, 'n_tokens_neox': 1168, 'n_words': 301}