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

from __future__ import print_function
from time import strftime, localtime
import datetime
import xlsxwriter


def create_excel_report(meterId, sDate, eDate, OnePhase, hProfile, dProfile, 
                       hEvents, dEvents):
    """ Creates the excel file
    """
    dest_filename = 'static/reports/' + meterId + '_' + sDate + '_' + eDate + '.xlsx'
    workbook = xlsxwriter.Workbook(dest_filename)
    
    #-----------------
    #Excel Formats
    #-----------------
    sDateObj = datetime.datetime.strptime(sDate, '%Y-%m-%d')
    eDateObj = datetime.datetime.strptime(eDate, '%Y-%m-%d')<commit_msg>Create static/reports if directory does not exist<commit_after>import os
import datetime
import xlsxwriter


def create_excel_report(meterId, sDate, eDate, OnePhase, hProfile, dProfile, 
                       hEvents, dEvents):
    """ Creates the excel file
    """
    dest_path = 'static/reports/'
    if not os.path.exists(dest_path):
        os.makedirs(dest_path)
    dest_filename = dest_path + meterId + '_' + sDate + '_' + eDate + '.xlsx'
    workbook = xlsxwriter.Workbook(dest_filename)
    
    #-----------------
    #Excel Formats
    #-----------------
    sDateObj = datetime.datetime.strptime(sDate, '%Y-%m-%d')
    eDateObj = datetime.datetime.strptime(eDate, '%Y-%m-%d')
{'fraction_non_alphanumeric': 0.16741405082212257, 'fraction_numerical': 0.0007473841554559044, 'mean_word_length': 2.5898123324396782, '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': '5742708', 'n_tokens_mistral': 443, 'n_tokens_neox': 425, 'n_words': 90}