<commit_before>import time

from django.conf import settings
from django.http import JsonResponse
from django.test.utils import override_settings
from django.views.generic import View

from .api import Ticket as ZendeskTicket
from tickets.models import Ticket


class ZendeskTicketsCreateView(View):
    def get(self, request):
        zendesk_ticket = ZendeskTicket()

        results = {'results': []}
        tickets = Ticket.objects.all()
        for each in tickets:
            data = {
                'ticket': {
                    'subject': each.subject,
                    'comment': {
                        'body': each.comment
                    },
                    'requester_id': each.requester_id,
                    'assignee_id': each.assignee_id,
                }
            }
            result = zendesk_ticket.create(data)
            results['results'].append(result)

            if not settings.DEBUG:
                time.sleep(1)

        return JsonResponse(results)<commit_msg>Remove unused import<commit_after>import time

from django.conf import settings
from django.http import JsonResponse
from django.views.generic import View

from .api import Ticket as ZendeskTicket
from tickets.models import Ticket


class ZendeskTicketsCreateView(View):
    def get(self, request):
        zendesk_ticket = ZendeskTicket()

        results = {'results': []}
        tickets = Ticket.objects.all()
        for each in tickets:
            data = {
                'ticket': {
                    'subject': each.subject,
                    'comment': {
                        'body': each.comment
                    },
                    'requester_id': each.requester_id,
                    'assignee_id': each.assignee_id,
                }
            }
            result = zendesk_ticket.create(data)
            results['results'].append(result)

            if not settings.DEBUG:
                time.sleep(1)

        return JsonResponse(results)
{'fraction_non_alphanumeric': 0.08529854490717512, 'fraction_numerical': 0.0010035122930255895, 'mean_word_length': 1.6693440428380188, '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': '6600838', 'n_tokens_mistral': 532, 'n_tokens_neox': 492, 'n_words': 123}