<commit_before>"""
Dkron Job Object
"""
import json


JOB_VALID_FIELDS = [
    "name",
    "schedule",
    "shell",
    "command",
    "owner",
    "owner_email",
    "success_count",
    "error_count",
    "last_success",
    "last_error",
    "disabled",
    "tags",
    "retries",
    "dependent_jobs",
    "parent_job",
]

JOB_READ_ONLY_FIELDS = [
    "success_count",
    "error_count",
    "last_success",
    "last_error",
    "dependent_jobs",
]


class DkronJob(dict):
    """
    Object that represents a DkronJob
    """
    def __init__(self, client, **kwargs):
        super(DkronJob, self).__init__(**kwargs)
        self._client = client

    def __getattr__(self, name):
        if name in JOB_VALID_FIELDS or name.startswith("_"):
            return self[name]
        raise KeyError("%s not a valid job field" % name)


    def __setattr__(self, name, value):
        if name in JOB_VALID_FIELDS or name.startswith("_"):
            if name in JOB_READ_ONLY_FIELDS:<commit_msg>Update valid job fields to include additions from 0.9.2 update<commit_after>"""
Dkron Job Object
"""
import json


JOB_VALID_FIELDS = [
    "name",
    "schedule",
    "shell",
    "command",
    "owner",
    "owner_email",
    "success_count",
    "error_count",
    "last_success",
    "last_error",
    "disabled",
    "tags",
    "retries",
    "dependent_jobs",
    "parent_job",
    "processors",
    "concurrency"
]

JOB_READ_ONLY_FIELDS = [
    "success_count",
    "error_count",
    "last_success",
    "last_error",
    "dependent_jobs",
]


class DkronJob(dict):
    """
    Object that represents a DkronJob
    """
    def __init__(self, client, **kwargs):
        super(DkronJob, self).__init__(**kwargs)
        self._client = client

    def __getattr__(self, name):
        if name in JOB_VALID_FIELDS or name.startswith("_"):
            return self[name]
        raise KeyError("%s not a valid job field" % name)


    def __setattr__(self, name, value):
        if name in JOB_VALID_FIELDS or name.startswith("_"):
            if name in JOB_READ_ONLY_FIELDS:
{'fraction_non_alphanumeric': 0.12963855421686746, 'fraction_numerical': 0.0014457831325301205, 'mean_word_length': 2.747292418772563, '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': '176835', 'n_tokens_mistral': 732, 'n_tokens_neox': 715, 'n_words': 162}