naeural-client 2.0.0__py3-none-any.whl

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.
Files changed (78) hide show
  1. naeural_client/__init__.py +13 -0
  2. naeural_client/_ver.py +13 -0
  3. naeural_client/base/__init__.py +6 -0
  4. naeural_client/base/distributed_custom_code_presets.py +44 -0
  5. naeural_client/base/generic_session.py +1763 -0
  6. naeural_client/base/instance.py +616 -0
  7. naeural_client/base/payload/__init__.py +1 -0
  8. naeural_client/base/payload/payload.py +66 -0
  9. naeural_client/base/pipeline.py +1499 -0
  10. naeural_client/base/plugin_template.py +5209 -0
  11. naeural_client/base/responses.py +209 -0
  12. naeural_client/base/transaction.py +157 -0
  13. naeural_client/base_decentra_object.py +143 -0
  14. naeural_client/bc/__init__.py +3 -0
  15. naeural_client/bc/base.py +1046 -0
  16. naeural_client/bc/chain.py +0 -0
  17. naeural_client/bc/ec.py +324 -0
  18. naeural_client/certs/__init__.py +0 -0
  19. naeural_client/certs/r9092118.ala.eu-central-1.emqxsl.com.crt +22 -0
  20. naeural_client/code_cheker/__init__.py +1 -0
  21. naeural_client/code_cheker/base.py +520 -0
  22. naeural_client/code_cheker/checker.py +294 -0
  23. naeural_client/comm/__init__.py +2 -0
  24. naeural_client/comm/amqp_wrapper.py +338 -0
  25. naeural_client/comm/mqtt_wrapper.py +539 -0
  26. naeural_client/const/README.md +3 -0
  27. naeural_client/const/__init__.py +9 -0
  28. naeural_client/const/base.py +101 -0
  29. naeural_client/const/comms.py +80 -0
  30. naeural_client/const/environment.py +26 -0
  31. naeural_client/const/formatter.py +7 -0
  32. naeural_client/const/heartbeat.py +111 -0
  33. naeural_client/const/misc.py +20 -0
  34. naeural_client/const/payload.py +190 -0
  35. naeural_client/default/__init__.py +1 -0
  36. naeural_client/default/instance/__init__.py +4 -0
  37. naeural_client/default/instance/chain_dist_custom_job_01_plugin.py +54 -0
  38. naeural_client/default/instance/custom_web_app_01_plugin.py +118 -0
  39. naeural_client/default/instance/net_mon_01_plugin.py +45 -0
  40. naeural_client/default/instance/view_scene_01_plugin.py +28 -0
  41. naeural_client/default/session/mqtt_session.py +72 -0
  42. naeural_client/io_formatter/__init__.py +2 -0
  43. naeural_client/io_formatter/base/__init__.py +1 -0
  44. naeural_client/io_formatter/base/base_formatter.py +80 -0
  45. naeural_client/io_formatter/default/__init__.py +3 -0
  46. naeural_client/io_formatter/default/a_dummy.py +51 -0
  47. naeural_client/io_formatter/default/aixp1.py +113 -0
  48. naeural_client/io_formatter/default/default.py +22 -0
  49. naeural_client/io_formatter/io_formatter_manager.py +96 -0
  50. naeural_client/logging/__init__.py +1 -0
  51. naeural_client/logging/base_logger.py +2056 -0
  52. naeural_client/logging/logger_mixins/__init__.py +12 -0
  53. naeural_client/logging/logger_mixins/class_instance_mixin.py +92 -0
  54. naeural_client/logging/logger_mixins/computer_vision_mixin.py +443 -0
  55. naeural_client/logging/logger_mixins/datetime_mixin.py +344 -0
  56. naeural_client/logging/logger_mixins/download_mixin.py +421 -0
  57. naeural_client/logging/logger_mixins/general_serialization_mixin.py +242 -0
  58. naeural_client/logging/logger_mixins/json_serialization_mixin.py +481 -0
  59. naeural_client/logging/logger_mixins/pickle_serialization_mixin.py +301 -0
  60. naeural_client/logging/logger_mixins/process_mixin.py +63 -0
  61. naeural_client/logging/logger_mixins/resource_size_mixin.py +81 -0
  62. naeural_client/logging/logger_mixins/timers_mixin.py +501 -0
  63. naeural_client/logging/logger_mixins/upload_mixin.py +260 -0
  64. naeural_client/logging/logger_mixins/utils_mixin.py +675 -0
  65. naeural_client/logging/small_logger.py +93 -0
  66. naeural_client/logging/tzlocal/__init__.py +20 -0
  67. naeural_client/logging/tzlocal/unix.py +231 -0
  68. naeural_client/logging/tzlocal/utils.py +113 -0
  69. naeural_client/logging/tzlocal/win32.py +151 -0
  70. naeural_client/logging/tzlocal/windows_tz.py +718 -0
  71. naeural_client/plugins_manager_mixin.py +273 -0
  72. naeural_client/utils/__init__.py +2 -0
  73. naeural_client/utils/comm_utils.py +44 -0
  74. naeural_client/utils/dotenv.py +75 -0
  75. naeural_client-2.0.0.dist-info/METADATA +365 -0
  76. naeural_client-2.0.0.dist-info/RECORD +78 -0
  77. naeural_client-2.0.0.dist-info/WHEEL +4 -0
  78. naeural_client-2.0.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,13 @@
1
+ from .base import Payload
2
+ from .base import Pipeline
3
+ from .base import Instance
4
+ from .base import CustomPluginTemplate
5
+ from .base import DistributedCustomCodePresets
6
+ from .default import MqttSession as Session
7
+ from .utils import load_dotenv
8
+ from ._ver import __VER__ as version
9
+ from ._ver import __VER__ as __version__
10
+ from .base_decentra_object import BaseDecentrAIObject
11
+ from .plugins_manager_mixin import _PluginsManagerMixin
12
+ from .logging import Logger
13
+ from .code_cheker import BaseCodeChecker
naeural_client/_ver.py ADDED
@@ -0,0 +1,13 @@
1
+ __VER__ = "2.0.0"
2
+
3
+ if __name__ == "__main__":
4
+ with open("pyproject.toml", "rt") as fd:
5
+ new_lines = []
6
+ lines = fd.readlines()
7
+ for line in lines:
8
+ if "version" in line:
9
+ line = f'version = "{__VER__}"\n'
10
+ new_lines.append(line)
11
+
12
+ with open("pyproject.toml", "wt") as fd:
13
+ fd.writelines(new_lines)
@@ -0,0 +1,6 @@
1
+ from .generic_session import GenericSession
2
+ from .payload import Payload
3
+ from .pipeline import Pipeline
4
+ from .instance import Instance
5
+ from .plugin_template import CustomPluginTemplate
6
+ from .distributed_custom_code_presets import DistributedCustomCodePresets
@@ -0,0 +1,44 @@
1
+ class DistributedCustomCodePresets():
2
+ PROCESS_REAL_TIME_COLLECTED_DATA__KEEP_UNIQUES_IN_AGGREGATED_COLLECTED_DATA = "PROCESS_REAL_TIME_COLLECTED_DATA__KEEP_UNIQUES_IN_AGGREGATED_COLLECTED_DATA"
3
+ PROCESS_REAL_TIME_COLLECTED_DATA__KEEP_UNIQUES_IN_NODE_COLLECTED_DATA = "PROCESS_REAL_TIME_COLLECTED_DATA__KEEP_UNIQUES_IN_NODE_COLLECTED_DATA"
4
+ PROCESS_REAL_TIME_COLLECTED_DATA__KEEP_IN_NODE_COLLECTED_DATA = "PROCESS_REAL_TIME_COLLECTED_DATA__KEEP_IN_NODE_COLLECTED_DATA"
5
+ FINISH_CONDITION___EACH_NODE_COLLECTED_DATA_MORE_THAN_X = "FINISH_CONDITION___EACH_NODE_COLLECTED_DATA_MORE_THAN_X"
6
+ FINISH_CONDITION___AGGREGATED_DATA_MORE_THAN_X = "FINISH_CONDITION___AGGREGATED_DATA_MORE_THAN_X"
7
+ AGGREGATE_COLLECTED_DATA___AGGREGATE_COLLECTED_DATA = "AGGREGATE_COLLECTED_DATA___AGGREGATE_COLLECTED_DATA"
8
+ AGGREGATE_COLLECTED_DATA___COLLECTED_DATA_PER_NODE = "AGGREGATE_COLLECTED_DATA___COLLECTED_DATA_PER_NODE"
9
+
10
+ def __process_real_time_collected_data__keep_uniques_in_aggregated_collected_data(plugin, job_id, collected_data, data):
11
+ all_data = sum(collected_data.values(), [])
12
+ filtered_data = list(set(d for d in data if d not in all_data))
13
+ return filtered_data
14
+
15
+ def __process_real_time_collected_data__keep_uniques_in_node_collected_data(plugin, job_id, collected_data, data):
16
+ filtered_data = list(set(d for d in data if d not in collected_data[job_id]))
17
+ return filtered_data
18
+
19
+ def __process_real_time_collected_data__keep_in_node_collected_data(plugin, job_id, collected_data, data):
20
+ return data
21
+
22
+ def __finish_condition___each_node_collected_data_more_than_x(plugin, collected_data):
23
+ kwargs = plugin.cfg_finish_condition_kwargs
24
+ if kwargs is None:
25
+ raise Exception("`FINISH_CONDITION_KWARGS` must be set!")
26
+ x = kwargs.get("X")
27
+ if x is None:
28
+ raise Exception("`X` must be set in `FINISH_CONDITION_KWARGS`!")
29
+ return all([len(data) > x for data in collected_data])
30
+
31
+ def __finish_condition___aggregated_data_more_than_x(plugin, collected_data):
32
+ kwargs = plugin.cfg_finish_condition_kwargs
33
+ if kwargs is None:
34
+ raise Exception("`FINISH_CONDITION_KWARGS` must be set!")
35
+ x = kwargs.get("X")
36
+ if x is None:
37
+ raise Exception("`X` must be set in `FINISH_CONDITION_KWARGS`!")
38
+ return len(sum(collected_data.values(), [])) > x
39
+
40
+ def __aggregate_collected_data___aggregate_collected_data(plugin, collected_data):
41
+ return sum(collected_data.values(), [])
42
+
43
+ def __aggregate_collected_data___collected_data_per_node(plugin, collected_data):
44
+ return collected_data