You can also use raw RGB values with this module so you do not have to use
the predefined color names.
+---
+
.. automodule:: pyutils.ansi
:members:
:undoc-members:
addresses, filenames, percentages, dates, datetimes, and
durations passed as flags.
+---
+
.. automodule:: pyutils.argparse_utils
:members:
:undoc-members:
- It initializes logging for your program (see :file:`logging.py`).
- It can optionally run a code and/or memory profiler on your code.
+---
+
.. automodule:: pyutils.bootstrap
:members:
:undoc-members:
All of my examples use this as does the pyutils library itself.
+---
+
.. automodule:: pyutils.config
:members:
:undoc-members:
This is a grab bag of decorators.
+---
+
.. automodule:: pyutils.decorator_utils
:members:
:undoc-members:
A bunch of helpers for dealing with Python dicts.
+---
+
.. automodule:: pyutils.dict_utils
:members:
:undoc-members:
Helper code for dealing with subprocesses.
+---
+
.. automodule:: pyutils.exec_utils
:members:
:undoc-members:
Helper util for dealing with functions.
+---
+
.. automodule:: pyutils.function_utils
:members:
:undoc-members:
Generate unique identifiers.
+---
+
.. automodule:: pyutils.id_generator
:members:
:undoc-members:
Iterator utilities including a :py:class:`PeekingIterator`, :py:class:`PushbackIterator`,
and :py:class:`SamplingIterator`.
+---
+
.. automodule:: pyutils.iter_utils
:members:
:undoc-members:
Utilities for dealing with Python lists.
+---
+
.. automodule:: pyutils.list_utils
:members:
:undoc-members:
- Log probalistically,
- Clear rogue logging handlers added by other imports.
+---
+
.. automodule:: pyutils.logging_utils
:members:
:undoc-members:
computation, literate float truncation, percentage <-> multiplier, prime
number determination, etc...
+---
+
.. automodule:: pyutils.math_utils
:members:
:undoc-members:
Miscellaneous utilities: are we running as root, and is a debugger attached?
+---
+
.. automodule:: pyutils.misc_utils
:members:
:undoc-members:
from some external location and (optionally / conditionally) save their
state to an external location at shutdown.
+---
+
.. automodule:: pyutils.persistent
:members:
:undoc-members:
run pickled code on a remote machine. It is used by code marked with
`@parallelize(method=Method.REMOTE)` in the parallelize framework.
+---
+
.. automodule:: pyutils.remote_worker
:members:
:undoc-members:
(either automatically or when invoked to poll) and allow their callers
to wait on state changes.
+---
+
.. automodule:: pyutils.state_tracker
:members:
:undoc-members:
This is a stopwatch context that just times how long something took to
execute.
+---
+
.. automodule:: pyutils.stopwatch
:members:
:undoc-members:
starting library from Davide Zanotti, I've added a pile of other string
functions so hopefully it will handle all of your string-needs.
+---
+
.. automodule:: pyutils.string_utils
:members:
:undoc-members:
- create a header line,
- draw a box around some text.
+---
+
.. automodule:: pyutils.text_utils
:members:
:undoc-members:
Utilities to support smarter unit tests.
+---
+
.. automodule:: pyutils.unittest_utils
:members:
:undoc-members:
Unscramble scrambled English words quickly.
+---
+
.. automodule:: pyutils.unscrambler
:members:
:undoc-members:
A helper module for dealing with Zookeeper that adds some functionality.
+---
+
.. automodule:: pyutils.zookeeper
:members:
:undoc-members:
Module contents
---------------
+---
+
.. automodule:: pyutils
:members:
:undoc-members:
# © Copyright 2021-2022, Scott Gasch
-"""A decorator to help with dead simple parallelization."""
+"""A decorator to help with dead simple parallelization. See usage
+below.
+
+This will just work with `Method.THREAD` and `Method.PROCESS` but to
+use `Method.REMOTE` you need to do some setup work. You need to
+configure a pool of workers. Each worker should run the same version
+of Python, ideally in identically configured virtual environments.
+And you need to be able to ssh into each machine using key-based
+authentication (i.e. non-iteractively) and run python. List machines
+in the location set by `--remote_worker_records_file` (see
+:file:executors.h for flag and an example JSON file under examples).
+
+"""
import atexit