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

import requests


class TrelloClient:
    API_URL = 'https://api.trello.com'
    CREATE_ENDPOINT = API_URL + '/1/cards'
    BOARD_ENDPOINT = API_URL + '/1/boards/ICjijxr4/cards'
    LISTS_ENDPOINT = API_URL + '/1/boards/ICjijxr4/lists'
    LABELS_ENDPOINT = API_URL + '/1/boards/ICjijxr4/labels'
    CARDS_ENDPOINT = API_URL + '/1/cards'
    MEMBERSHIP_ENDPOINT = API_URL + '/1/boards/ICjijxr4/memberships'
    MEMBER_ENPOINT = API_URL + '/1/members'
    HAVE_BUG_FIXE_ME_COLUMN = '58f0c271cbf2d534bd626916'
    FIXED_READY_TO_REBUILD_COLUMN = '5d5a8a50ca7a0189ae8ac5ac'
    RC_BUILDS_COLUMN = '5727778db5367f8b4cb520ca'

    def __init__(self, config):
        self.auth = {'key': config['trello']['key'] or None, 'token': config['trello']['token'] or None}

        # Maps the trello team label to the trello column ID (idList)
        self.team_list_map = {
            'Containers': '5ae1cab495edd80852396c71',
            'Container App': '5e8b36a8060eeb1cb3fa5a9c',
            'Core': '5ae1e3d62a5167779e65e87d',
            'Database Monitoring': '60ec3d30532b9072b44d3900',
            'Integrations': '5ae1e3e2c81fff836d00497e',
            'Triage': '5d9b687492952e6578ecf04d',  # unused
            'Platform': '5d9b687492952e6578ecf04d',
            'Networks': '5e1de8cf867357791ec5ee47',
            'Processes': '5aeca4c8621e4359b9cb9c27',
            'Trace': '5bcf3ffbe0651642ae029038',
            'Tools and Libraries': '5ef373fb33b7b805120d5011',
            'Runtime-Security': '5f3148683b7428276f0f2133',
            'Infra-Integrations': '5f9f9e09af18c18c628d80ee',
            'Remote-Config': '619262c91ae65d40bafb576f',
            'Container-Ecosystems': '627e693a6c58bc2144accc85',
            'Agent-Metrics-Logs': '62a9bbeb1c71b2208581744e',
            'Agent-Shared-Components': '62a9bc0c9ab7f433a5c26f2f',
        }

        # Maps the team to the trello team label
        self.label_team_map = {
            'team/agent-apm': 'Trace',
            'team/agent-core': 'Core',
            'team/agent-platform': 'Platform',
            'team/triage': 'Platform',
            'team/networks': 'Networks',
            'team/processes': 'Processes',
            'team/containers': 'Containers',
            'team/container-app': 'Container App',
            'team/integrations': 'Integrations',
            'team/database-monitoring': 'Database Monitoring',
            'team/intg-tools-libs': 'Tools and Libraries',
            'team/agent-security': 'Runtime-Security',
            'team/infra-integrations': 'Infra-Integrations',
            'team/remote-config': 'Remote-Config',
            'team/container-ecosystems': 'Container-Ecosystems',
            'team/agent-metrics-logs': 'Agent-Metrics-Logs',
            'team/agent-shared-components': 'Agent-Shared-Components',
        }

        # Maps the team to the github team
        self.label_github_team_map = {
            'team/agent-apm': 'agent-apm',
            'team/agent-core': 'agent-core',
            'team/agent-platform': 'agent-platform',
            'team/triage': 'agent-platform',
            'team/networks': 'agent-network',
            'team/processes': 'processes',
            'team/containers': 'container-integrations',
            'team/container-app': 'container-app',
            'team/integrations': 'agent-integrations',
            'team/intg-tools-libs': 'integrations-tools-and-libraries',
            'team/agent-security': 'agent-security',
            'team/infra-integrations': 'infrastructure-integrations',
            'team/remote-config': 'remote-config',
            'team/container-ecosystems': 'container-ecosystems',
            'team/agent-metrics-logs': 'agent-metrics-logs',
            'team/agent-shared-components': 'agent-shared-components',<commit_msg>Fix team assignment for 'agent-metrics-logs' and 'agent-shared-components' (#12418)<commit_after># (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)

import requests


class TrelloClient:
    API_URL = 'https://api.trello.com'
    CREATE_ENDPOINT = API_URL + '/1/cards'
    BOARD_ENDPOINT = API_URL + '/1/boards/ICjijxr4/cards'
    LISTS_ENDPOINT = API_URL + '/1/boards/ICjijxr4/lists'
    LABELS_ENDPOINT = API_URL + '/1/boards/ICjijxr4/labels'
    CARDS_ENDPOINT = API_URL + '/1/cards'
    MEMBERSHIP_ENDPOINT = API_URL + '/1/boards/ICjijxr4/memberships'
    MEMBER_ENPOINT = API_URL + '/1/members'
    HAVE_BUG_FIXE_ME_COLUMN = '58f0c271cbf2d534bd626916'
    FIXED_READY_TO_REBUILD_COLUMN = '5d5a8a50ca7a0189ae8ac5ac'
    RC_BUILDS_COLUMN = '5727778db5367f8b4cb520ca'

    def __init__(self, config):
        self.auth = {'key': config['trello']['key'] or None, 'token': config['trello']['token'] or None}

        # Maps the trello team label to the trello column ID (idList)
        self.team_list_map = {
            'Containers': '5ae1cab495edd80852396c71',
            'Container App': '5e8b36a8060eeb1cb3fa5a9c',
            'Core': '5ae1e3d62a5167779e65e87d',
            'Database Monitoring': '60ec3d30532b9072b44d3900',
            'Integrations': '5ae1e3e2c81fff836d00497e',
            'Triage': '5d9b687492952e6578ecf04d',  # unused
            'Platform': '5d9b687492952e6578ecf04d',
            'Networks': '5e1de8cf867357791ec5ee47',
            'Processes': '5aeca4c8621e4359b9cb9c27',
            'Trace': '5bcf3ffbe0651642ae029038',
            'Tools and Libraries': '5ef373fb33b7b805120d5011',
            'Runtime-Security': '5f3148683b7428276f0f2133',
            'Infra-Integrations': '5f9f9e09af18c18c628d80ee',
            'Remote-Config': '619262c91ae65d40bafb576f',
            'Container-Ecosystems': '627e693a6c58bc2144accc85',
            'Agent-Metrics-Logs': '62a9bbeb1c71b2208581744e',
            'Agent-Shared-Components': '62a9bc0c9ab7f433a5c26f2f',
        }

        # Maps the team to the trello team label
        self.label_team_map = {
            'team/agent-apm': 'Trace',
            'team/agent-core': 'Core',
            'team/agent-platform': 'Platform',
            'team/triage': 'Platform',
            'team/networks': 'Networks',
            'team/processes': 'Processes',
            'team/containers': 'Containers',
            'team/container-app': 'Container App',
            'team/integrations': 'Integrations',
            'team/database-monitoring': 'Database Monitoring',
            'team/intg-tools-libs': 'Tools and Libraries',
            'team/agent-security': 'Runtime-Security',
            'team/infra-integrations': 'Infra-Integrations',
            'team/remote-config': 'Remote-Config',
            'team/container-ecosystems': 'Container-Ecosystems',
            'team/agent-metrics-logs': 'Agent-Metrics-Logs',
            'team/agent-shared-components': 'Agent-Shared-Components',
        }

        # Maps the team to the github team
        self.label_github_team_map = {
            'team/agent-apm': 'agent-apm',
            'team/agent-platform': 'agent-platform',
            'team/triage': 'agent-platform',
            'team/networks': 'agent-network',
            'team/processes': 'processes',
            'team/containers': 'container-integrations',
            'team/container-app': 'container-app',
            'team/integrations': 'agent-integrations',
            'team/intg-tools-libs': 'integrations-tools-and-libraries',
            'team/agent-security': 'agent-security',
            'team/infra-integrations': 'infrastructure-integrations',
            'team/remote-config': 'remote-config',
            'team/container-ecosystems': 'container-ecosystems',
            'team/agent-metrics-logs': 'agent-metrics-logs',
            'team/agent-shared-components': 'agent-shared-components',
            # 'agent-core' must be after 'agent-metrics-logs' and 'agent-shared-components'
            # as the team of a user is the first team available.
            'team/agent-core': 'agent-core',
{'fraction_non_alphanumeric': 0.13352307882687786, 'fraction_numerical': 0.08055933671575301, 'mean_word_length': 2.6048171275646745, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '133022', 'n_tokens_mistral': 3086, 'n_tokens_neox': 2804, 'n_words': 424}