<commit_before>import os
from openpyxl.cell import coordinate_from_string, column_index_from_string

import openpyxl
import datetime
import csv


def write_us_card(card, worksheet, vertical_position=0, horizontal_position=0):
    card_row_height = 4
    card_column_width = 6
    value = None
    for row in range(card_row_height):
        for column in range(card_column_width):
            my_cell = worksheet.cell(row=row, column=column)
            duplicate_cell_with_offset(my_cell, row=vertical_position * (card_row_height + 1),
                                       column=horizontal_position * (card_column_width + 1))
    my_cell = worksheet.cell(row=0, column=0)
    my_cell.value = card.mmf
    my_cell.offset(0, 2).value = card.feature
    my_cell.offset(0, 4).value = card.project
    my_cell.offset(1, 4).value = card.size
    my_cell.offset(2, 0).value = card.title
    my_cell.offset(3, 0).value = card.date_backlog
    my_cell.offset(3, 2).value = card.date_dev
    my_cell.offset(3, 4).value = card.date_done



def write_us_cards(workbook, cards):
    my_worksheet = workbook.get_sheet_by_name('US')

    vertical_position = 0
    horizontal_position = 0
    for card in cards:
        write_us_card(card, my_worksheet, vertical_position, horizontal_position)

class USCard():

    def __init__(self, mmf='MMF:', feature='Feature:', project='Projet:', size='Taille', title='Titre de la US',
                          date_backlog='Date backlog:', date_dev='Date dev:', date_done='Date done'):
        self.mmf = mmf
        self.feature = feature
        self.project = project
        self.size = size
        self.title = title
        self.date_backlog = date_backlog
        self.date_dev = date_dev
        self.date_done = date_done


def load_cards():
    cards = []

    file_name = os.path.join('test-input-file', 'cards.csv')
    with open(file_name, encoding='utf8') as csv_file:
        csv_reader = csv.reader(csv_file)
        for row in csv_reader:
            new_card = USCard(mmf=row[0], feature=row[1], project=row[2], size=row[3], title=row[4],
                              date_backlog=row[5], date_dev=row[6], date_done=row[7])

            cards.append(new_card)
    return cards


def get_mins_maxs_from_range(range_string):<commit_msg>getting to write all us cards from csv but on a row<commit_after>import os
from openpyxl.cell import coordinate_from_string, column_index_from_string

import openpyxl
import datetime
import csv


def write_us_card(card, worksheet, vertical_position=0, horizontal_position=0):
    card_row_height = 4
    card_column_width = 6
    row_offset = vertical_position * (card_row_height + 1)
    column_offset = horizontal_position * (card_column_width + 1)
    value = None
    for row in range(card_row_height):
        for column in range(card_column_width):
            my_cell = worksheet.cell(row=row, column=column)
            duplicate_cell_with_offset(my_cell, row=row_offset,
                                       column=column_offset)
    my_cell = worksheet.cell(row=row_offset, column=column_offset)
    my_cell.value = card.mmf
    my_cell.offset(0, 2).value = card.feature
    my_cell.offset(0, 4).value = card.project
    my_cell.offset(1, 4).value = card.size
    my_cell.offset(2, 0).value = card.title
    my_cell.offset(3, 0).value = card.date_backlog
    my_cell.offset(3, 2).value = card.date_dev
    my_cell.offset(3, 4).value = card.date_done



def write_us_cards(workbook, cards):
    my_worksheet = workbook.get_sheet_by_name('US')

    vertical_position = 0
    horizontal_position = 0
    for card in cards:
        write_us_card(card, my_worksheet, vertical_position, horizontal_position)
        horizontal_position += 1

class USCard():

    def __init__(self, mmf='MMF:', feature='Feature:', project='Projet:', size='Taille', title='Titre de la US',
                          date_backlog='Date backlog:', date_dev='Date dev:', date_done='Date done'):
        self.mmf = mmf
        self.feature = feature
        self.project = project
        self.size = size
        self.title = title
        self.date_backlog = date_backlog
        self.date_dev = date_dev
        self.date_done = date_done


def load_cards():
    cards = []

    file_name = os.path.join('test-input-file', 'cards.csv')
    with open(file_name, encoding='utf8') as csv_file:
        csv_reader = csv.reader(csv_file)
        for row in csv_reader:
            new_card = USCard(mmf=row[0], feature=row[1], project=row[2], size=row[3], title=row[4],
                              date_backlog=row[5], date_dev=row[6], date_done=row[7])

            cards.append(new_card)
    return cards


def get_mins_maxs_from_range(range_string):
{'fraction_non_alphanumeric': 0.10682492581602374, 'fraction_numerical': 0.01377702416278084, 'mean_word_length': 3.0367835757057313, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3172627', 'n_tokens_mistral': 1588, 'n_tokens_neox': 1530, 'n_words': 316}