<commit_before>"""
mbed SDK
Copyright (c) 2011-2016 ARM Limited

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Author: <NAME> <<EMAIL>>
"""

import os
import re
import json
from os import walk
try:
    from contextlib import suppress
except ImportError:
    from contextlib import contextmanager
    @contextmanager
    def suppress(*excs):
        try:
            yield
        except excs:
            pass
from mbed_greentea.mbed_common_api import run_cli_process
from mbed_greentea.mbed_greentea_log import gt_logger


## Information about some properties of targets (platforms)
#
#  "default" entry is used to fetch "global" properties if they are not
#  specified with each platform
#

TARGET_INFO_MAPPING = {
    "default" : {
        "program_cycle_s": 4,
        "binary_type": ".bin",
        "copy_method": "default",
        "reset_method": "default"
    },

    "K64F" : {
        "yotta_targets": [
                {
                    "yotta_target": "frdm-k64f-gcc",
                    "mbed_toolchain": "GCC_ARM"
                },
                {
                    "yotta_target": "frdm-k64f-armcc",
                    "mbed_toolchain": "ARM"
                }
             ],
        "properties" : {
                "binary_type": ".bin",
                "copy_method": "default",
                "reset_method": "default",
                "program_cycle_s": 4
            }
    },
    "NUCLEO_F401RE" : {
        "yotta_targets": [
                {
                    "yotta_target": "st-nucleo-f401re-gcc",
                    "mbed_toolchain": "GCC_ARM"
                }
             ],
        "properties" : {
                "binary_type": ".bin",
                "copy_method": "cp",
                "reset_method": "default",
                "program_cycle_s": 4
            }<commit_msg>set forced_reset_timeout 10 sec for RAPIDIOT_K64F<commit_after>"""
mbed SDK
Copyright (c) 2011-2016 ARM Limited

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Author: <NAME> <<EMAIL>>
"""

import os
import re
import json
from os import walk
try:
    from contextlib import suppress
except ImportError:
    from contextlib import contextmanager
    @contextmanager
    def suppress(*excs):
        try:
            yield
        except excs:
            pass
from mbed_greentea.mbed_common_api import run_cli_process
from mbed_greentea.mbed_greentea_log import gt_logger


## Information about some properties of targets (platforms)
#
#  "default" entry is used to fetch "global" properties if they are not
#  specified with each platform
#

TARGET_INFO_MAPPING = {
    "default" : {
        "program_cycle_s": 4,
        "binary_type": ".bin",
        "copy_method": "default",
        "reset_method": "default"
    },

    "K64F" : {
        "yotta_targets": [
                {
                    "yotta_target": "frdm-k64f-gcc",
                    "mbed_toolchain": "GCC_ARM"
                },
                {
                    "yotta_target": "frdm-k64f-armcc",
                    "mbed_toolchain": "ARM"
                }
             ],
        "properties" : {
                "binary_type": ".bin",
                "copy_method": "default",
                "reset_method": "default",
                "program_cycle_s": 4
            }
    },
    "RAPIDIOT_K64F" : {
        "properties" : {
                "forced_reset_timeout":10
            }
    },
    "NUCLEO_F401RE" : {
        "yotta_targets": [
                {
                    "yotta_target": "st-nucleo-f401re-gcc",
                    "mbed_toolchain": "GCC_ARM"
                }
             ],
        "properties" : {
                "binary_type": ".bin",
                "copy_method": "cp",
                "reset_method": "default",
                "program_cycle_s": 4
            }
{'fraction_non_alphanumeric': 0.0949579831932773, 'fraction_numerical': 0.013025210084033614, 'mean_word_length': 1.876737160120846, 'pattern_counts': {'":': 41, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3290262', 'n_tokens_mistral': 1442, 'n_tokens_neox': 1324, 'n_words': 394}