<commit_before>from bedgraph_utils import *
import sys
import fileinput
import csv


def add_column(input, output, source_index=BED_COL_NAME, factor=1000.0):
    """
    Adds a score column to a bed file by multiplying the
    value of one column by a factor
    :param input: An input stream or open file
    :param output: An output stream
    :param source_index: Column index containing the source value
    :param factor: Value by which to multiply
    :return:
    """
    reader = csv.reader(input, delimiter='\t')
    writer = csv.writer(output, delimiter='\t')
    for row in reader:
        row.append(float(row[BED_COL_NAME]) * factor)
        writer.writerow(row)

if __name__ == '__main__':
    add_column(fileinput.input(mode='rb'), sys.stdout)<commit_msg>Script to add score column to bed files<commit_after>from bedgraph_utils import *
import sys
import fileinput
import csv


def add_column(input, output, source_index=BED_COL_NAME, factor=1000.0):
    """
    Adds a score column to a bed file by multiplying the
    value of one column by a factor
    :param input: An input stream or open file
    :param output: An output stream
    :param source_index: Column index containing the source value
    :param factor: Value by which to multiply
    :return:
    """
    reader = csv.reader(input, delimiter='\t')
    writer = csv.writer(output, delimiter='\t')
    for row in reader:
        row.append(int(float(row[BED_COL_NAME]) * factor))
        writer.writerow(row)

if __name__ == '__main__':
    add_column(fileinput.input(mode='rb'), sys.stdout)
{'fraction_non_alphanumeric': 0.09548058561425843, 'fraction_numerical': 0.006365372374283896, 'mean_word_length': 3.6508875739644973, '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': '4140629', 'n_tokens_mistral': 492, 'n_tokens_neox': 472, 'n_words': 164}