<commit_before># -*-*- encoding: utf-8 -*-*-
import os
import sha
import sys
import json
import unittest

from bs4 import BeautifulSoup, Tag

from werkzeug import Headers

sys.path.append('.')
os.environ['TESTING_LABMANAGER'] = 'sqlite:///:memory:'

from labmanager.test.fake_rlms import register_fake, LAB_NAME, LAB_ID, FAKE_ADDRESS
register_fake()

import labmanager as server
server.bootstrap()

from labmanager.database import add_sample_users
from labmanager.views.admin.rlms import RLMSPanel
from labmanager.views.admin.lms import LMSPanel

ADMIN    = 'admin'
PASSWORD = 'password'

LOCAL_ID = 'localid'

LMS_NAME     = 'Testing LMS'
LMS_URL      = 'http://localhost:31337/'
LMS_LOGIN    = 'mylms'
LMS_PASSWORD = '<PASSWORD>'

COURSE_NAME = 'My course'
CONTEXT_ID  = 'context-id'

RLMS_KIND     = 'FakeRLMS<>1.0'
RLMS_LOCATION = 'Bilbao'
RLMS_URL      = 'http://github.com/lms4labs/labmanager/'

SELECTION_COLUMNS = 2 # Number of columns used by flask-admin for selection, deleting or editing

def _find_in_select(select_data, select_name, pattern):<commit_msg>Use DATABASE_URL for testing db too<commit_after># -*-*- encoding: utf-8 -*-*-
import os
import sha
import sys
import json
import unittest

from bs4 import BeautifulSoup, Tag

from werkzeug import Headers

sys.path.append('.')
os.environ['DATABASE_URL'] = 'sqlite:///:memory:'

from labmanager.test.fake_rlms import register_fake, LAB_NAME, LAB_ID, FAKE_ADDRESS
register_fake()

import labmanager as server
server.bootstrap()

from labmanager.database import add_sample_users
from labmanager.views.admin.rlms import RLMSPanel
from labmanager.views.admin.lms import LMSPanel

ADMIN    = 'admin'
PASSWORD = 'password'

LOCAL_ID = 'localid'

LMS_NAME     = 'Testing LMS'
LMS_URL      = 'http://localhost:31337/'
LMS_LOGIN    = 'mylms'
LMS_PASSWORD = '<PASSWORD>'

COURSE_NAME = 'My course'
CONTEXT_ID  = 'context-id'

RLMS_KIND     = 'FakeRLMS<>1.0'
RLMS_LOCATION = 'Bilbao'
RLMS_URL      = 'http://github.com/lms4labs/labmanager/'

SELECTION_COLUMNS = 2 # Number of columns used by flask-admin for selection, deleting or editing

def _find_in_select(select_data, select_name, pattern):
{'fraction_non_alphanumeric': 0.10976744186046512, 'fraction_numerical': 0.010232558139534883, 'mean_word_length': 4.782258064516129, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1332313', 'n_tokens_mistral': 777, 'n_tokens_neox': 765, 'n_words': 190}