<commit_before>from django.contrib import admin
from django import forms
from django.conf.urls import url
from django.shortcuts import render
from django.db.models.fields import BLANK_CHOICE_DASH

from .models import Driver, Team, Competition, Circuit, Season, GrandPrix, Race, Result
from .models import DriverCompetition, DriverCompetitionTeam, TeamSeasonRel
from .models import ContenderSeason
import punctuation

lr_diff = lambda l, r: list(set(l).difference(r))
lr_intr = lambda l, r: list(set(l).intersection(r))

class RelatedCompetitionAdmin(object):
    """ Aux class to share print_competitions method between driver and team """
    def print_competitions(self, obj):
        return ', '.join("%s" % competition for competition in obj.competitions.all())
    print_competitions.short_description = 'competitions'

class RaceInline(admin.TabularInline):
    model = Race
    extra = 1

class DriverCompetitionTeamInline(admin.TabularInline):
    model = DriverCompetitionTeam
    extra = 3

class DriverCompetitionInline(admin.TabularInline):
    model = DriverCompetition
    extra = 1

class TeamSeasonInline(admin.TabularInline):
    model = TeamSeasonRel
    extra = 1

class DriverAdmin(RelatedCompetitionAdmin, admin.ModelAdmin):
    list_display = ('__unicode__', 'country', 'print_competitions')
    list_filter = ('competitions__name',)
    inlines = [DriverCompetitionInline]

class TeamAdmin(RelatedCompetitionAdmin, admin.ModelAdmin):
    list_display = ('__unicode__', 'country', 'print_competitions')

class CompetitionAdmin(admin.ModelAdmin):
    list_display = ('name', 'full_name')

class CircuitAdmin(admin.ModelAdmin):
    list_display = ('name', 'city', 'country', 'opened_in')
<commit_msg>adding DriverCompetitionInline in CompetitionAdmin<commit_after>from django.contrib import admin
from django import forms
from django.conf.urls import url
from django.shortcuts import render
from django.db.models.fields import BLANK_CHOICE_DASH

from .models import Driver, Team, Competition, Circuit, Season, GrandPrix, Race, Result
from .models import DriverCompetition, DriverCompetitionTeam, TeamSeasonRel
from .models import ContenderSeason
import punctuation

lr_diff = lambda l, r: list(set(l).difference(r))
lr_intr = lambda l, r: list(set(l).intersection(r))

class RelatedCompetitionAdmin(object):
    """ Aux class to share print_competitions method between driver and team """
    def print_competitions(self, obj):
        return ', '.join("%s" % competition for competition in obj.competitions.all())
    print_competitions.short_description = 'competitions'

class RaceInline(admin.TabularInline):
    model = Race
    extra = 1

class DriverCompetitionTeamInline(admin.TabularInline):
    model = DriverCompetitionTeam
    extra = 3

class DriverCompetitionInline(admin.TabularInline):
    model = DriverCompetition
    extra = 1

class TeamSeasonInline(admin.TabularInline):
    model = TeamSeasonRel
    extra = 1

class DriverCompetitionInline(admin.TabularInline):
    model = DriverCompetition
    extra = 1

class TeamInline(admin.TabularInline):
    model = Team
    extra = 1

class DriverAdmin(RelatedCompetitionAdmin, admin.ModelAdmin):
    list_display = ('__unicode__', 'country', 'print_competitions')
    list_filter = ('competitions__name',)
    inlines = [DriverCompetitionInline]

class TeamAdmin(RelatedCompetitionAdmin, admin.ModelAdmin):
    list_display = ('__unicode__', 'country', 'print_competitions')

class CompetitionAdmin(admin.ModelAdmin):
    list_display = ('name', 'full_name')
    inlines = [DriverCompetitionInline]

class CircuitAdmin(admin.ModelAdmin):
    list_display = ('name', 'city', 'country', 'opened_in')

{'fraction_non_alphanumeric': 0.09525101763907734, 'fraction_numerical': 0.0027137042062415195, 'mean_word_length': 5.43280977312391, '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': '3051190', 'n_tokens_mistral': 1092, 'n_tokens_neox': 1064, 'n_words': 279}