<commit_before># (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
from datetime import datetime
from uuid import uuid4

from ..utils import (
    create_file,
    dir_exists,
    ensure_parent_dir_exists,
    path_join,
    read_file,
    read_file_binary,
    write_file,
    write_file_binary,
)
from .utils import kebab_case_name, normalize_package_name

TEMPLATES_DIR = path_join(os.path.dirname(os.path.abspath(__file__)), 'templates', 'integration')
BINARY_EXTENSIONS = ('.png',)
SIMPLE_NAME = r'^\w+$'


def get_valid_templates():
    return sorted(os.listdir(TEMPLATES_DIR))


def construct_template_fields(integration_name, repo_choice, **kwargs):
    normalized_integration_name = normalize_package_name(integration_name)
    check_name_kebab = kebab_case_name(integration_name)

    datadog_checks_base_req = 'datadog-checks-base[deps]>=6.6.0'
    third_party_install_info = f"""\
To install the {integration_name} check on your host:


1. Install the [developer toolkit]
(https://docs.datadoghq.com/developers/integrations/new_check_howto/#developer-toolkit)<commit_msg>remove marketplace from type (#8649)<commit_after># (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
from datetime import datetime
from uuid import uuid4

from ..utils import (
    create_file,
    dir_exists,
    ensure_parent_dir_exists,
    path_join,
    read_file,
    read_file_binary,
    write_file,
    write_file_binary,
)
from .utils import kebab_case_name, normalize_package_name

TEMPLATES_DIR = path_join(os.path.dirname(os.path.abspath(__file__)), 'templates', 'integration')
BINARY_EXTENSIONS = ('.png',)
SIMPLE_NAME = r'^\w+$'
EXCLUDE_TEMPLATES = {"marketplace"}


def get_valid_templates():
    templates = [template for template in os.listdir(TEMPLATES_DIR) if template not in EXCLUDE_TEMPLATES]
    return sorted(templates)


def construct_template_fields(integration_name, repo_choice, **kwargs):
    normalized_integration_name = normalize_package_name(integration_name)
    check_name_kebab = kebab_case_name(integration_name)

    datadog_checks_base_req = 'datadog-checks-base[deps]>=6.6.0'
    third_party_install_info = f"""\
To install the {integration_name} check on your host:


1. Install the [developer toolkit]
(https://docs.datadoghq.com/developers/integrations/new_check_howto/#developer-toolkit)
{'fraction_non_alphanumeric': 0.0979276716781796, 'fraction_numerical': 0.009752133279154815, 'mean_word_length': 5.411458333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '1559727', 'n_tokens_mistral': 872, 'n_tokens_neox': 807, 'n_words': 178}