<commit_before>#!/usr/bin/env python
# Copyright (C) 2010-2012 Cuckoo Sandbox Developers.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.

import os
import sys
import logging
import argparse
try:
    from jinja2.loaders import FileSystemLoader
    from jinja2.environment import Environment
except ImportError:
    print "ERROR: Jinja2 library is missing"
    sys.exit(1)
try:
    from bottle import route, run, static_file, redirect, request, HTTPError
except ImportError:
    print "ERROR: Bootle library is missing"
    sys.exit(1)

logging.basicConfig()
sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), ".."))

from lib.cuckoo.core.database import Database
from lib.cuckoo.common.constants import CUCKOO_ROOT
from lib.cuckoo.common.utils import store_temp_file

env = Environment()
env.loader = FileSystemLoader(os.path.join(CUCKOO_ROOT, "data", "html"))

@route("/")
def index():
    context = {}
    template = env.get_template("submit.html")
    return template.render({"context" : context})

@route("/browse")
def browse():
    db = Database()
    rows = db.list_tasks()

    tasks = []
    for row in rows:
        task = {
            "id" : row.id,
            "target" : row.target,
            "category" : row.category,
            "status" : row.status,
            "added_on" : row.added_on<commit_msg>Typo fix<commit_after>#!/usr/bin/env python
# Copyright (C) 2010-2012 Cuckoo Sandbox Developers.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.

import os
import sys
import logging
import argparse
try:
    from jinja2.loaders import FileSystemLoader
    from jinja2.environment import Environment
except ImportError:
    print "ERROR: Jinja2 library is missing"
    sys.exit(1)
try:
    from bottle import route, run, static_file, redirect, request, HTTPError
except ImportError:
    print "ERROR: Bottle library is missing"
    sys.exit(1)

logging.basicConfig()
sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), ".."))

from lib.cuckoo.core.database import Database
from lib.cuckoo.common.constants import CUCKOO_ROOT
from lib.cuckoo.common.utils import store_temp_file

env = Environment()
env.loader = FileSystemLoader(os.path.join(CUCKOO_ROOT, "data", "html"))

@route("/")
def index():
    context = {}
    template = env.get_template("submit.html")
    return template.render({"context" : context})

@route("/browse")
def browse():
    db = Database()
    rows = db.list_tasks()

    tasks = []
    for row in rows:
        task = {
            "id" : row.id,
            "target" : row.target,
            "category" : row.category,
            "status" : row.status,
            "added_on" : row.added_on
{'fraction_non_alphanumeric': 0.12089077412513255, 'fraction_numerical': 0.009190526687875575, 'mean_word_length': 3.3808049535603715, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '598037', 'n_tokens_mistral': 926, 'n_tokens_neox': 900, 'n_words': 240}