<commit_before>"""Script to convert fuel to energy service
"""
import os
import logging
import warnings
import numpy as np
from energy_demand.technologies import tech_related
from energy_demand.initalisations import helpers

def write_service_fueltype_by_p(path_to_txt, data):
    """Write out function

    Arguments
    ----------
    path_to_txt : str
        Path to txt file
    data : dict
        Data to write out
    """
    file = open(path_to_txt, "w")
    file.write("{}, {}, {}".format(
        'service', 'fueltype', 'service_p') + '\n')

    for service, fueltypes in data.items():
        for fueltype, service_p in fueltypes.items():
            file.write(
                "{}, {}, {}".format(
                    service, fueltype, float(service_p)) + '\n')

    file.close()
    return

def write_service_fueltype_tech_by_p(path_to_txt, data):
    """Write out function

    Arguments
    ----------
    path_to_txt : str
        Path to txt file
    data : dict
        Data to write out
    """
    file = open(path_to_txt, "w")
    file.write("{}, {}, {}, {}".format(
        'service', 'fueltype', 'technology', 'service_p') + '\n'
              )

    for service, fueltype_tech in data.items():
        for fueltype, tech_list in fueltype_tech.items():
            if tech_list == {}:
                file.write("{}, {}, {}, {}".format(
                    service, fueltype, "None", 0) + '\n') #None and 0
            else:
                for tech, service_p in tech_list.items():
                    file.write("{}, {}, {}, {}".format(
                        service, fueltype, tech, float(service_p)) + '\n')

    file.close()
    return

def write_service_tech_by_p(path_to_txt, data):
    """Write out function

    Arguments
    ----------
    path_to_txt : str
        Path to txt file
    data : dict
        Data to write out
    """
    file = open(path_to_txt, "w")
    file.write("{}, {}, {}".format(
        'enduse', 'technology', 'service_p') + '\n'
              )

    for enduse, technologies in data.items():
        for tech, service_p in technologies.items():
            file.write("{}, {}, {}".format(
                str.strip(enduse), str.strip(tech), float(service_p)) + '\n'
                      )

    file.close()
    return
<commit_msg>- removed writing out functions<commit_after>"""Script to convert fuel to energy service
"""
import logging
import warnings
import numpy as np
from energy_demand.technologies import tech_related
from energy_demand.initalisations import helpers

'''def write_service_fueltype_by_p(path_to_txt, data):
    """Write out function

    Arguments
    ----------
    path_to_txt : str
        Path to txt file
    data : dict
        Data to write out
    """
    file = open(path_to_txt, "w")
    file.write("{}, {}, {}".format(
        'service', 'fueltype', 'service_p') + '\n')

    for service, fueltypes in data.items():
        for fueltype, service_p in fueltypes.items():
            file.write(
                "{}, {}, {}".format(
                    service, fueltype, float(service_p)) + '\n')

    file.close()
    return

def write_service_fueltype_tech_by_p(path_to_txt, data):
    """Write out function

    Arguments
    ----------
    path_to_txt : str
        Path to txt file
    data : dict
        Data to write out
    """
    file = open(path_to_txt, "w")
    file.write("{}, {}, {}, {}".format(
        'service', 'fueltype', 'technology', 'service_p') + '\n'
              )

    for service, fueltype_tech in data.items():
        for fueltype, tech_list in fueltype_tech.items():
            if tech_list == {}:
                file.write("{}, {}, {}, {}".format(
                    service, fueltype, "None", 0) + '\n') #None and 0
            else:
                for tech, service_p in tech_list.items():
                    file.write("{}, {}, {}, {}".format(
                        service, fueltype, tech, float(service_p)) + '\n')

    file.close()
    return

def write_service_tech_by_p(path_to_txt, data):
    """Write out function

    Arguments
    ----------
    path_to_txt : str
        Path to txt file
    data : dict
        Data to write out
    """
    file = open(path_to_txt, "w")
    file.write("{}, {}, {}".format(
        'enduse', 'technology', 'service_p') + '\n'
              )

    for enduse, technologies in data.items():
        for tech, service_p in technologies.items():
            file.write("{}, {}, {}".format(
                str.strip(enduse), str.strip(tech), float(service_p)) + '\n'
                      )

    file.close()
    return'''

{'fraction_non_alphanumeric': 0.15182450043440487, 'fraction_numerical': 0.0008688097306689834, 'mean_word_length': 1.9709677419354839, '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': '2355214', 'n_tokens_mistral': 1400, 'n_tokens_neox': 1336, 'n_words': 368}