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63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
#!/usr/bin/python
# -*- coding: utf-8 -*-

# Hive Appier Framework
# Copyright (c) 2008-2024 Hive Solutions Lda.
#
# This file is part of Hive Appier Framework.
#
# Hive Appier Framework is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foundation, either version 2.0 of the License, or (at your option) any
# later version.
#
# Hive Appier Framework is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Apache License for more details.
#
# You should have received a copy of the Apache License along with
# Hive Appier Framework. If not, see <http://www.apache.org/licenses/>.

__copyright__ = "Copyright (c) 2008-2024 Hive Solutions Lda."
""" The copyright for the module """

__license__ = "Apache License, Version 2.0"
""" The license for the module """

from . import amqp
from . import api
from . import asynchronous
from . import base
from . import bus
from . import cache
from . import component
from . import compress
from . import config
from . import controller
from . import crypt
from . import data
from . import defines
from . import exceptions
from . import execution
from . import export
from . import extra
from . import geo
from . import git
from . import graph
from . import http
from . import legacy
from . import log
from . import meta
from . import mock
from . import model
from . import mongo
from . import observer
from . import part
from . import preferences
from . import queuing
from . import redisdb
from . import request
from . import scheduler
from . import serialize
from . import session
from . import settings
from . import smtp
from . import storage
from . import structures
from . import typesf
from . import util
from . import validation

from .amqp import AMQP
from .api import API, OAuthAPI, OAuth1API, OAuth2API
from .asynchronous import (
    ASYNC_HEADER,
    AsyncManager,
    SimpleManager,
    QueueManager,
    AwaitWrapper,
    CoroutineWrapper,
    AyncgenWrapper,
    await_wrap,
    await_yield,
    ensure_generator,
    is_coroutine,
    is_coroutine_object,
    is_coroutine_native,
    to_coroutine,
    wrap_silent,
    unavailable,
    is_neo,
    Future,
    coroutine,
    wakeup,
    sleep,
    wait,
    notify,
    build_future,
    ensure_async,
    header_a,
    ensure_a,
)
from .base import (
    APP,
    LEVEL,
    NAME,
    VERSION,
    PLATFORM,
    IDENTIFIER_SHORT,
    IDENTIFIER_LONG,
    IDENTIFIER,
    API_VERSION,
    BUFFER_SIZE,
    MAX_LOG_SIZE,
    MAX_LOG_COUNT,
    App,
    APIApp,
    WebApp,
    Template,
    get_app,
    get_name,
    get_base_path,
    get_cache,
    get_preferences,
    get_bus,
    get_request,
    get_session,
    get_model,
    get_controller,
    get_part,
    get_adapter,
    get_manager,
    get_logger,
    get_level,
    is_loaded,
    is_devel,
    is_safe,
    to_locale,
    on_exit,
    build_asgi,
    build_asgi_i,
)
from .bus import Bus, MemoryBus, RedisBus
from .cache import Cache, MemoryCache, FileCache, RedisCache, SerializedCache
from .component import Component
from .compress import Compress
from .config import conf, conf_prefix, conf_suffix, conf_s, conf_r, conf_d, conf_ctx
from .controller import Controller
from .crypt import Cipher, RC4, Spritz
from .data import (
    DataAdapter,
    MongoAdapter,
    TinyAdapter,
    Collection,
    MongoCollection,
    TinyCollection,
)
from .defines import (
    ITERABLES,
    MOBILE_REGEX,
    TABLET_REGEX,
    MOBILE_PREFIX_REGEX,
    BODY_REGEX,
    TAG_REGEX,
    EMAIL_REGEX,
    BROWSER_INFO,
    OS_INFO,
    WINDOWS_LOCALE,
    SLUG_PERMUTATIONS,
)
from .exceptions import (
    AppierException,
    OperationalError,
    SecurityError,
    AssertionError,
    ValidationError,
    NotFoundError,
    NotImplementedError,
    BaseInternalError,
    ValidationInternalError,
    ValidationMultipleError,
    HTTPError,
    APIError,
    APIAccessError,
    OAuthAccessError,
)
from .execution import (
    ExecutionThread,
    background,
    insert_work,
    interval_work,
    seconds_work,
    minutes_work,
    hourly_work,
    daily_work,
    weekly_work,
    monthly_work,
    seconds_eval,
    minutes_eval,
    hourly_eval,
    daily_eval,
    weekly_eval,
    monthly_eval,
)
from .export import ExportManager
from .extra import (
    get_a,
    post_a,
    put_a,
    delete_a,
    patch_a,
    get_w,
    post_w,
    put_w,
    delete_w,
    patch_w,
)
from .geo import GeoResolver
from .git import Git
from .graph import Graph
from .http import file_g, get_f, get, post, put, delete, patch, basic_auth, HTTPResponse
from .log import (
    MemoryHandler,
    BaseFormatter,
    ThreadFormatter,
    DummyLogger,
    reload_format,
    rotating_handler,
    smtp_handler,
    in_signature,
)
from .meta import Ordered, Indexed
from .mock import MockObject, MockResponse, MockApp
from .model import (
    Model,
    LocalModel,
    Field,
    link,
    operation,
    view,
    field,
    type_d,
    is_unset,
)
from .mongo import (
    Mongo,
    MongoAsync,
    MongoEncoder,
    get_connection,
    get_connection_a,
    reset_connection,
    reset_connection_a,
    get_db,
    get_db_a,
    drop_db,
    drop_db_a,
    object_id,
    dumps,
)
from .observer import Observable
from .part import Part
from .preferences import (
    Preferences,
    MemoryPreferences,
    FilePreferences,
    RedisPreferences,
)
from .queuing import Queue, MemoryQueue, MultiprocessQueue, AMQPQueue
from .redisdb import Redis
from .request import CODE_STRINGS, Request, MockRequest
from .scheduler import Scheduler, CronScheduler, SchedulerTask, SchedulerDate, Cron
from .serialize import serialize_csv, serialize_ics, build_encoder
from .session import (
    Session,
    MockSession,
    MemorySession,
    FileSession,
    RedisSession,
    ClientSession,
)
from .settings import DEBUG, USERNAME, PASSWORD
from .smtp import (
    message,
    message_base,
    message_netius,
    smtp_engine,
    multipart,
    plain,
    html,
    application,
    header,
)
from .storage import StorageEngine, BaseEngine, FsEngine
from .structures import OrderedDict, LazyDict, LazyValue, GeneratorFile, lazy_dict, lazy
from .typesf import (
    AbstractType,
    Type,
    File,
    Files,
    ImageFile,
    ImageFiles,
    image,
    images,
    Reference,
    reference,
    References,
    references,
    Encrypted,
    encrypted,
    secure,
)
from .util import (
    to_limit,
    to_find,
    to_sort,
    is_iterable,
    is_mobile,
    is_tablet,
    is_browser,
    is_bot,
    browser_info,
    email_parts,
    email_mime,
    email_name,
    email_base,
    date_to_timestamp,
    obfuscate,
    import_pip,
    ensure_pip,
    install_pip,
    install_pip_s,
    request_json,
    get_context,
    get_object,
    resolve_alias,
    page_types,
    find_types,
    norm_object,
    set_object,
    leafs,
    gather_errors,
    gen_token,
    html_to_text,
    camel_to_underscore,
    camel_to_readable,
    underscore_to_camel,
    underscore_to_readable,
    quote,
    unquote,
    escape,
    unescape,
    count_unescape,
    split_unescape,
    call_safe,
    base_name,
    base_name_m,
    is_content_type,
    parse_content_type,
    parse_cookie,
    parse_multipart,
    decode_params,
    load_form,
    check_login,
    check_user,
    check_token,
    check_tokens,
    ensure_login,
    get_tokens_m,
    to_tokens_m,
    dict_merge,
    deprecated,
    cached,
    private,
    ensure,
    delayed,
    route,
    error_handler,
    exception_handler,
    before_request,
    after_request,
    is_detached,
    sanitize,
    verify,
    verify_equal,
    verify_not_equal,
    verify_type,
    verify_many,
    execute,
    ctx_locale,
    ctx_request,
    FileTuple,
    BaseThread,
    JSONEncoder,
)
from .validation import (
    validate,
    validate_b,
    validate_e,
    safe,
    eq,
    gt,
    gte,
    lt,
    lte,
    not_null,
    not_empty,
    not_false,
    is_in,
    is_upper,
    is_lower,
    is_simple,
    is_email,
    is_url,
    is_regex,
    field_eq,
    field_gt,
    field_gte,
    field_lt,
    field_lte,
    string_gt,
    string_lt,
    string_eq,
    equals,
    not_past,
    not_duplicate,
    all_different,
    no_self,
)

from .amqp import get_connection as get_amqp
from .amqp import properties as properties_amqp
from .mongo import get_connection as get_mongo
from .mongo import get_db as get_mongo_db
from .mongo import drop_db as drop_mongo_db
from .mongo import object_id as object_id_mongo
from .mongo import dumps as dumps_mongo
from .mongo import serialize as serialize_mongo
from .mongo import directions as directions_mongo
from .redisdb import get_connection as get_redis
from .redisdb import dumps as dumps_redis

HTTPError = exceptions.HTTPError