<commit_before># -*- coding:utf-8 -*-
import importlib

import os
import sys
from empty import Empty
from flask import render_template, g, redirect, url_for, request, flash, Response, \
    send_from_directory, make_response, abort
from functools import lru_cache

import jinja2

from nanopub import NanopublicationManager, Nanopublication
import requests
from re import finditer
import pytz

from werkzeug.exceptions import Unauthorized
from werkzeug.utils import secure_filename

from depot.manager import DepotManager
from depot.middleware import FileServeApp

import rdflib
from flask_security import Security, \
    login_required
from flask_security.core import current_user
from flask_security.forms import RegisterForm
from flask_wtf import Form
from wtforms import TextField, StringField, validators
import sadi
import json
import sadi.mimeparse
from slugify import slugify

from urllib.parse import urlencode

from celery import Celery
from celery.schedules import crontab
from celery.task.control import inspect

import database

from datetime import datetime

import markdown

import rdflib.plugin
from rdflib.query import Processor, Result, UpdateProcessor
rdflib.plugin.register('sparql', Result,
        'rdflib.plugins.sparql.processor', 'SPARQLResult')
rdflib.plugin.register('sparql', Processor,
        'rdflib.plugins.sparql.processor', 'SPARQLProcessor')
rdflib.plugin.register('sparql', UpdateProcessor,
        'rdflib.plugins.sparql.processor', 'SPARQLUpdateProcessor')

import search
import filters

# apps is a special folder where you can place your blueprints
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(PROJECT_PATH, "apps"))

basestring = getattr(__builtins__, 'basestring', str)

# we create some comparison keys:
# increase probability that the rule will be near or at the top
top_compare_key = False, -100, [(-2, 0)]
# increase probability that the rule will be near or at the bottom 
bottom_compare_key = True, 100, [(2, 0)]

class NamespaceContainer(object):
    @property
    def prefixes(self):
        result = {}
        for key, value in list(self.__dict__.items()):
            if isinstance(value, Namespace):
                result[key] = value
        return result

NS = NamespaceContainer()
NS.RDFS = rdflib.RDFS
NS.RDF = rdflib.RDF
NS.rdfs = rdflib.Namespace(rdflib.RDFS)
NS.rdf = rdflib.Namespace(rdflib.RDF)
NS.owl = rdflib.OWL
NS.xsd   = rdflib.Namespace("http://www.w3.org/2001/XMLSchema#")
NS.dc    = rdflib.Namespace("http://purl.org/dc/terms/")
NS.dcelements    = rdflib.Namespace("http://purl.org/dc/elements/1.1/")
NS.auth  = rdflib.Namespace("http://vocab.rpi.edu/auth/")
NS.foaf  = rdflib.Namespace("http://xmlns.com/foaf/0.1/")
NS.prov  = rdflib.Namespace("http://www.w3.org/ns/prov#")
NS.skos = rdflib.Namespace("http://www.w3.org/2004/02/skos/core#")
NS.cmo = rdflib.Namespace("http://purl.org/twc/ontologies/cmo.owl#")
NS.sio = rdflib.Namespace("http://semanticscience.org/resource/")
NS.sioc_types = rdflib.Namespace("http://rdfs.org/sioc/types#")
NS.sioc = rdflib.Namespace("http://rdfs.org/sioc/ns#")
NS.np = rdflib.Namespace("http://www.nanopub.org/nschema#")
NS.whyis = rdflib.Namespace("http://vocab.rpi.edu/whyis/")
NS.ov = rdflib.Namespace("http://open.vocab.org/terms/")
NS.frbr = rdflib.Namespace("http://purl.org/vocab/frbr/core#")
NS.mediaTypes = rdflib.Namespace("https://www.iana.org/assignments/media-types/")
NS.pv = rdflib.Namespace("http://purl.org/net/provenance/ns#")
NS.sd = rdflib.Namespace('http://www.w3.org/ns/sparql-service-description#')
NS.ld = rdflib.Namespace('http://purl.org/linked-data/api/vocab#')
NS.dcat = rdflib.Namespace("http://www.w3.org/ns/dcat#")
NS.hint = rdflib.Namespace("http://www.bigdata.com/queryHints#")
NS.void = rdflib.Namespace("http://rdfs.org/ns/void#")
NS.schema = rdflib.Namespace("http://schema.org/")
    
from datastore import *

#from flask_login.config import EXEMPT_METHODS<commit_msg>use class properties<commit_after># -*- coding:utf-8 -*-
import importlib

import os
import sys
from empty import Empty
from flask import render_template, g, redirect, url_for, request, flash, Response, \
    send_from_directory, make_response, abort
from functools import lru_cache

import jinja2

from nanopub import NanopublicationManager, Nanopublication
import requests
from re import finditer
import pytz

from werkzeug.exceptions import Unauthorized
from werkzeug.utils import secure_filename

from depot.manager import DepotManager
from depot.middleware import FileServeApp

import rdflib
from flask_security import Security, \
    login_required
from flask_security.core import current_user
from flask_security.forms import RegisterForm
from flask_wtf import Form
from wtforms import TextField, StringField, validators
import sadi
import json
import sadi.mimeparse
from slugify import slugify

from urllib.parse import urlencode

from celery import Celery
from celery.schedules import crontab
from celery.task.control import inspect

import database

from datetime import datetime

import markdown

import rdflib.plugin
from rdflib.query import Processor, Result, UpdateProcessor
rdflib.plugin.register('sparql', Result,
        'rdflib.plugins.sparql.processor', 'SPARQLResult')
rdflib.plugin.register('sparql', Processor,
        'rdflib.plugins.sparql.processor', 'SPARQLProcessor')
rdflib.plugin.register('sparql', UpdateProcessor,
        'rdflib.plugins.sparql.processor', 'SPARQLUpdateProcessor')

import search
import filters

# apps is a special folder where you can place your blueprints
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(PROJECT_PATH, "apps"))

basestring = getattr(__builtins__, 'basestring', str)

# we create some comparison keys:
# increase probability that the rule will be near or at the top
top_compare_key = False, -100, [(-2, 0)]
# increase probability that the rule will be near or at the bottom 
bottom_compare_key = True, 100, [(2, 0)]

class NamespaceContainer(object):
    RDFS = rdflib.RDFS
    RDF = rdflib.RDF
    rdfs = rdflib.Namespace(rdflib.RDFS)
    rdf = rdflib.Namespace(rdflib.RDF)
    owl = rdflib.OWL
    xsd = rdflib.Namespace("http://www.w3.org/2001/XMLSchema#")
    dc = rdflib.Namespace("http://purl.org/dc/terms/")
    dcelements = rdflib.Namespace("http://purl.org/dc/elements/1.1/")
    auth = rdflib.Namespace("http://vocab.rpi.edu/auth/")
    foaf = rdflib.Namespace("http://xmlns.com/foaf/0.1/")
    prov = rdflib.Namespace("http://www.w3.org/ns/prov#")
    skos = rdflib.Namespace("http://www.w3.org/2004/02/skos/core#")
    cmo = rdflib.Namespace("http://purl.org/twc/ontologies/cmo.owl#")
    sio = rdflib.Namespace("http://semanticscience.org/resource/")
    sioc_types = rdflib.Namespace("http://rdfs.org/sioc/types#")
    sioc = rdflib.Namespace("http://rdfs.org/sioc/ns#")
    np = rdflib.Namespace("http://www.nanopub.org/nschema#")
    whyis = rdflib.Namespace("http://vocab.rpi.edu/whyis/")
    ov = rdflib.Namespace("http://open.vocab.org/terms/")
    frbr = rdflib.Namespace("http://purl.org/vocab/frbr/core#")
    mediaTypes = rdflib.Namespace("https://www.iana.org/assignments/media-types/")
    pv = rdflib.Namespace("http://purl.org/net/provenance/ns#")
    sd = rdflib.Namespace('http://www.w3.org/ns/sparql-service-description#')
    ld = rdflib.Namespace('http://purl.org/linked-data/api/vocab#')
    dcat = rdflib.Namespace("http://www.w3.org/ns/dcat#")
    hint = rdflib.Namespace("http://www.bigdata.com/queryHints#")
    void = rdflib.Namespace("http://rdfs.org/ns/void#")
    schema = rdflib.Namespace("http://schema.org/")

    @property
    def prefixes(self):
        result = {}
        for key, value in list(self.__dict__.items()):
            if isinstance(value, Namespace):
                result[key] = value
        return result

NS = NamespaceContainer()

from datastore import *

#from flask_login.config import EXEMPT_METHODS
{'fraction_non_alphanumeric': 0.13059372242531198, 'fraction_numerical': 0.008067565864111937, 'mean_word_length': 4.357191087103309, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 16, 'xml': 2}, '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': '1227273', 'n_tokens_mistral': 2858, 'n_tokens_neox': 2709, 'n_words': 571}