<commit_before>#!/usr/bin/env python


import os
import shutil
import subprocess

# yolo
GIT_VERSION = subprocess.check_output('git describe', shell=True).split('-')[0]
BUNDLE_NAME = 'bean-arduino-core-{}'.format(GIT_VERSION)

THIS_DIR = os.path.abspath(os.path.dirname(__file__))
TMP_DIR = os.path.join(THIS_DIR, '..', 'tmp')
EXAMPLES_DIR = os.path.join(THIS_DIR, '..', 'examples')
BUNDLE_PATH = os.path.join(TMP_DIR, BUNDLE_NAME)
BUNDLE_HARDWARE_PATH = os.path.join(BUNDLE_PATH, 'hardware', 'LightBlue-Bean')
BUNDLE_EXAMPLES_PATH = os.path.join(BUNDLE_PATH, 'examples', 'LightBlue-Bean')
CORE_PATH = os.path.join(THIS_DIR, '..', 'hardware', 'bean')


def clean():
    shutil.rmtree(BUNDLE_PATH, ignore_errors=True)
    os.makedirs(BUNDLE_HARDWARE_PATH)
    os.makedirs(BUNDLE_EXAMPLES_PATH)


def copy_core():
    shutil.copytree(CORE_PATH, os.path.join(BUNDLE_HARDWARE_PATH, 'bean'))


def copy_examples():
    for dirpath, dirnames, filenames in os.walk(EXAMPLES_DIR):
        for f in filenames:
            category = dirpath.split('/')[-1].capitalize()
            category_path = os.path.join(BUNDLE_EXAMPLES_PATH, category)
            if not os.path.exists(category_path):<commit_msg>bundle: fix issue related to reading git tag<commit_after>#!/usr/bin/env python


import os
import shutil
import subprocess

# yolo
GIT_VERSION = subprocess.check_output('git describe', shell=True).split('-')[0].strip('\r\n')
BUNDLE_NAME = 'bean-arduino-core-{}'.format(GIT_VERSION)

THIS_DIR = os.path.abspath(os.path.dirname(__file__))
TMP_DIR = os.path.join(THIS_DIR, '..', 'tmp')
EXAMPLES_DIR = os.path.join(THIS_DIR, '..', 'examples')
BUNDLE_PATH = os.path.join(TMP_DIR, BUNDLE_NAME)
BUNDLE_HARDWARE_PATH = os.path.join(BUNDLE_PATH, 'hardware', 'LightBlue-Bean')
BUNDLE_EXAMPLES_PATH = os.path.join(BUNDLE_PATH, 'examples', 'LightBlue-Bean')
CORE_PATH = os.path.join(THIS_DIR, '..', 'hardware', 'bean')


def clean():
    shutil.rmtree(BUNDLE_PATH, ignore_errors=True)
    os.makedirs(BUNDLE_HARDWARE_PATH)
    os.makedirs(BUNDLE_EXAMPLES_PATH)


def copy_core():
    shutil.copytree(CORE_PATH, os.path.join(BUNDLE_HARDWARE_PATH, 'bean'))


def copy_examples():
    for dirpath, dirnames, filenames in os.walk(EXAMPLES_DIR):
        for f in filenames:
            category = dirpath.split('/')[-1].capitalize()
            category_path = os.path.join(BUNDLE_EXAMPLES_PATH, category)
            if not os.path.exists(category_path):
{'fraction_non_alphanumeric': 0.1504315659679408, 'fraction_numerical': 0.0016440608302507192, 'mean_word_length': 4.754137115839243, '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': '5958286', 'n_tokens_mistral': 955, 'n_tokens_neox': 969, 'n_words': 144}