<commit_before>from sondra.document.valuehandlers import DateTime, Now, Geometry

from sondra import document, suite, collection, application
from sondra.api.expose import expose_method
from sondra.auth.decorators import authentication_required, authorization_required, authenticated_method, authorized_method
from sondra.auth.request_processor import AuthRequestProcessor
from sondra.document import ListHandler
from sondra.document.processors import SlugPropertyProcessor
from sondra.document.schema_parser import ForeignKey, Geometry, DateTime, Now
from sondra.file3 import FileUploadProcessor, LocalFileStorage
from sondra.lazy import fk
from sondra.schema import S


class ConcreteSuite(suite.Suite):
    "A simple API for testing"
    definitions = {
        "concreteSuiteDefn": {"type": "string", "pattern": "[0-9]+"}
    }
    api_request_processors = (
        AuthRequestProcessor(),
        FileUploadProcessor()
    )

    file_storage = LocalFileStorage('/Users/pronto365/Source/foss/sondra/_media', 'http://localhost:5000/uploads')

    @authenticated_method
    @expose_method
    def authenticated_method(self, _user=None) -> str:
        return "Successfully authenticated method"

    @authorized_method
    @expose_method
    def authorized_method(self, _user=None) -> str:
        return "Accessed authorized method"


class FileDocument(document.Document):
    schema = S.object(
        {
            "name": S.string(title="Name", description="The name of the document"),
            "slug": S.string(),
            "file": S.url(),
            "image": S.url(),
        }
    )<commit_msg>fixed broken test<commit_after>from sondra.document.valuehandlers import DateTime, Now, Geometry

from sondra import document, suite, collection, application
from sondra.api.expose import expose_method
from sondra.auth.decorators import authentication_required, authorization_required, authenticated_method, authorized_method
from sondra.auth.request_processor import AuthRequestProcessor
from sondra.document import ListHandler
from sondra.document.processors import SlugPropertyProcessor
from sondra.document.schema_parser import ForeignKey, Geometry, DateTime, Now
from sondra.file3 import FileUploadProcessor, LocalFileStorage
from sondra.lazy import fk
from sondra.schema import S


class ConcreteSuite(suite.Suite):
    "A simple API for testing"
    definitions = {
        "concreteSuiteDefn": {"type": "string", "pattern": "[0-9]+"}
    }
    api_request_processors = (
        AuthRequestProcessor(),
        FileUploadProcessor()
    )

    file_storage = LocalFileStorage('/Users/jeff/Source/foss/sondra/_media', 'http://localhost:5000/uploads')

    @authenticated_method
    @expose_method
    def authenticated_method(self, _user=None) -> str:
        return "Successfully authenticated method"

    @authorized_method
    @expose_method
    def authorized_method(self, _user=None) -> str:
        return "Accessed authorized method"


class FileDocument(document.Document):
    schema = S.object(
        {
            "name": S.string(title="Name", description="The name of the document"),
            "slug": S.string(),
            "file": S.url(),
            "image": S.url(),
        }
    )
{'fraction_non_alphanumeric': 0.09544468546637744, 'fraction_numerical': 0.005268050821196158, 'mean_word_length': 3.91324200913242, 'pattern_counts': {'":': 14, '<': 3, '<?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': '7206458', 'n_tokens_mistral': 926, 'n_tokens_neox': 892, 'n_words': 226}