<commit_before>'''
This file is a part of BreezyNS - a simple, general-purpose 2D airflow calculator.

Copyright (c) 2013, <NAME>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.



Created on 04 Sep 2013

@author: AlphanumericSheepPig
'''




def floatRange(start , stop= None, step = 1.0):
    ''' Generator object to mimic behaviour of range, but with floats. '''
    if stop == None:
        startPoint = 0.0
        stopPoint = start
    else:
        startPoint = start
        stopPoint = stop
    current = 0
    value = startPoint + current*step
    while value<stopPoint:
        yield startPoint + current*step
        current += 1
        value = startPoint + current*step


def saveFile(filename,contents, path = ''):
    if len(path) > 0 and not path[-1] in ['\\','/'] :
        path += '/'         
    try:
        file = open(path + filename, 'w')
        for line in contents:
            file.write(line+'\n')
        file.close()
        return True
    except IOError:
        print ('Encountered error while trying to save file '+filename)
        return False
    
    <commit_msg>Added a function that removes duplicates from a list<commit_after>'''
This file is a part of BreezyNS - a simple, general-purpose 2D airflow calculator.

Copyright (c) 2013, <NAME>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.



Created on 04 Sep 2013

@author: AlphanumericSheepPig
'''




def floatRange(start , stop= None, step = 1.0):
    ''' 
    Generator object to mimic behaviour of range, but with floats. 
    '''
    if stop == None:
        startPoint = 0.0
        stopPoint = start
    else:
        startPoint = start
        stopPoint = stop
    current = 0
    value = startPoint + current*step
    while value<stopPoint:
        yield startPoint + current*step
        current += 1
        value = startPoint + current*step



def removeDuplicates(l):
    '''
    Removes duplicates from a list
    '''
    newList = []
    for element in l:
        if not element in newList:
            newList.append(element)
    return newList 


def saveFile(filename,contents, path = ''):
    if len(path) > 0 and not path[-1] in ['\\','/'] :
        path += '/'         
    try:
        file = open(path + filename, 'w')
        for line in contents:
            file.write(line+'\n')
        file.close()
        return True
    except IOError:
        print ('Encountered error while trying to save file '+filename)
        return False
    
    
{'fraction_non_alphanumeric': 0.08104238258877434, 'fraction_numerical': 0.010882016036655211, 'mean_word_length': 2.708067940552017, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5080828', 'n_tokens_mistral': 985, 'n_tokens_neox': 915, 'n_words': 410}