<commit_before># This file is part of DQXServer - (C) Copyright 2014, <NAME>, <NAME>, <NAME> <<EMAIL>>
# This program is free software licensed under the GNU Affero General Public License.
# You can find a copy of this license in LICENSE in the top directory of the source code or at <http://opensource.org/licenses/AGPL-3.0>


import simplejson
import DQXbase64
import MySQLdb
import config
import time


LogRequests = True


# Enumerates types of actions that can be done on a database entity
class DbOperationType:
    read = 1
    write = 2


# Encapsulates an operation that is done on a database entity
class DbOperation:
    def __init__(self, operationType, databaseName, tableName=None, columnName=None):
        if (databaseName is None) or (databaseName == ''):
            databaseName = config.DB
        self.operationType = operationType
        self.databaseName = databaseName
        self.tableName = tableName
        self.columnName = columnName

    def IsModify(self):
        return self.operationType == DbOperationType.write

    def OnDatabase(self, databaseName):
        return self.databaseName == databaseName

    def OnTable(self, tableName):
        return self.tableName == tableName<commit_msg>Specify min. MySQL version nr<commit_after># This file is part of DQXServer - (C) Copyright 2014, <NAME>, <NAME>, <NAME> <<EMAIL>>
# This program is free software licensed under the GNU Affero General Public License.
# You can find a copy of this license in LICENSE in the top directory of the source code or at <http://opensource.org/licenses/AGPL-3.0>


import simplejson
import DQXbase64
import MySQLdb
import config
import time

MySQLMinVersion = [5, 6]

LogRequests = True


# Enumerates types of actions that can be done on a database entity
class DbOperationType:
    read = 1
    write = 2


# Encapsulates an operation that is done on a database entity
class DbOperation:
    def __init__(self, operationType, databaseName, tableName=None, columnName=None):
        if (databaseName is None) or (databaseName == ''):
            databaseName = config.DB
        self.operationType = operationType
        self.databaseName = databaseName
        self.tableName = tableName
        self.columnName = columnName

    def IsModify(self):
        return self.operationType == DbOperationType.write

    def OnDatabase(self, databaseName):
        return self.databaseName == databaseName

    def OnTable(self, tableName):
        return self.tableName == tableName
{'fraction_non_alphanumeric': 0.07322929171668667, 'fraction_numerical': 0.008803521408563426, 'mean_word_length': 3.4642857142857144, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '2521034', 'n_tokens_mistral': 702, 'n_tokens_neox': 662, 'n_words': 264}