sciveo 0.1.64__tar.gz → 0.1.65__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sciveo-0.1.64 → sciveo-0.1.65}/PKG-INFO +2 -1
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/random.py +13 -0
- sciveo-0.1.65/sciveo/version.py +2 -0
- sciveo-0.1.65/sciveo/web/__init__.py +0 -0
- sciveo-0.1.65/sciveo/web/common.py +138 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo.egg-info/PKG-INFO +2 -1
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo.egg-info/SOURCES.txt +2 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo.egg-info/requires.txt +5 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/setup.py +5 -0
- sciveo-0.1.64/sciveo/version.py +0 -2
- {sciveo-0.1.64 → sciveo-0.1.65}/README.md +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/api/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/api/base.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/api/predictors.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/api/server.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/api/upload.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/cli.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/common/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/common/configuration.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/common/model.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/common/optimizers.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/common/sampling.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/content/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/content/dataset.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/content/experiment.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/content/project.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/content/runner.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/capture/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/capture/cam.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/capture/nvr.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/ml/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/ml/base.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/ml/encoders/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/ml/encoders/base.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/ml/encoders/normalizer.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/ml/nlp/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/ml/nlp/search.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/ml/time_series/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/ml/time_series/dataset.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/ml/time_series/predictor.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/ml/time_series/trainer.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/ml/time_series/window_generator.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/base.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/job_daemon.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/layouts/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/layouts/base.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/pipeline.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/postprocessors/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/postprocessors/base.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/postprocessors/default.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/audio/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/audio/audio.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/audio/audio_extractor_process.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/aws.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/base.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/file/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/file/archive.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/image/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/image/album.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/image/album_in_image.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/image/depth_esimation.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/image/embeddings.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/image/filters.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/image/generators.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/image/histogram.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/image/mask.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/image/object_detection.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/image/resize.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/image/segmentation.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/image/watermark.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/media_info.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/nlp/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/nlp/address.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/qr.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/sci/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/sci/base.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/sci/dataset.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/sci/time_series/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/sci/time_series/predictor.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/sci/time_series/trainer.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/tpu_base.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/video/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/video/generators.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/video/motion_detection.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/video/resize.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/video/video_album.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/video/video_frames.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/video/video_resample.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/queues.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/server.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/web/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/web/server.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/tools/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/tools/video_interactive.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/base.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/dataset/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/dataset/object_detection.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/evaluation/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/evaluation/markdown.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/evaluation/object_detection.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/images/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/images/base.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/images/description.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/images/embeddings.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/images/object_detection.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/images/tools.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/images/transformers.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/nlp/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/nlp/embeddings.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/nlp/tokenizers/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/nlp/tokenizers/bpe.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/video/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/ml/video/description.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/monitoring/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/monitoring/monitor.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/monitoring/start.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/monitoring/watchdog/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/monitoring/watchdog/base.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/monitoring/watchdog/process.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/network/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/network/camera.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/network/sniffer.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/network/tools.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/array.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/aws/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/aws/priority_queue.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/aws/s3.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/common.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/complexity.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/compress.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/configuration.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/crypto.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/daemon.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/draw/__init__.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/draw/contours.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/formating.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/hardware.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/http.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/logger.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/os.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/queue.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/remote.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/simple_counter.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/synchronized.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo/tools/timers.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo.egg-info/dependency_links.txt +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo.egg-info/entry_points.txt +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/sciveo.egg-info/top_level.txt +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/setup.cfg +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/test/test_complexity.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/test/test_compress.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/test/test_configuration.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/test/test_crypto.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/test/test_eval_markdown.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/test/test_ml_datasets.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/test/test_monitoring.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/test/test_runner.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/test/test_sampling.py +0 -0
- {sciveo-0.1.64 → sciveo-0.1.65}/test/test_tokenizers.py +0 -0
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sciveo
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.65
|
|
4
4
|
Description-Content-Type: text/markdown
|
|
5
5
|
Provides-Extra: mon
|
|
6
6
|
Provides-Extra: net
|
|
7
7
|
Provides-Extra: server
|
|
8
8
|
Provides-Extra: media
|
|
9
9
|
Provides-Extra: media-ml
|
|
10
|
+
Provides-Extra: web
|
|
10
11
|
Provides-Extra: all
|
|
11
12
|
Provides-Extra: ml
|
|
12
13
|
|
|
@@ -11,6 +11,19 @@
|
|
|
11
11
|
|
|
12
12
|
import random
|
|
13
13
|
import string
|
|
14
|
+
import datetime
|
|
15
|
+
import uuid
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def new_guid_uuid():
|
|
19
|
+
return datetime.datetime.now().strftime("%Y%m%d%H%M%S") + "-" + str(uuid.uuid4()).replace("-", "")
|
|
20
|
+
|
|
21
|
+
def random_token(num_characters):
|
|
22
|
+
characters = string.ascii_letters + string.digits
|
|
23
|
+
return ''.join(random.choices(characters, k=num_characters))
|
|
24
|
+
|
|
25
|
+
def new_guid(num_characters=32):
|
|
26
|
+
return datetime.datetime.now().strftime("%Y%m%d%H%M%S") + "-" + random_token(num_characters)
|
|
14
27
|
|
|
15
28
|
|
|
16
29
|
def random_password(length):
|
|
File without changes
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
from django.http import JsonResponse, HttpResponseForbidden
|
|
2
|
+
from django.core.paginator import Paginator
|
|
3
|
+
from django.forms.models import model_to_dict
|
|
4
|
+
from django.db.models import Q, Case, Value, When, IntegerField
|
|
5
|
+
from sciveo.tools.logger import *
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class SinglePage_:
|
|
9
|
+
def __init__(self, object_list):
|
|
10
|
+
self.object_list = object_list
|
|
11
|
+
|
|
12
|
+
class SinglePaginator_:
|
|
13
|
+
def __init__(self, object_list):
|
|
14
|
+
self.object_list = object_list
|
|
15
|
+
self.count = -1
|
|
16
|
+
self.num_pages = -1
|
|
17
|
+
|
|
18
|
+
def page(self, page_num):
|
|
19
|
+
return SinglePage_(self.object_list)
|
|
20
|
+
|
|
21
|
+
def filter_query(request, model_objects, list_query):
|
|
22
|
+
filter_dict = {}
|
|
23
|
+
for q in list_query:
|
|
24
|
+
if q in request.GET:
|
|
25
|
+
q_list = request.GET.getlist(q)
|
|
26
|
+
filter_dict[f"{q}__in"] = q_list
|
|
27
|
+
model_objects = model_objects.filter(**filter_dict)
|
|
28
|
+
|
|
29
|
+
query_objects = []
|
|
30
|
+
for q in list_query:
|
|
31
|
+
negative_q = f"~{q}"
|
|
32
|
+
if negative_q in request.GET:
|
|
33
|
+
q_list = request.GET.getlist(negative_q)
|
|
34
|
+
for q_value in q_list:
|
|
35
|
+
query_objects.append(~Q(**{q: q_value}))
|
|
36
|
+
if len(query_objects) > 0:
|
|
37
|
+
query = query_objects.pop()
|
|
38
|
+
for q_obj in query_objects:
|
|
39
|
+
query &= q_obj
|
|
40
|
+
model_objects = model_objects.filter(query)
|
|
41
|
+
|
|
42
|
+
return model_objects
|
|
43
|
+
|
|
44
|
+
def admin_required(view_func):
|
|
45
|
+
def wrapper_func(request, *args, **kwargs):
|
|
46
|
+
if request.user.is_authenticated and request.user.is_superuser:
|
|
47
|
+
return view_func(request, *args, **kwargs)
|
|
48
|
+
else:
|
|
49
|
+
return HttpResponseForbidden()
|
|
50
|
+
return wrapper_func
|
|
51
|
+
|
|
52
|
+
def data_model_to_dict(object, fields=None, recursive=True):
|
|
53
|
+
data = model_to_dict(object, fields=fields)
|
|
54
|
+
|
|
55
|
+
for k in ["created_at", "updated_at"]:
|
|
56
|
+
if hasattr(object, k):
|
|
57
|
+
data[k] = getattr(object, k)
|
|
58
|
+
|
|
59
|
+
for k, v in data.items():
|
|
60
|
+
if isinstance(v, list):
|
|
61
|
+
if recursive:
|
|
62
|
+
data[k] = [data_model_to_dict(obj, fields, recursive) for obj in v]
|
|
63
|
+
else:
|
|
64
|
+
data[k] = [str(obj) for obj in v]
|
|
65
|
+
return data
|
|
66
|
+
|
|
67
|
+
def paginated(request, model_objects, order_default="'id'", already_paginated=False):
|
|
68
|
+
page_current = int(request.GET.get('page', 1))
|
|
69
|
+
page_limit = int(request.GET.get('limit', 10))
|
|
70
|
+
order = request.GET.get('order', order_default)[1:-1]
|
|
71
|
+
fields = request.GET.get('fields', None)
|
|
72
|
+
recursive = "recursive" in request.GET
|
|
73
|
+
|
|
74
|
+
try:
|
|
75
|
+
if already_paginated:
|
|
76
|
+
paginator = SinglePaginator_(model_objects)
|
|
77
|
+
else:
|
|
78
|
+
paginator = Paginator(model_objects.order_by(order), page_limit)
|
|
79
|
+
|
|
80
|
+
page = paginator.page(page_current)
|
|
81
|
+
|
|
82
|
+
data = [data_model_to_dict(obj, fields, recursive) for obj in page.object_list]
|
|
83
|
+
|
|
84
|
+
result = {
|
|
85
|
+
"pagination": {
|
|
86
|
+
'page': page_current,
|
|
87
|
+
'limit': page_limit,
|
|
88
|
+
'total_pages': paginator.num_pages,
|
|
89
|
+
'total_count': paginator.count,
|
|
90
|
+
},
|
|
91
|
+
"data": data
|
|
92
|
+
}
|
|
93
|
+
except Exception as e:
|
|
94
|
+
error("paginated", e)
|
|
95
|
+
result = {"error": str(e)}
|
|
96
|
+
|
|
97
|
+
return JsonResponse(result)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def filter_on_list(queryset, column_name, filter_list):
|
|
101
|
+
"""
|
|
102
|
+
Filters the given queryset based on the values of the specified column
|
|
103
|
+
according to the filter_list.
|
|
104
|
+
|
|
105
|
+
Args:
|
|
106
|
+
queryset (QuerySet): The queryset to be sorted.
|
|
107
|
+
column_name (str): The name of the column to sort on.
|
|
108
|
+
filter_list (list): The list defining the desired order.
|
|
109
|
+
|
|
110
|
+
Returns:
|
|
111
|
+
QuerySet: The filtered queryset.
|
|
112
|
+
"""
|
|
113
|
+
return queryset.filter(Q(**{column_name + '__in': filter_list}))
|
|
114
|
+
|
|
115
|
+
def sort_on_list(queryset, column_name, sort_list):
|
|
116
|
+
"""
|
|
117
|
+
Sorts the given queryset based on the values of the specified column
|
|
118
|
+
according to the order defined in the sort_list.
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
queryset (QuerySet): The queryset to be sorted.
|
|
122
|
+
column_name (str): The name of the column to sort on.
|
|
123
|
+
sort_list (list): The list defining the desired order.
|
|
124
|
+
|
|
125
|
+
Returns:
|
|
126
|
+
QuerySet: The sorted queryset.
|
|
127
|
+
"""
|
|
128
|
+
# Create a Case/When expression for each value in the desired order
|
|
129
|
+
# Assign a numerical value to each item in the list
|
|
130
|
+
# Use the Case/When expression to annotate each object with its numerical value
|
|
131
|
+
# Use the annotated value to order the queryset
|
|
132
|
+
return queryset.annotate(
|
|
133
|
+
custom_order=Case(
|
|
134
|
+
*[When(**{column_name: value}, then=Value(index)) for index, value in enumerate(sort_list)],
|
|
135
|
+
default=Value(len(sort_list)),
|
|
136
|
+
output_field=IntegerField()
|
|
137
|
+
)
|
|
138
|
+
).order_by('custom_order')
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sciveo
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.65
|
|
4
4
|
Description-Content-Type: text/markdown
|
|
5
5
|
Provides-Extra: mon
|
|
6
6
|
Provides-Extra: net
|
|
7
7
|
Provides-Extra: server
|
|
8
8
|
Provides-Extra: media
|
|
9
9
|
Provides-Extra: media-ml
|
|
10
|
+
Provides-Extra: web
|
|
10
11
|
Provides-Extra: all
|
|
11
12
|
Provides-Extra: ml
|
|
12
13
|
|
|
@@ -148,6 +148,8 @@ sciveo/tools/aws/priority_queue.py
|
|
|
148
148
|
sciveo/tools/aws/s3.py
|
|
149
149
|
sciveo/tools/draw/__init__.py
|
|
150
150
|
sciveo/tools/draw/contours.py
|
|
151
|
+
sciveo/web/__init__.py
|
|
152
|
+
sciveo/web/common.py
|
|
151
153
|
test/test_complexity.py
|
|
152
154
|
test/test_compress.py
|
|
153
155
|
test/test_configuration.py
|
|
@@ -36,6 +36,11 @@ extras_require = {
|
|
|
36
36
|
'torch>=0.0.0', 'torchvision>=0.0.0',
|
|
37
37
|
'diffusers>=0.0.0', 'transformers>=0.0.0', 'sentence_transformers>=0.0.0', 'accelerate>=0.0.0', 'annoy>=0.0.0',
|
|
38
38
|
'ultralytics>=0.0.0'
|
|
39
|
+
],
|
|
40
|
+
'web': [
|
|
41
|
+
'django>=0.0.0',
|
|
42
|
+
'djangorestframework>=0.0.0',
|
|
43
|
+
'django-allauth>=0.0.0',
|
|
39
44
|
]
|
|
40
45
|
}
|
|
41
46
|
|
sciveo-0.1.64/sciveo/version.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/audio/audio_extractor_process.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/sci/time_series/__init__.py
RENAMED
|
File without changes
|
{sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/sci/time_series/predictor.py
RENAMED
|
File without changes
|
{sciveo-0.1.64 → sciveo-0.1.65}/sciveo/media/pipelines/processors/sci/time_series/trainer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|