<commit_before>import csv

import xlrd


def convert_excel_to_csv(file_path):

    new_file_path = file_path.split('.')[0] + '_processed.csv'
    data = _primitive_read_excel(file_path=file_path)

    with open(new_file_path, 'wb') as file:
        csv.writer(file).writerows(data)

    return new_file_path


def _primitive_read_excel(file_path):

    """
    Returns List.

    Read an XLS or XLSX file.

    Parameters
    ----------
    file_path : String
        File name or path.
    """

    data = []
    worksheet = xlrd.open_workbook(file_path).sheet_by_index(0)

    for row in worksheet.get_rows():
        processed_row = list()
        for cell in row:
            if not xlrd.sheet.ctype_text[cell.ctype] == 'empty':
                processed_row.append(unicode(cell.value))
                continue
        data.append(processed_row)

    return data


if __name__ == '__main__':
    file_path = ''
    convert_excel_to_csv(file_path)
<commit_msg>Deleted development code<commit_after>import csv

import xlrd


def convert_excel_to_csv(file_path):

    new_file_path = file_path.split('.')[0] + '_processed.csv'
    data = _primitive_read_excel(file_path=file_path)

    with open(new_file_path, 'wb') as file:
        csv.writer(file).writerows(data)

    return new_file_path


def _primitive_read_excel(file_path):

    """
    Returns List.

    Read an XLS or XLSX file.

    Parameters
    ----------
    file_path : String
        File name or path.
    """

    data = []
    worksheet = xlrd.open_workbook(file_path).sheet_by_index(0)

    for row in worksheet.get_rows():
        processed_row = list()
        for cell in row:
            if not xlrd.sheet.ctype_text[cell.ctype] == 'empty':
                processed_row.append(unicode(cell.value))
                continue
        data.append(processed_row)

    return data

{'fraction_non_alphanumeric': 0.1078167115902965, 'fraction_numerical': 0.00215633423180593, 'mean_word_length': 2.495291902071563, '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': '1338332', 'n_tokens_mistral': 650, 'n_tokens_neox': 609, 'n_words': 123}