<commit_before>from django.shortcuts import render
from django.http import StreamingHttpResponse
from subprocess import Popen, PIPE, STDOUT
from easyscnvsim import settings


def hello():
    p = Popen('java -jar /Users/abdelrahman/Downloads/scnvsim_1.3.1/normgenomsim_1.3.1.jar -o /Users/abdelrahman/Desktop/test -v /Users/abdelrahman/Desktop/hg19/chrom_lengths_hg19.txt -n /Users/abdelrahman/Desktop/hg19/hg19.fa' , \
              stdout = PIPE, stderr = STDOUT, shell = True)
    while True:
        line = p.stdout.readline()
        if not line: break
        yield line + '<br>'


# Create your views here.
def home(request):
    context = {'reference_ready': settings.REFERENCE_READY}
    return render(request, 'webapp/index.html', context)


def simulation_log(request):
    return StreamingHttpResponse(hello())<commit_msg>fixing memory limit issue in java<commit_after>from django.shortcuts import render
from django.http import StreamingHttpResponse
from subprocess import Popen, PIPE, STDOUT
from easyscnvsim import settings


def run_simulation():
    p = Popen('java -Xmx8g -jar /Users/abdelrahman/Downloads/scnvsim_1.3.1/normgenomsim_1.3.1.jar -o /Users/abdelrahman/Desktop/test -v /Users/abdelrahman/Desktop/hg19/chrom_lengths_hg19.txt -n /Users/abdelrahman/Desktop/hg19/hg19.fa' , \
              stdout=PIPE, stderr=STDOUT, shell=True)
    while True:
        line = p.stdout.readline()
        if not line: break
        yield line + '<br>'


# Create your views here.
def home(request):
    context = {'reference_ready': settings.REFERENCE_READY}
    return render(request, 'webapp/index.html', context)


def simulation_log(request):
    return StreamingHttpResponse(run_simulation())
{'fraction_non_alphanumeric': 0.10720562390158173, 'fraction_numerical': 0.01698886936145284, 'mean_word_length': 3.824858757062147, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1405905', 'n_tokens_mistral': 595, 'n_tokens_neox': 560, 'n_words': 130}