<commit_before>#
# Copyright (c) 2013-2014 QuarksLab.
# This file is part of IRMA project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the top-level directory
# of this distribution and at:
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# No part of the project, including this file, may be copied,
# modified, propagated, or distributed except according to the
# terms contained in the LICENSE file.

import config.parser as config
from lib.irma.database.nosqlobjects import NoSQLDatabaseObject

cfg_dburi = config.get_db_uri()
cfg_dbname = config.frontend_config['mongodb'].dbname
cfg_coll = config.frontend_config['collections']


cfg_coll_prefix = '{0}_'.format(config.get_nosql_db_collections_prefix())


class ProbeRealResult(NoSQLDatabaseObject):
    _uri = cfg_dburi
    _dbname = cfg_dbname
    _collection = '{0}probe_real_result'.format(cfg_coll_prefix)

    def __init__(self,
                 name=None,
                 type=None,
                 version=None,
                 status=None,
                 duration=None,
                 results=None,
                 raw=None,
                 dbname=None,
                 **kwargs):
        if dbname:
            self._dbname = dbname
        self.name = name
        self.type = type
        self.version = version
        self.status = status
        self.duration = duration
        self.results = results
        self.raw = raw
        super(ProbeRealResult, self).__init__(**kwargs)

    def get_results(self, raw=False):
            if not raw:<commit_msg>fix arg<commit_after>#
# Copyright (c) 2013-2014 QuarksLab.
# This file is part of IRMA project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the top-level directory
# of this distribution and at:
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# No part of the project, including this file, may be copied,
# modified, propagated, or distributed except according to the
# terms contained in the LICENSE file.

import config.parser as config
from lib.irma.database.nosqlobjects import NoSQLDatabaseObject

cfg_dburi = config.get_db_uri()
cfg_dbname = config.frontend_config['mongodb'].dbname
cfg_coll = config.frontend_config['collections']


cfg_coll_prefix = '{0}_'.format(config.get_nosql_db_collections_prefix())


class ProbeRealResult(NoSQLDatabaseObject):
    _uri = cfg_dburi
    _dbname = cfg_dbname
    _collection = '{0}probe_real_result'.format(cfg_coll_prefix)

    def __init__(self,
                 name=None,
                 type=None,
                 version=None,
                 status=None,
                 duration=None,
                 results=None,
                 raw=None,
                 dbname=None,
                 **kwargs):
        if dbname:
            self._dbname = dbname
        self.name = name
        self.type = type
        self.version = version
        self.status = status
        self.duration = duration
        self.results = results
        self.raw = raw
        super(ProbeRealResult, self).__init__(**kwargs)

    def get_results(self, raw):
            if not raw:
{'fraction_non_alphanumeric': 0.08673469387755102, 'fraction_numerical': 0.008403361344537815, 'mean_word_length': 2.471875, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5693537', 'n_tokens_mistral': 964, 'n_tokens_neox': 933, 'n_words': 274}