<commit_before>from django.db import models
from django.conf import settings
from django.utils.six import python_2_unicode_compatible

from .managers import PrefetchUserManager


@python_2_unicode_compatible
class BaseAPIRequestLog(models.Model):
    """ Logs Django rest framework API requests """
    user = models.ForeignKey(
        settings.AUTH_USER_MODEL,
        on_delete=models.SET_NULL, null=True,
        blank=True,
    )
    requested_at = models.DateTimeField(db_index=True)
    response_ms = models.PositiveIntegerField(default=0)
    path = models.CharField(
        max_length=getattr(settings, 'DRF_TRACKING_PATH_LENGTH', 200),
        db_index=True,
    )
    view = models.CharField(
        max_length=getattr(settings, 'DRF_TRACKING_VIEW_LENGTH', 200),
        null=True,
        blank=True,
        db_index=True,
    )
    view_method = models.CharField(
        max_length=getattr(settings, 'DRF_TRACKING_VIEW_METHOD_LENGTH', 27),
        null=True,
        blank=True,
        db_index=True,
    )
    remote_addr = models.GenericIPAddressField()
    host = models.URLField()
    method = models.CharField(max_length=10)
    query_params = models.TextField(null=True, blank=True)
    data = models.TextField(null=True, blank=True)
    response = models.TextField(null=True, blank=True)
    errors = models.TextField(null=True, blank=True)<commit_msg>format model args<commit_after>from django.db import models
from django.conf import settings
from django.utils.six import python_2_unicode_compatible

from .managers import PrefetchUserManager


@python_2_unicode_compatible
class BaseAPIRequestLog(models.Model):
    """ Logs Django rest framework API requests """
    user = models.ForeignKey(
        settings.AUTH_USER_MODEL,
        on_delete=models.SET_NULL,
        null=True,
        blank=True,
    )
    requested_at = models.DateTimeField(db_index=True)
    response_ms = models.PositiveIntegerField(default=0)
    path = models.CharField(
        max_length=getattr(settings, 'DRF_TRACKING_PATH_LENGTH', 200),
        db_index=True,
    )
    view = models.CharField(
        max_length=getattr(settings, 'DRF_TRACKING_VIEW_LENGTH', 200),
        null=True,
        blank=True,
        db_index=True,
    )
    view_method = models.CharField(
        max_length=getattr(settings, 'DRF_TRACKING_VIEW_METHOD_LENGTH', 27),
        null=True,
        blank=True,
        db_index=True,
    )
    remote_addr = models.GenericIPAddressField()
    host = models.URLField()
    method = models.CharField(max_length=10)
    query_params = models.TextField(null=True, blank=True)
    data = models.TextField(null=True, blank=True)
    response = models.TextField(null=True, blank=True)
    errors = models.TextField(null=True, blank=True)
{'fraction_non_alphanumeric': 0.09616775126536514, 'fraction_numerical': 0.009399855386840203, 'mean_word_length': 3.6348408710217757, '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': '6525460', 'n_tokens_mistral': 881, 'n_tokens_neox': 851, 'n_words': 151}