<commit_before>from datetime import date
from decimal import Decimal

class ndaTransaction:
    "Contains data of single NDA transaction. Additional information is discarded."
    referenceNumber  = None #reference of transaction
    amount = None #amount of money in transaction
    timestamp = None #date transaction is registered
    eventType = None #type of transaction
    name = None #name of creditor / debitor
    

    def __init__(self, amount, timestamp):
        self.amount      = amount
        self.timestamp   = timestamp

    def __repr__(self):
        return "<ndaTransaction refNum:%s amt:%s time:%s type:%s name:%s>" % (self.referenceNumber, self.amount, self.timestamp, self.eventType, self.name)

def parseLine(line):
    "Parses one line of NDA file. Returns one transaction structure. Input must be an entire line of NDA file, invalid lines are discarded and null is returned"
    #Bypass lines not beginning "T10", "T10" is start of transaction
    if "T10" != line[0:3]:
        return None

    #extract date
    year      = 2000 + int(line[30:32])
    month     = int(line[32:34])
    day       = int(line[34:36])
    timestamp = date(year, month, day)

    #amount
    amount = int(line[87:106])
    amount = Decimal(amount/100)

    transaction = ndaTransaction(amount, timestamp)

    #Event type
    eventType = line[52:86]
    transaction.eventType = eventType.rstrip()

    #name
    name = line[108:142]
    transaction.name = name

    #reference
    reference = line[159:178]
    transaction.referenceNumber = reference.lstrip("0")

    return transaction

<commit_msg>Trim whitespace after name<commit_after>from datetime import date
from decimal import Decimal

class ndaTransaction:
    "Contains data of single NDA transaction. Additional information is discarded."
    referenceNumber  = None #reference of transaction
    amount = None #amount of money in transaction
    timestamp = None #date transaction is registered
    eventType = None #type of transaction
    name = None #name of creditor / debitor
    

    def __init__(self, amount, timestamp):
        self.amount      = amount
        self.timestamp   = timestamp

    def __repr__(self):
        return "<ndaTransaction refNum:%s amt:%s time:%s type:%s name:%s>" % (self.referenceNumber, self.amount, self.timestamp, self.eventType, self.name)

def parseLine(line):
    "Parses one line of NDA file. Returns one transaction structure. Input must be an entire line of NDA file, invalid lines are discarded and null is returned"
    #Bypass lines not beginning "T10", "T10" is start of transaction
    if "T10" != line[0:3]:
        return None

    #extract date
    year      = 2000 + int(line[30:32])
    month     = int(line[32:34])
    day       = int(line[34:36])
    timestamp = date(year, month, day)

    #amount
    amount = int(line[87:106])
    amount = Decimal(amount/100)

    transaction = ndaTransaction(amount, timestamp)

    #Event type
    eventType = line[52:86]
    transaction.eventType = eventType.rstrip()

    #name
    name = line[108:142]
    transaction.name = name.rstrip();

    #reference
    reference = line[159:178]
    transaction.referenceNumber = reference.lstrip("0")

    return transaction


{'fraction_non_alphanumeric': 0.09262117937635073, 'fraction_numerical': 0.030256251929607902, 'mean_word_length': 3.148527528809219, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3588283', 'n_tokens_mistral': 986, 'n_tokens_neox': 903, 'n_words': 311}