<commit_before>
from importlib import import_module
from typing import NamedTuple
from urllib.parse import urlparse

from flask import g

# http://stackoverflow.com/questions/8544983/dynamically-mixin-a-base-class-to-an-instance-in-python

Query = NamedTuple('Query', [('where', str), ('sort', str), ('group', str)])


class Base:
    pass


def get_backend(app):
    db_uri = app.config['DATABASE_URL']
    backend = urlparse(db_uri).scheme

    if backend == 'postgresql':
        backend = 'postgres'
    return backend<commit_msg>Support MongoDB seedlist connection format (#1070)<commit_after>
from importlib import import_module
from typing import NamedTuple
from urllib.parse import urlparse

from flask import g

# http://stackoverflow.com/questions/8544983/dynamically-mixin-a-base-class-to-an-instance-in-python

Query = NamedTuple('Query', [('where', str), ('sort', str), ('group', str)])


class Base:
    pass


def get_backend(app):
    db_uri = app.config['DATABASE_URL']
    backend = urlparse(db_uri).scheme

    if backend.startswith('mongodb'):
        backend = 'mongodb'
    if backend == 'postgresql':
        backend = 'postgres'
    return backend
{'fraction_non_alphanumeric': 0.1263877028181042, 'fraction_numerical': 0.015371477369769428, 'mean_word_length': 4.185840707964601, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '734920', 'n_tokens_mistral': 397, 'n_tokens_neox': 371, 'n_words': 92}