danielutils 1.0.37__tar.gz → 1.0.39__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.
- {danielutils-1.0.37/danielutils.egg-info → danielutils-1.0.39}/PKG-INFO +1 -1
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/async_/__init__.py +3 -2
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/async_/async_layered_command.py +1 -3
- danielutils-1.0.39/danielutils/async_/async_worker_pool.py +100 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/async_/utils.py +17 -1
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/functions/isoftype.py +14 -1
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/java/__init__.py +2 -2
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/java/java_interface.py +1 -1
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/logging_/builtin_impls/file_logger.py +1 -1
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/class_info.py +3 -3
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/retry_executor/backoff_strategy.py +1 -1
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/retry_executor/retry_executor.py +1 -1
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/testing/unittest_/auto_cwd_testcase.py +13 -5
- {danielutils-1.0.37 → danielutils-1.0.39/danielutils.egg-info}/PKG-INFO +1 -1
- {danielutils-1.0.37 → danielutils-1.0.39}/pyproject.toml +1 -1
- danielutils-1.0.37/danielutils/async_/async_worker_pool.py +0 -66
- {danielutils-1.0.37 → danielutils-1.0.39}/LICENSE +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/MANIFEST.in +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/README.md +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/abstractions/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/abstractions/database/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/abstractions/database/cached_database.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/abstractions/database/database.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/abstractions/database/redis_database.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/abstractions/multiprogramming/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/abstractions/multiprogramming/multi_id.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/abstractions/multiprogramming/worker.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/abstractions/multiprogramming/worker_pool.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/abstractions/repl.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/aliases.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/async_/async_cmd.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/async_/async_retry_executor.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/async_/time_strategy.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/better_builtins/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/better_builtins/counter.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/better_builtins/frange.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/better_builtins/typed_builtins/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/better_builtins/typed_builtins/factory.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/better_builtins/typed_builtins/tdict.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/better_builtins/typed_builtins/tlist.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/better_builtins/typed_builtins/tset.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/better_builtins/typed_builtins/ttuple.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/colors.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/context_managers/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/context_managers/attr_context.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/context_managers/multi_context.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/context_managers/optional_context.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/context_managers/state_context.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/context_managers/temporary_file.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/convenience.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/conversions/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/conversions/main_conversions.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/conversions/specialized_conversions/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/conversions/specialized_conversions/to_hex.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/conversions/specialized_conversions/to_int.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/custom_types.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/algorithms.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/comparer.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/default_dict.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/functions.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/graph/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/graph/binary_node.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/graph/graph.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/graph/multinode.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/graph/node.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/heap/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/heap/heap.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/heap/max_heap.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/heap/min_heap.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/queue/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/queue/atomic_queue.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/queue/priority_queue.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/queue/queue.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/stack.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/trees/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/trees/binary_syntax_tree.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/trees/binary_tree.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/date.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/date_time.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/atomic.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/attach.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/chain_decorators.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/decorate_conditionally.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/delay_call.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/deprecate.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/final.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/limit_recursion.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/memo.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/normalize_decorator.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/overload.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/partially_implemented.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/processify.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/property.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/singleton.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/threadify.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/timeout.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/total_ordering.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/decorators/validate.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/exceptions.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/file_specifications/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/functions/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/functions/areoneof.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/functions/check_foreach.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/functions/factorial.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/functions/flatten.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/functions/foreach.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/functions/isoneof.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/functions/multiloop.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/functions/parallel_for.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/functions/partition.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/functions/powerset.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/functions/subseteq.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/functions/types_subseteq.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/generators/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/generators/conditional_generator.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/generators/generator_from_stream.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/generators/join_generators.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/internet.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/io_.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/java/interfaces/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/java/interfaces/comparable.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/logging_/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/logging_/builtin_impls/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/logging_/builtin_impls/print_logger.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/logging_/log_level.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/logging_/logger.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/logging_/logger_strategy_impl_base.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/lombok/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/lombok/builder.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/math_/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/math_/constants.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/math_/functions.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/math_/math_print.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/math_/math_symbols.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/metaclasses/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/metaclasses/atomic_class_meta.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/metaclasses/implicit_data_deleter_meta.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/metaclasses/instance_cache_meta.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/metaclasses/interface.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/metaclasses/overload_meta.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/mock_/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/mock_/mock_database.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/mock_/mock_module.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/path.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/print_.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/progress_bar/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/progress_bar/ascii_progress_bar.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/progress_bar/progress_bar.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/progress_bar/progress_bar_pool.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/protocols/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/protocols/dictable.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/protocols/evaluable.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/protocols/serializable.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/py.typed +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/random_.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/argument_info.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/class_/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/class_/class_reflection.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/decoration_info.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/file/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/file/file_reflection.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/function/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/function/function_reflections.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/function_info.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/interpreter/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/interpreter/callstack.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/interpreter/get_traceback.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/interpreter/interpreter.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/interpreter/is_debugging.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/interpreter/os_.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/interpreter/packages.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/interpreter/python_version.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/interpreter/signals.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/interpreter/tracer.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/module/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/module/module_reflections.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/reflection/module/package_reflection.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/retry_executor/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/retry_executor/backoff_strategies/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/retry_executor/backoff_strategies/constant_backoff.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/retry_executor/backoff_strategies/exponential_backoff.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/retry_executor/backoff_strategies/functional_backoff.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/retry_executor/backoff_strategies/linear_backoff.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/retry_executor/backoff_strategies/multiplicative_backoff.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/retry_executor/backoff_strategies/no_backoff.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/snippets/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/snippets/try_get.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/system/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/system/independent.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/system/layered_command.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/system/windows/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/system/windows/utils/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/system/windows/utils/filetime.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/system/windows/win32_ctime.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/system/windows/windows.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/testing/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/testing/unittest_/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/testing/unittest_/always_teardown_testcase.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/text.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/time.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/computability_and_complexity/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/computability_and_complexity/discreate_finite_automaton.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/computability_and_complexity/languages/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/computability_and_complexity/languages/language.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/computability_and_complexity/languages/sat.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/computability_and_complexity/turing_machine.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/databases/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/databases/all.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/image_proccesing/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/image_proccesing/encoding/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/image_proccesing/encoding/encoding.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/image_proccesing/encoding/lossless/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/image_proccesing/encoding/lossless/huffman.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/image_proccesing/encoding/lossless/lossless_encoding.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/image_proccesing/encoding/lossless/lzw.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/image_proccesing/encoding/lossless/run_length.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/image_proccesing/encoding/lossy/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/image_proccesing/encoding/lossy/lossy_encoding.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/image_proccesing/tansformations/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/image_proccesing/tansformations/gaussian.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/image_proccesing/tansformations/gradient.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/image_proccesing/tansformations/hough.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/image_proccesing/tansformations/laplacian.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/image_proccesing/tansformations/transformation.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/linear_algebra/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/linear_algebra/matrix.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/machine_learning/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/machine_learning/activation_functions/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/machine_learning/activation_functions/activation_function.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/machine_learning/activation_functions/relu.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/machine_learning/neuron.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/oop/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/oop/observer.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/oop/strategy.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/conditional_variable/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/conditional_variable/conditional_variable.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/conditional_variable/continuous/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/conditional_variable/discrete/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/conditional_variable/discrete/bernoulli.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/conditional_variable/discrete/binomial.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/conditional_variable/discrete/conditional_from_discrete_probability_func.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/conditional_variable/discrete/discrete.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/conditional_variable/discrete/geometric.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/conditional_variable/discrete/poisson.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/conditional_variable/discrete/uniform.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/distributions.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/expressions/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/expressions/accumulation_expression.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/expressions/probability_expression.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/funcs/__init__.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/funcs/covariance.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/funcs/expected_value.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/funcs/probability_function.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/funcs/variance.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/operator.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/protocols.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/supp.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/university/probability/transformation.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils/versioned_imports.py +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils.egg-info/SOURCES.txt +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils.egg-info/dependency_links.txt +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/danielutils.egg-info/top_level.txt +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/setup.cfg +0 -0
- {danielutils-1.0.37 → danielutils-1.0.39}/setup.py +0 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import json
|
|
3
|
+
from collections import defaultdict
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
from typing import Callable, Literal, Optional, Coroutine, List, Iterable, Any, Mapping, Tuple
|
|
6
|
+
from tqdm import tqdm
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class AsyncWorkerPool:
|
|
10
|
+
DEFAULT_ORDER_IF_KEY_EXISTS = (
|
|
11
|
+
"pool", "timestamp", "worker_id", "task_id", "task_name", "num_tasks", "tasks", "level", "message", "exception"
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
def __init__(self, pool_name: str, num_workers: int = 5, show_pbar: bool = False) -> None:
|
|
15
|
+
self._num_workers: int = num_workers
|
|
16
|
+
self._pool_name: str = pool_name
|
|
17
|
+
self._show_pbar: bool = show_pbar
|
|
18
|
+
self._pbar: Optional[tqdm] = None
|
|
19
|
+
self._queue: asyncio.Queue[
|
|
20
|
+
Optional[Tuple[Callable, Iterable[Any], Mapping[Any, Any], Optional[str]]]] = asyncio.Queue()
|
|
21
|
+
self._workers: List = []
|
|
22
|
+
|
|
23
|
+
async def worker(self, worker_id) -> None:
|
|
24
|
+
"""Worker coroutine that continuously fetches and executes tasks from the queue."""
|
|
25
|
+
task_index = 0
|
|
26
|
+
tasks = defaultdict(list)
|
|
27
|
+
while True:
|
|
28
|
+
task = await self._queue.get()
|
|
29
|
+
if task is None: # Sentinel value to shut down the worker
|
|
30
|
+
break
|
|
31
|
+
func, args, kwargs, name = task
|
|
32
|
+
task_index += 1
|
|
33
|
+
self._info(f"Started", task_id=task_index, task_name=name, worker_id=worker_id)
|
|
34
|
+
try:
|
|
35
|
+
await func(*args, **kwargs)
|
|
36
|
+
tasks["success"].append(name)
|
|
37
|
+
self._info(f"Finished", task_id=task_index, worker_id=worker_id, task_name=name)
|
|
38
|
+
except Exception as e:
|
|
39
|
+
self._error(f"Failed", task_id=task_index, exception=e, worker_id=worker_id,
|
|
40
|
+
task_name=name)
|
|
41
|
+
tasks["failure"].append(name)
|
|
42
|
+
|
|
43
|
+
if self._pbar:
|
|
44
|
+
self._pbar.update(1)
|
|
45
|
+
self._queue.task_done()
|
|
46
|
+
self._info(f"Done", worker_id=worker_id, tasks=tasks, num_tasks=task_index)
|
|
47
|
+
|
|
48
|
+
async def start(self) -> None:
|
|
49
|
+
"""Starts the worker pool."""
|
|
50
|
+
if self._show_pbar:
|
|
51
|
+
self._pbar = tqdm(total=self._queue.qsize(), desc="#Tasks")
|
|
52
|
+
self._workers = [asyncio.create_task(self.worker(i + 1)) for i in range(self._num_workers)]
|
|
53
|
+
|
|
54
|
+
async def submit(
|
|
55
|
+
self,
|
|
56
|
+
func: Callable[..., Coroutine[None, None, None]],
|
|
57
|
+
args: Optional[Iterable[Any]] = None,
|
|
58
|
+
kwargs: Optional[Mapping[Any, Any]] = None,
|
|
59
|
+
name: Optional[str] = None
|
|
60
|
+
) -> None:
|
|
61
|
+
"""Submit a new task to the queue."""
|
|
62
|
+
await self._queue.put((func, args or (), kwargs or {}, name))
|
|
63
|
+
|
|
64
|
+
async def join(self) -> None:
|
|
65
|
+
"""Stops the worker pool by waiting for all tasks to complete and shutting down workers."""
|
|
66
|
+
await self._queue.join() # Wait until all tasks are processed
|
|
67
|
+
for _ in range(self._num_workers):
|
|
68
|
+
await self._queue.put(None) # Send sentinel values to stop workers
|
|
69
|
+
await asyncio.gather(*self._workers) # Wait for workers to finish
|
|
70
|
+
|
|
71
|
+
@classmethod
|
|
72
|
+
def log(
|
|
73
|
+
self,
|
|
74
|
+
level: Literal["INFO", "WARNING", "ERROR"],
|
|
75
|
+
message: str,
|
|
76
|
+
order: Optional[Iterable[str]] = DEFAULT_ORDER_IF_KEY_EXISTS,
|
|
77
|
+
**kwargs
|
|
78
|
+
) -> None:
|
|
79
|
+
kwargs["level"] = level
|
|
80
|
+
kwargs["message"] = message
|
|
81
|
+
kwargs["timestamp"] = datetime.now().isoformat()
|
|
82
|
+
ordered_kwargs = kwargs
|
|
83
|
+
if order:
|
|
84
|
+
ordered_kwargs = {key: kwargs[key] for key in order if key in kwargs}
|
|
85
|
+
ordered_kwargs.update(kwargs)
|
|
86
|
+
print(json.dumps(ordered_kwargs, default=str))
|
|
87
|
+
|
|
88
|
+
def _info(self, message: str, **kwargs) -> None:
|
|
89
|
+
self.log("INFO", message, pool=self._pool_name, **kwargs)
|
|
90
|
+
|
|
91
|
+
def _warn(self, message: str, **kwargs) -> None:
|
|
92
|
+
self.log("WARNING", message, pool=self._pool_name, **kwargs)
|
|
93
|
+
|
|
94
|
+
def _error(self, message: str, **kwargs) -> None:
|
|
95
|
+
self.log("ERROR", message, pool=self._pool_name, **kwargs)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
__all__ = [
|
|
99
|
+
"AsyncWorkerPool",
|
|
100
|
+
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
from asyncio import Task
|
|
3
|
-
from typing import List, Coroutine, Any, Tuple, Optional, Set
|
|
3
|
+
from typing import List, Coroutine, Any, Tuple, Optional, Set, AsyncIterator, Iterator, TypeVar
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
async def return_first(coros: List[Coroutine], timeout: Optional[int] = None) -> List[Tuple[int, Any]]:
|
|
@@ -26,7 +26,23 @@ async def return_all(coros: List[Coroutine], timeout: Optional[int] = None) -> L
|
|
|
26
26
|
return [task.result() for task in done]
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
async def cast_aiter(itr: Iterator) -> AsyncIterator:
|
|
30
|
+
for x in itr:
|
|
31
|
+
yield x
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
T = TypeVar("T")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
async def async_enumerate(iterable: AsyncIterator[T], start: int = 0) -> AsyncIterator[Tuple[int, T]]:
|
|
38
|
+
index = start
|
|
39
|
+
async for item in iterable:
|
|
40
|
+
yield index, item
|
|
41
|
+
index += 1
|
|
42
|
+
|
|
43
|
+
|
|
29
44
|
__all__ = [
|
|
30
45
|
"return_first",
|
|
31
46
|
"return_all",
|
|
47
|
+
'cast_aiter'
|
|
32
48
|
]
|
|
@@ -352,6 +352,12 @@ def __handle_type(params: tuple) -> bool:
|
|
|
352
352
|
return False
|
|
353
353
|
|
|
354
354
|
|
|
355
|
+
def __handle_unpack(params: tuple) -> bool:
|
|
356
|
+
# TODO see test_tlist.py -> test_wrong_values -> with self.assertRaises(TypeError):
|
|
357
|
+
# tlist[Tuple[int]]([[1], [2], [3], ["4"]])
|
|
358
|
+
raise NotImplemented
|
|
359
|
+
|
|
360
|
+
|
|
355
361
|
HANDLERS: Dict[type, Callable] = {
|
|
356
362
|
list: __handle_list_set_iterable,
|
|
357
363
|
tuple: __handle_tuple,
|
|
@@ -371,6 +377,13 @@ HANDLERS: Dict[type, Callable] = {
|
|
|
371
377
|
Callable: __handle_callable,
|
|
372
378
|
Protocol: __handle_protocol,
|
|
373
379
|
}
|
|
380
|
+
try:
|
|
381
|
+
# This exists only from python version 3.11 onwards
|
|
382
|
+
from typing import Unpack
|
|
383
|
+
|
|
384
|
+
HANDLERS[Unpack] = __handle_unpack
|
|
385
|
+
except:
|
|
386
|
+
pass
|
|
374
387
|
|
|
375
388
|
|
|
376
389
|
def isoftype(V: Any, T: Any, /, strict: bool = True) -> bool:
|
|
@@ -431,4 +444,4 @@ def isoftype(V: Any, T: Any, /, strict: bool = True) -> bool:
|
|
|
431
444
|
|
|
432
445
|
__all__ = [
|
|
433
446
|
"isoftype"
|
|
434
|
-
]
|
|
447
|
+
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
try:
|
|
2
|
-
from reflection import get_python_version
|
|
3
|
-
except ImportError:
|
|
4
2
|
from ..reflection import get_python_version # type:ignore
|
|
3
|
+
except ImportError:
|
|
4
|
+
from reflection import get_python_version
|
|
5
5
|
|
|
6
6
|
if get_python_version() >= (3, 10):
|
|
7
7
|
from .interfaces import *
|
|
@@ -26,7 +26,7 @@ class JavaInterface(ABC):
|
|
|
26
26
|
print(set(info.inherited_methods))
|
|
27
27
|
actual_func_names = set(f.name for f in info.functions)
|
|
28
28
|
for to_remove in {"__class_getitem__", "__init_subclass__"}:
|
|
29
|
-
if getattr(cls, to_remove, None) is getattr(JavaInterface, to_remove, None):
|
|
29
|
+
if hasattr(cls, to_remove) and getattr(cls, to_remove, None) is getattr(JavaInterface, to_remove, None):
|
|
30
30
|
actual_func_names.remove(to_remove)
|
|
31
31
|
for interface in (base for base in cls.__mro__ if getattr(base, "__is_interface__", False)):
|
|
32
32
|
expected_func_names = set(f.name for f in ClassInfo(interface).abstract_methods)
|
|
@@ -5,7 +5,7 @@ from typing import Optional, List, Iterable, Type, TypeVar, Generic, get_origin
|
|
|
5
5
|
from .function_info import FunctionInfo
|
|
6
6
|
from .decoration_info import DecorationInfo
|
|
7
7
|
from .argument_info import ArgumentInfo
|
|
8
|
-
from
|
|
8
|
+
from ..functions import isoftype
|
|
9
9
|
|
|
10
10
|
T = TypeVar("T")
|
|
11
11
|
|
|
@@ -20,7 +20,7 @@ del T, _A
|
|
|
20
20
|
|
|
21
21
|
class ClassInfo:
|
|
22
22
|
CLASS_DEFINITION_REGEX: re.Pattern = re.compile(
|
|
23
|
-
r"(?P<decorations>[\s\S]*)
|
|
23
|
+
r"(?P<decorations>[\s\S]*)?(^)?class (?P<name>\w[\w\d]*)(?:\((?P<bases>.*)\))?:(?P<body>[\s\S]+)", re.MULTILINE)
|
|
24
24
|
|
|
25
25
|
# r"(?P<decorations>[\s\S]*)?^class (?P<name>\w[\w\d]*)(?:\((?P<bases>.*)\))?:(?P<body>[\s\S]+)"
|
|
26
26
|
|
|
@@ -42,7 +42,7 @@ class ClassInfo:
|
|
|
42
42
|
m = ClassInfo.CLASS_DEFINITION_REGEX.match(self._src_code)
|
|
43
43
|
if m is None:
|
|
44
44
|
raise SyntaxError()
|
|
45
|
-
decorators, name, bases, _ = m.
|
|
45
|
+
decorators, name, bases, _ = m.groupdict().values()
|
|
46
46
|
self._name = name
|
|
47
47
|
self._bases = ArgumentInfo.from_str(bases)
|
|
48
48
|
self._parse_body()
|
{danielutils-1.0.37 → danielutils-1.0.39}/danielutils/testing/unittest_/auto_cwd_testcase.py
RENAMED
|
@@ -2,11 +2,12 @@ import asyncio
|
|
|
2
2
|
import functools
|
|
3
3
|
import os
|
|
4
4
|
import unittest
|
|
5
|
-
import
|
|
6
|
-
from inspect import iscoroutine, iscoroutinefunction
|
|
5
|
+
from inspect import iscoroutinefunction
|
|
7
6
|
from typing import Callable, Type, Coroutine, Union, Any
|
|
8
7
|
|
|
9
|
-
from
|
|
8
|
+
from ...random_ import RandomDataGenerator
|
|
9
|
+
from ...io_ import create_directory, delete_directory, directory_exists
|
|
10
|
+
from ...path import get_current_working_directory, set_current_working_directory
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
def dispatch_function(func: Union[Callable, Coroutine], *args, **kwargs) -> Any:
|
|
@@ -18,10 +19,17 @@ def dispatch_function(func: Union[Callable, Coroutine], *args, **kwargs) -> Any:
|
|
|
18
19
|
return func(*args, **kwargs)
|
|
19
20
|
|
|
20
21
|
|
|
22
|
+
def get_available_folder_name(prefix_path: str, random_suffix_length: int = 15) -> str:
|
|
23
|
+
res = f"{prefix_path}_{RandomDataGenerator.name(random_suffix_length)}"
|
|
24
|
+
while directory_exists(res):
|
|
25
|
+
res = f"{prefix_path}_{RandomDataGenerator.name(random_suffix_length)}"
|
|
26
|
+
return res
|
|
27
|
+
|
|
28
|
+
|
|
21
29
|
def improved_setup(func: Callable) -> Callable:
|
|
22
30
|
@functools.wraps(func)
|
|
23
31
|
def wrapper(self):
|
|
24
|
-
self.cwd = f"./{self.__class__.__name__}_test_folder"
|
|
32
|
+
self.cwd = get_available_folder_name(f"./{self.__class__.__name__}_test_folder")
|
|
25
33
|
create_directory(self.cwd)
|
|
26
34
|
self.prev_cwd = get_current_working_directory()
|
|
27
35
|
set_current_working_directory(os.path.join(self.prev_cwd, self.cwd))
|
|
@@ -30,7 +38,7 @@ def improved_setup(func: Callable) -> Callable:
|
|
|
30
38
|
|
|
31
39
|
@functools.wraps(func)
|
|
32
40
|
async def async_wrapper(self):
|
|
33
|
-
self.cwd = f"./{self.__class__.__name__}_test_folder"
|
|
41
|
+
self.cwd = get_available_folder_name(f"./{self.__class__.__name__}_test_folder")
|
|
34
42
|
create_directory(self.cwd)
|
|
35
43
|
self.prev_cwd = get_current_working_directory()
|
|
36
44
|
set_current_working_directory(os.path.join(self.prev_cwd, self.cwd))
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import asyncio
|
|
2
|
-
import json
|
|
3
|
-
from typing import Callable, Literal, Optional, Coroutine
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class AsyncWorkerPool:
|
|
7
|
-
def __init__(self, pool_name: str, num_workers: int = 5) -> None:
|
|
8
|
-
self.num_workers = num_workers
|
|
9
|
-
self.pool_name = pool_name
|
|
10
|
-
self.queue = asyncio.Queue()
|
|
11
|
-
self.workers = []
|
|
12
|
-
|
|
13
|
-
async def worker(self, worker_id) -> None:
|
|
14
|
-
"""Worker coroutine that continuously fetches and executes tasks from the queue."""
|
|
15
|
-
task_count = 0
|
|
16
|
-
while True:
|
|
17
|
-
task = await self.queue.get()
|
|
18
|
-
if task is None: # Sentinel value to shut down the worker
|
|
19
|
-
break
|
|
20
|
-
task_count += 1
|
|
21
|
-
func, args, kwargs = task
|
|
22
|
-
self.info(f"Worker {worker_id} started with task {task_count}")
|
|
23
|
-
|
|
24
|
-
try:
|
|
25
|
-
await func(*args, **kwargs)
|
|
26
|
-
except Exception as e:
|
|
27
|
-
self.error(f"Worker {worker_id} failed task {task_count}", exception=e)
|
|
28
|
-
|
|
29
|
-
self.info(f"Worker {worker_id} finished with task {task_count}")
|
|
30
|
-
self.queue.task_done()
|
|
31
|
-
self.info(f"Worker {worker_id} done executed {task_count} tasks.")
|
|
32
|
-
|
|
33
|
-
async def start(self) -> None:
|
|
34
|
-
"""Starts the worker pool."""
|
|
35
|
-
self.workers = [asyncio.create_task(self.worker(i + 1)) for i in range(self.num_workers)]
|
|
36
|
-
|
|
37
|
-
async def submit(self, func: Callable[..., Coroutine[None, None, None]], *args, **kwargs) -> None:
|
|
38
|
-
"""Submit a new task to the queue."""
|
|
39
|
-
await self.queue.put((func, args, kwargs))
|
|
40
|
-
|
|
41
|
-
async def join(self) -> None:
|
|
42
|
-
"""Stops the worker pool by waiting for all tasks to complete and shutting down workers."""
|
|
43
|
-
await self.queue.join() # Wait until all tasks are processed
|
|
44
|
-
for _ in range(self.num_workers):
|
|
45
|
-
await self.queue.put(None) # Send sentinel values to stop workers
|
|
46
|
-
await asyncio.gather(*self.workers) # Wait for workers to finish
|
|
47
|
-
|
|
48
|
-
def log(self, level: Literal["INFO", "WARNING", "ERROR"], message: str, **kwargs) -> None:
|
|
49
|
-
kwargs["level"] = level
|
|
50
|
-
kwargs["message"] = message
|
|
51
|
-
kwargs["pool"] = self.pool_name
|
|
52
|
-
print(json.dumps(kwargs, default=str))
|
|
53
|
-
|
|
54
|
-
def info(self, message: str, **kwargs) -> None:
|
|
55
|
-
self.log("INFO", message, **kwargs)
|
|
56
|
-
|
|
57
|
-
def warn(self, message: str, **kwargs) -> None:
|
|
58
|
-
self.log("WARNING", message, **kwargs)
|
|
59
|
-
|
|
60
|
-
def error(self, message: str, **kwargs) -> None:
|
|
61
|
-
self.log("ERROR", message, **kwargs)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
__all__ = [
|
|
65
|
-
"AsyncWorkerPool",
|
|
66
|
-
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{danielutils-1.0.37 → danielutils-1.0.39}/danielutils/abstractions/database/cached_database.py
RENAMED
|
File without changes
|
|
File without changes
|
{danielutils-1.0.37 → danielutils-1.0.39}/danielutils/abstractions/database/redis_database.py
RENAMED
|
File without changes
|
{danielutils-1.0.37 → danielutils-1.0.39}/danielutils/abstractions/multiprogramming/__init__.py
RENAMED
|
File without changes
|
{danielutils-1.0.37 → danielutils-1.0.39}/danielutils/abstractions/multiprogramming/multi_id.py
RENAMED
|
File without changes
|
{danielutils-1.0.37 → danielutils-1.0.39}/danielutils/abstractions/multiprogramming/worker.py
RENAMED
|
File without changes
|
{danielutils-1.0.37 → danielutils-1.0.39}/danielutils/abstractions/multiprogramming/worker_pool.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
|
{danielutils-1.0.37 → danielutils-1.0.39}/danielutils/better_builtins/typed_builtins/__init__.py
RENAMED
|
File without changes
|
{danielutils-1.0.37 → danielutils-1.0.39}/danielutils/better_builtins/typed_builtins/factory.py
RENAMED
|
File without changes
|
{danielutils-1.0.37 → danielutils-1.0.39}/danielutils/better_builtins/typed_builtins/tdict.py
RENAMED
|
File without changes
|
{danielutils-1.0.37 → danielutils-1.0.39}/danielutils/better_builtins/typed_builtins/tlist.py
RENAMED
|
File without changes
|
{danielutils-1.0.37 → danielutils-1.0.39}/danielutils/better_builtins/typed_builtins/tset.py
RENAMED
|
File without changes
|
{danielutils-1.0.37 → danielutils-1.0.39}/danielutils/better_builtins/typed_builtins/ttuple.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
|
{danielutils-1.0.37 → danielutils-1.0.39}/danielutils/conversions/specialized_conversions/to_hex.py
RENAMED
|
File without changes
|
{danielutils-1.0.37 → danielutils-1.0.39}/danielutils/conversions/specialized_conversions/to_int.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
|
{danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/queue/priority_queue.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{danielutils-1.0.37 → danielutils-1.0.39}/danielutils/data_structures/trees/binary_syntax_tree.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
|