<commit_before>"""Global API configuration."""

from os import environ
from urlparse import urlparse

from schemas import request_schema, service_schema

API_NAME = 'Taarifa'
URL_PREFIX = 'api'
if 'EVE_DEBUG' in environ:
    DEBUG = True

if 'MONGOLAB_URI' in environ:
    url = urlparse(environ['MONGOLAB_URI'])
    MONGO_HOST = url.hostname
    MONGO_PORT = url.port
    MONGO_USERNAME = url.username
    MONGO_PASSWORD = url.password
    MONGO_DBNAME = url.path[1:]
else:
    MONGO_DBNAME = API_NAME

# Enable reads (GET), inserts (POST) and DELETE for resources/collections
# (if you omit this line, the API will default to ['GET'] and provide
# read-only access to the endpoint).
RESOURCE_METHODS = ['GET', 'POST', 'DELETE']

# Enable reads (GET), edits (PATCH) and deletes of individual items
# (defaults to read-only item access).
ITEM_METHODS = ['GET', 'PATCH', 'DELETE']

services = {
    "schema": service_schema,
}

requests = {
    "schema": request_schema,
}

DOMAIN = {
    'services': services,
    'requests': requests,
}

# FIXME: Temporarily allow CORS requests for development purposes
X_DOMAINS = "*"
<commit_msg>Add facilities resource<commit_after>"""Global API configuration."""

from os import environ
from urlparse import urlparse

from schemas import facility_schema, request_schema, service_schema

API_NAME = 'Taarifa'
URL_PREFIX = 'api'
if 'EVE_DEBUG' in environ:
    DEBUG = True

if 'MONGOLAB_URI' in environ:
    url = urlparse(environ['MONGOLAB_URI'])
    MONGO_HOST = url.hostname
    MONGO_PORT = url.port
    MONGO_USERNAME = url.username
    MONGO_PASSWORD = <PASSWORD>
    MONGO_DBNAME = url.path[1:]
else:
    MONGO_DBNAME = API_NAME

# Enable reads (GET), inserts (POST) and DELETE for resources/collections
# (if you omit this line, the API will default to ['GET'] and provide
# read-only access to the endpoint).
RESOURCE_METHODS = ['GET', 'POST', 'DELETE']

# Enable reads (GET), edits (PATCH) and deletes of individual items
# (defaults to read-only item access).
ITEM_METHODS = ['GET', 'PATCH', 'DELETE']

services = {
    "schema": service_schema,
}

requests = {
    "schema": request_schema,
}

facilities = {
    "item_title": "facility",
    "schema": facility_schema,
}

DOMAIN = {
    'services': services,
    'requests': requests,
    'facilities': facilities,
}

# FIXME: Temporarily allow CORS requests for development purposes
X_DOMAINS = "*"

{'fraction_non_alphanumeric': 0.11458333333333333, 'fraction_numerical': 0.0008333333333333334, 'mean_word_length': 4.311946902654867, 'pattern_counts': {'":': 6, '<': 4, '<?xml version=': 0, '>': 4, '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': '2517607', 'n_tokens_mistral': 794, 'n_tokens_neox': 789, 'n_words': 240}