<commit_before>from dbt.api import APIObject
from dbt.utils import deep_merge
from dbt.node_types import NodeType

import dbt.clients.jinja

from dbt.contracts.graph.unparsed import UNPARSED_NODE_CONTRACT, \
    UNPARSED_MACRO_CONTRACT, UNPARSED_DOCUMENTATION_FILE_CONTRACT, \
    UNPARSED_BASE_CONTRACT, TIME_CONTRACT

from dbt.logger import GLOBAL_LOGGER as logger  # noqa


# TODO: which of these do we _really_ support? or is it both?
HOOK_CONTRACT = {
    'anyOf': [
        {
            'type': 'object',
            'additionalProperties': False,
            'properties': {
                'sql': {
                    'type': 'string',
                },
                'transaction': {
                    'type': 'boolean',
                },
                'index': {
                    'type': 'integer',
                }
            },
            'required': ['sql', 'transaction'],
        },
        {
            'type': 'string',
        },
    ],
}


CONFIG_CONTRACT = {
    'type': 'object',
    'additionalProperties': True,
    'properties': {
        'enabled': {
            'type': 'boolean',
        },
        'materialized': {
            'type': 'string',
        },
        'persist_docs': {
            'type': 'object',
            'additionalProperties': True,
        },
        'post-hook': {
            'type': 'array',
            'items': HOOK_CONTRACT,
        },
        'pre-hook': {
            'type': 'array',
            'items': HOOK_CONTRACT,
        },
        'vars': {
            'type': 'object',
            'additionalProperties': True,
        },
        'quoting': {
            'type': 'object',
            'additionalProperties': True,
        },
        'column_types': {
            'type': 'object',
            'additionalProperties': True,
        },
        'tags': {
            'anyOf': [
                {
                    'type': 'array',
                    'items': {
                        'type': 'string'
                    },
                },
                {
                    'type': 'string'
                }
            ]
        },
    },
    'required': [
        'enabled', 'materialized', 'persist_docs', 'post-hook', 'pre-hook', 'vars',
        'quoting', 'column_types', 'tags'
    ]
}


#  Note that description must be present, but may be empty.<commit_msg>Update parsed.py<commit_after>from dbt.api import APIObject
from dbt.utils import deep_merge
from dbt.node_types import NodeType

import dbt.clients.jinja

from dbt.contracts.graph.unparsed import UNPARSED_NODE_CONTRACT, \
    UNPARSED_MACRO_CONTRACT, UNPARSED_DOCUMENTATION_FILE_CONTRACT, \
    UNPARSED_BASE_CONTRACT, TIME_CONTRACT

from dbt.logger import GLOBAL_LOGGER as logger  # noqa


# TODO: which of these do we _really_ support? or is it both?
HOOK_CONTRACT = {
    'anyOf': [
        {
            'type': 'object',
            'additionalProperties': False,
            'properties': {
                'sql': {
                    'type': 'string',
                },
                'transaction': {
                    'type': 'boolean',
                },
                'index': {
                    'type': 'integer',
                }
            },
            'required': ['sql', 'transaction'],
        },
        {
            'type': 'string',
        },
    ],
}


CONFIG_CONTRACT = {
    'type': 'object',
    'additionalProperties': True,
    'properties': {
        'enabled': {
            'type': 'boolean',
        },
        'materialized': {
            'type': 'string',
        },
        'persist_docs': {
            'type': 'object',
            'additionalProperties': True,
        },
        'post-hook': {
            'type': 'array',
            'items': HOOK_CONTRACT,
        },
        'pre-hook': {
            'type': 'array',
            'items': HOOK_CONTRACT,
        },
        'vars': {
            'type': 'object',
            'additionalProperties': True,
        },
        'quoting': {
            'type': 'object',
            'additionalProperties': True,
        },
        'column_types': {
            'type': 'object',
            'additionalProperties': True,
        },
        'tags': {
            'anyOf': [
                {
                    'type': 'array',
                    'items': {
                        'type': 'string'
                    },
                },
                {
                    'type': 'string'
                }
            ]
        },
    },
    'required': [
        'enabled', 'materialized', 'persist_docs', 'post-hook',
        'pre-hook', 'vars', 'quoting', 'column_types', 'tags'
    ]
}


#  Note that description must be present, but may be empty.
{'fraction_non_alphanumeric': 0.13602707848529724, 'fraction_numerical': 0.0, 'mean_word_length': 1.282955094157412, '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': '6795534', 'n_tokens_mistral': 1373, 'n_tokens_neox': 1306, 'n_words': 266}