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

"""
Module for parallel reading writing to file
"""

# import time
import io
from threading import Thread
from requests import get

class Reader(Thread):
    """
    Reader class
    """
    def __init__(self, file_name):
        Thread.__init__(self)
        self.file_name = file_name

    def run(self):
        # print(self.file_name)
        with open(self.file_name) as file:
            for line in file.readlines():
                print("Read " + line)
                # time.sleep(1)

class Writer(Thread):
    """
    Writer class
    """
    def __init__(self, file_name):
        Thread.__init__(self)
        self.file_name = file_name

    def run(self):
        # print(self.file_name)
        with open(self.file_name, 'w') as file:
            for i in range(1, 2000000):
                print("Writing ", i)
                file.write(str(i))
                # time.sleep(1)

def run():
    """
    Run method
    ---
    You can take different files too.

    Reader("file.txt").start()
    Writer("another-file.txt").start()
    """
    Reader("file.txt").start()
    Writer("file.txt").start()


def download(url, file_name):
    """
    function to download file over http
    url : URL of file to be downloaded
    file_name : File name<commit_msg>Removed the comment as per request.<commit_after>#!/usr/bin/env python3

"""
Module for parallel reading writing to file
"""

# import time
import io
from threading import Thread
from requests import get

class Reader(Thread):
    """
    Reader class
    """
    def __init__(self, file_name):
        Thread.__init__(self)
        self.file_name = file_name

    def run(self):
        # print(self.file_name)
        with open(self.file_name) as file:
            for line in file.readlines():
                print("Read " + line)
                # time.sleep(1)

class Writer(Thread):
    """
    Writer class
    """
    def __init__(self, file_name):
        Thread.__init__(self)
        self.file_name = file_name

    def run(self):
        # print(self.file_name)
        with open(self.file_name, 'w') as file:
            for i in range(1, 2000000):
                print("Writing ", i)
                file.write(str(i))

def run():
    """
    Run method
    ---
    You can take different files too.

    Reader("file.txt").start()
    Writer("another-file.txt").start()
    """
    Reader("file.txt").start()
    Writer("file.txt").start()


def download(url, file_name):
    """
    function to download file over http
    url : URL of file to be downloaded
    file_name : File name
{'fraction_non_alphanumeric': 0.12289433384379786, 'fraction_numerical': 0.008039816232771823, 'mean_word_length': 2.125598086124402, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1019233', 'n_tokens_mistral': 819, 'n_tokens_neox': 773, 'n_words': 213}