<commit_before>import graphene
from graphene_django.filter import DjangoFilterConnectionField
from graphene_django.types import DjangoObjectType

from treeherder.model.models import *


class JobDetailGraph(DjangoObjectType):
    class Meta:
        model = JobDetail
        filter_fields = {
            'url': ('exact', 'icontains', 'iendswith', 'endswith')
        }
        interfaces = (graphene.relay.Node, )


class JobGraph(DjangoObjectType):
    class Meta:
        model = Job
        filter_fields = {
            'result': ['exact'],
            'tier': ['exact', 'lt'],
        }
        interfaces = (graphene.relay.Node, )

    job_details = DjangoFilterConnectionField(JobDetailGraph)

    def resolve_job_details(self, args, context, info):
        return JobDetail.objects.filter(job=self, **args)


class BuildPlatformGraph(DjangoObjectType):
    class Meta:
        model = BuildPlatform


class MachinePlatformGraph(DjangoObjectType):
    class Meta:
        model = MachinePlatform


class MachineGraph(DjangoObjectType):
    class Meta:
        model = Machine


class JobTypeGraph(DjangoObjectType):
    class Meta:
        model = JobType


class JobGroupGraph(DjangoObjectType):
    class Meta:
        model = JobGroup


class JobLogGraph(DjangoObjectType):
    class Meta:
        model = JobLog


class FailureLineGraph(DjangoObjectType):
    class Meta:
        model = FailureLine


class ProductGraph(DjangoObjectType):<commit_msg>Bug 1373008 - Add support for getting the FailureLine Group via GraphQL<commit_after>import graphene
from graphene_django.filter import DjangoFilterConnectionField
from graphene_django.types import DjangoObjectType

from treeherder.model.models import *


class JobDetailGraph(DjangoObjectType):
    class Meta:
        model = JobDetail
        filter_fields = {
            'url': ('exact', 'icontains', 'iendswith', 'endswith')
        }
        interfaces = (graphene.relay.Node, )


class JobGraph(DjangoObjectType):
    class Meta:
        model = Job
        filter_fields = {
            'result': ['exact'],
            'tier': ['exact', 'lt'],
        }
        interfaces = (graphene.relay.Node, )

    job_details = DjangoFilterConnectionField(JobDetailGraph)

    def resolve_job_details(self, args, context, info):
        return JobDetail.objects.filter(job=self, **args)


class BuildPlatformGraph(DjangoObjectType):
    class Meta:
        model = BuildPlatform


class MachinePlatformGraph(DjangoObjectType):
    class Meta:
        model = MachinePlatform


class MachineGraph(DjangoObjectType):
    class Meta:
        model = Machine


class JobTypeGraph(DjangoObjectType):
    class Meta:
        model = JobType


class JobGroupGraph(DjangoObjectType):
    class Meta:
        model = JobGroup


class JobLogGraph(DjangoObjectType):
    class Meta:
        model = JobLog


class FailureLineGraph(DjangoObjectType):
    class Meta:
        model = FailureLine


class GroupGraph(DjangoObjectType):
    class Meta:
        model = Group


class ProductGraph(DjangoObjectType):
{'fraction_non_alphanumeric': 0.08425865447419988, 'fraction_numerical': 0.0022860875244937948, 'mean_word_length': 3.1058981233243967, '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': '5268762', 'n_tokens_mistral': 909, 'n_tokens_neox': 840, 'n_words': 205}